code stringlengths 1 1.49M | vector listlengths 0 7.38k | snippet listlengths 0 7.38k |
|---|---|---|
"""
Implementation of JSONEncoder
"""
import re
try:
from simplejson._speedups import encode_basestring_ascii as c_encode_basestring_ascii
except ImportError:
pass
ESCAPE = re.compile(r'[\x00-\x1f\\"\b\f\n\r\t]')
ESCAPE_ASCII = re.compile(r'([\\"]|[^\ -~])')
HAS_UTF8 = re.compile(r'[\x80-\xff]')
ESCAPE_DCT = ... | [
[
8,
0,
0.0052,
0.0078,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0104,
0.0026,
0,
0.66,
0.0667,
540,
0,
1,
0,
0,
540,
0,
0
],
[
7,
0,
0.0195,
0.0104,
0,
0.66... | [
"\"\"\"\nImplementation of JSONEncoder\n\"\"\"",
"import re",
"try:\n from simplejson._speedups import encode_basestring_ascii as c_encode_basestring_ascii\nexcept ImportError:\n pass",
" from simplejson._speedups import encode_basestring_ascii as c_encode_basestring_ascii",
"ESCAPE = re.compile(r'... |
"""
Implementation of JSONDecoder
"""
import re
import sys
from simplejson.scanner import Scanner, pattern
try:
from simplejson._speedups import scanstring as c_scanstring
except ImportError:
pass
FLAGS = re.VERBOSE | re.MULTILINE | re.DOTALL
def _floatconstants():
import struct
import sys
_BYTES... | [
[
8,
0,
0.0058,
0.0087,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0117,
0.0029,
0,
0.66,
0.0333,
540,
0,
1,
0,
0,
540,
0,
0
],
[
1,
0,
0.0146,
0.0029,
0,
0.66... | [
"\"\"\"\nImplementation of JSONDecoder\n\"\"\"",
"import re",
"import sys",
"from simplejson.scanner import Scanner, pattern",
"try:\n from simplejson._speedups import scanstring as c_scanstring\nexcept ImportError:\n pass",
" from simplejson._speedups import scanstring as c_scanstring",
"FLAGS... |
r"""
A simple, fast, extensible JSON encoder and decoder
JSON (JavaScript Object Notation) <http://json.org> is a subset of
JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data
interchange format.
simplejson exposes an API familiar to uses of the standard library
marshal and pickle modules.
Encoding b... | [
[
8,
0,
0.1356,
0.2686,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.2713,
0.0027,
0,
0.66,
0.0714,
162,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.2779,
0.0106,
0,
0.66... | [
"r\"\"\"\nA simple, fast, extensible JSON encoder and decoder\n\nJSON (JavaScript Object Notation) <http://json.org> is a subset of\nJavaScript syntax (ECMA-262 3rd edition) used as a lightweight data\ninterchange format.\n\nsimplejson exposes an API familiar to uses of the standard library",
"__version__ = '1.9.... |
"""
Iterator based sre token scanner
"""
import re
from re import VERBOSE, MULTILINE, DOTALL
import sre_parse
import sre_compile
import sre_constants
from sre_constants import BRANCH, SUBPATTERN
__all__ = ['Scanner', 'pattern']
FLAGS = (VERBOSE | MULTILINE | DOTALL)
class Scanner(object):
def __init__(self, lexi... | [
[
8,
0,
0.0299,
0.0448,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0597,
0.0149,
0,
0.66,
0.1,
540,
0,
1,
0,
0,
540,
0,
0
],
[
1,
0,
0.0746,
0.0149,
0,
0.66,
... | [
"\"\"\"\nIterator based sre token scanner\n\"\"\"",
"import re",
"from re import VERBOSE, MULTILINE, DOTALL",
"import sre_parse",
"import sre_compile",
"import sre_constants",
"from sre_constants import BRANCH, SUBPATTERN",
"__all__ = ['Scanner', 'pattern']",
"FLAGS = (VERBOSE | MULTILINE | DOTALL)"... |
# Much the below modified from the gae-json-rest project
import plistlib
import logging
import re
import touchengineutil
def id_of(entity):
""" Make a {'id': <string-of-digits>} dict for an entity.
Args:
entity: an entity
Returns:
a jobj corresponding to the entity
"""
return dict(id=touchengineut... | [
[
1,
0,
0.0755,
0.0189,
0,
0.66,
0,
592,
0,
1,
0,
0,
592,
0,
0
],
[
1,
0,
0.0943,
0.0189,
0,
0.66,
0.1667,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.1132,
0.0189,
0,
... | [
"import plistlib",
"import logging",
"import re",
"import touchengineutil",
"def id_of(entity):\n \"\"\" Make a {'id': <string-of-digits>} dict for an entity.\n\n Args:\n entity: an entity\n Returns:\n a jobj corresponding to the entity\n \"\"\"",
" \"\"\" Make a {'id': <string-of-digits>} dict... |
#!/usr/bin/env python
import logging
import time
import re
import wsgiref.handlers
from google.appengine.ext import webapp
from google.appengine.ext.db import Key
import cookutil
import touchengineutil
import plistutil
# RE to match: optional /, classname, optional /, ID of 0+ numeric digits
CLASSNAME_ID_RE = re.co... | [
[
1,
0,
0.0186,
0.0062,
0,
0.66,
0,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.0248,
0.0062,
0,
0.66,
0.0909,
654,
0,
1,
0,
0,
654,
0,
0
],
[
1,
0,
0.0311,
0.0062,
0,
... | [
"import logging",
"import time",
"import re",
"import wsgiref.handlers",
"from google.appengine.ext import webapp",
"from google.appengine.ext.db import Key",
"import cookutil",
"import touchengineutil",
"import plistutil",
"CLASSNAME_ID_RE = re.compile(r'^/?(\\w+)/?(\\d*)$')",
"def path_to_clas... |
""" Utilities for JSON REST CRUD support for GAE db models.
Terminology: a subclass of db.Model is known as "a Model"; an instance of
such a subclass is known as "an entity".
Data is said to be in JSONed or JSONable form if it contains only dicts, lists
and scalars (strings, numbers) in a form that is correctly seria... | [
[
8,
0,
0.051,
0.0952,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.102,
0.0068,
0,
0.66,
0.0833,
540,
0,
1,
0,
0,
540,
0,
0
],
[
1,
0,
0.1156,
0.0068,
0,
0.66,
... | [
"\"\"\" Utilities for JSON REST CRUD support for GAE db models.\n\nTerminology: a subclass of db.Model is known as \"a Model\"; an instance of\nsuch a subclass is known as \"an entity\".\n\nData is said to be in JSONed or JSONable form if it contains only dicts, lists\nand scalars (strings, numbers) in a form that ... |
"""A toy-level example of a data model in Google Appengine DB terms.
"""
import logging
from touchengine import touchengineutil
from Doctor import Doctor
from Pager import Pager
touchengineutil.decorateModuleNamed(__name__)
logging.info('touchengine Models in %r decorated', __name__)
| [
[
8,
0,
0.15,
0.2,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.3,
0.1,
0,
0.66,
0.1667,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.4,
0.1,
0,
0.66,
0.3333,
... | [
"\"\"\"A toy-level example of a data model in Google Appengine DB terms.\n\"\"\"",
"import logging",
"from touchengine import touchengineutil",
"from Doctor import Doctor",
"from Pager import Pager",
"touchengineutil.decorateModuleNamed(__name__)",
"logging.info('touchengine Models in %r decorated', __n... |
"""A toy-level example of a RESTful app running on Google Appengine.
"""
import logging
import time
import wsgiref.handlers
from google.appengine.ext import webapp
import models
from touchengine import cookutil
from touchengine import touchengineutil
from touchengine import plistutil
from touchengine.plistHandler impo... | [
[
8,
0,
0.0682,
0.0909,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1364,
0.0455,
0,
0.66,
0.0909,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.1818,
0.0455,
0,
0.66... | [
"\"\"\"A toy-level example of a RESTful app running on Google Appengine.\n\"\"\"",
"import logging",
"import time",
"import wsgiref.handlers",
"from google.appengine.ext import webapp",
"import models",
"from touchengine import cookutil",
"from touchengine import touchengineutil",
"from touchengine ... |
import cgi
import doctest
import logging
import os
import re
logger = logging.getLogger()
logger.setLevel(getattr(logging, os.environ.get('LOGLEVEL', 'WARNING')))
class UrlParser(object):
""" Parse a URL path and perform appropriate an callback on regex-matching.
Instantiate h with a prefix (to be matched, b... | [
[
1,
0,
0.005,
0.005,
0,
0.66,
0,
934,
0,
1,
0,
0,
934,
0,
0
],
[
1,
0,
0.0099,
0.005,
0,
0.66,
0.1,
614,
0,
1,
0,
0,
614,
0,
0
],
[
1,
0,
0.0149,
0.005,
0,
0.66,
... | [
"import cgi",
"import doctest",
"import logging",
"import os",
"import re",
"logger = logging.getLogger()",
"logger.setLevel(getattr(logging, os.environ.get('LOGLEVEL', 'WARNING')))",
"class UrlParser(object):\n \"\"\" Parse a URL path and perform appropriate an callback on regex-matching.\n\n I... |
#!/usr/bin/env python
#Python sonnet maker
import wsgiref.handlers
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
#external imports
import sonnet
import plistlib
class MainHandler(webapp.RequestHandler):
"""Returns sonnets dictionary as a converted plist"""
... | [
[
1,
0,
0.087,
0.0217,
0,
0.66,
0,
709,
0,
1,
0,
0,
709,
0,
0
],
[
1,
0,
0.1087,
0.0217,
0,
0.66,
0.125,
167,
0,
1,
0,
0,
167,
0,
0
],
[
1,
0,
0.1304,
0.0217,
0,
0.... | [
"import wsgiref.handlers",
"from google.appengine.ext import webapp",
"from google.appengine.ext.webapp.util import run_wsgi_app",
"import sonnet",
"import plistlib",
"class MainHandler(webapp.RequestHandler):\n \"\"\"Returns sonnets dictionary as a converted plist\"\"\"\n def get(self):\n pl... |
verses={"verses":[["I","""FROM fairest creatures we desire increase,
That thereby beauty's rose might never die,
But as the riper should by time decease,
His tender heir might bear his memory:
But thou, contracted to thine own bright eyes,
Feed'st thy light'st flame with self-substantial fuel,
Making a famine where abu... | [
[
14,
0,
0.5002,
1,
0,
0.66,
0,
344,
0,
0,
0,
0,
0,
6,
0
]
] | [
"verses={\"verses\":[[\"I\",\"\"\"FROM fairest creatures we desire increase,\nThat thereby beauty's rose might never die,\nBut as the riper should by time decease,\nHis tender heir might bear his memory:\nBut thou, contracted to thine own bright eyes,\nFeed'st thy light'st flame with self-substantial fuel,\nMaking ... |
#!/usr/bin/env python
import wsgiref.handlers
from google.appengine.api import users
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
from google.appengine.ext import db
from google.appengine.ext.webapp import template
from django.utils import simplejson
from touchen... | [
[
1,
0,
0.0186,
0.0062,
0,
0.66,
0,
709,
0,
1,
0,
0,
709,
0,
0
],
[
1,
0,
0.0311,
0.0062,
0,
0.66,
0.05,
279,
0,
1,
0,
0,
279,
0,
0
],
[
1,
0,
0.0373,
0.0062,
0,
0.... | [
"import wsgiref.handlers",
"from google.appengine.api import users",
"from google.appengine.ext import webapp",
"from google.appengine.ext.webapp.util import run_wsgi_app",
"from google.appengine.ext import db",
"from google.appengine.ext.webapp import template",
"from django.utils import simplejson",
... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2006-2009 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://genshi.edgewall.org/wiki/License.
#
# This software consist... | [
[
8,
0,
0.0193,
0.0014,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
7,
0,
0.0241,
0.0055,
0,
0.66,
0.0357,
0,
0,
1,
0,
0,
0,
0,
0
],
[
8,
1,
0.0234,
0.0014,
1,
0.53,
... | [
"\"\"\"Core classes for markup processing.\"\"\"",
"try:\n reduce # builtin in Python < 3\nexcept NameError:\n from functools import reduce",
" reduce # builtin in Python < 3",
" from functools import reduce",
"from itertools import chain",
"import operator",
"from genshi.util import plainte... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2006-2009 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://genshi.edgewall.org/wiki/License.
#
# This software consist... | [
[
1,
0,
0.0558,
0.004,
0,
0.66,
0,
614,
0,
1,
0,
0,
614,
0,
0
],
[
1,
0,
0.0598,
0.004,
0,
0.66,
0.0714,
848,
0,
1,
0,
0,
848,
0,
0
],
[
1,
0,
0.0637,
0.004,
0,
0.6... | [
"import doctest",
"import pickle",
"from StringIO import StringIO",
"try:\n from cStringIO import StringIO as cStringIO\nexcept ImportError:\n cStringIO = StringIO",
" from cStringIO import StringIO as cStringIO",
" cStringIO = StringIO",
"import unittest",
"from genshi import core",
"fr... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2006-2008 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://genshi.edgewall.org/wiki/License.
#
# This software consist... | [
[
1,
0,
0.0302,
0.0022,
0,
0.66,
0,
614,
0,
1,
0,
0,
614,
0,
0
],
[
1,
0,
0.0323,
0.0022,
0,
0.66,
0.0909,
88,
0,
1,
0,
0,
88,
0,
0
],
[
1,
0,
0.0345,
0.0022,
0,
0.... | [
"import doctest",
"import unittest",
"import sys",
"from genshi.core import Attrs, Stream, QName",
"from genshi.input import HTML, XML",
"from genshi.output import DocType, XMLSerializer, XHTMLSerializer, \\\n HTMLSerializer, EmptyTagFilter",
"class XMLSerializerTestCase(unittes... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2006,2009 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://genshi.edgewall.org/wiki/License.
#
# This software consist... | [
[
1,
0,
0.1489,
0.0106,
0,
0.66,
0,
614,
0,
1,
0,
0,
614,
0,
0
],
[
1,
0,
0.1596,
0.0106,
0,
0.66,
0.1667,
88,
0,
1,
0,
0,
88,
0,
0
],
[
1,
0,
0.1809,
0.0106,
0,
0.... | [
"import doctest",
"import unittest",
"from genshi import util",
"from genshi.util import LRUCache",
"class LRUCacheTestCase(unittest.TestCase):\n\n def test_setitem(self):\n cache = LRUCache(2)\n cache['A'] = 0\n self.assertEqual(1, len(cache))\n self.assertEqual('A', cache.he... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2006 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://genshi.edgewall.org/wiki/License.
#
# This software consists of ... | [
[
1,
0,
0.0201,
0.0014,
0,
0.66,
0,
614,
0,
1,
0,
0,
614,
0,
0
],
[
1,
0,
0.0215,
0.0014,
0,
0.66,
0.1429,
88,
0,
1,
0,
0,
88,
0,
0
],
[
1,
0,
0.0244,
0.0014,
0,
0.... | [
"import doctest",
"import unittest",
"from genshi.input import XML",
"from genshi.path import Path, PathParser, PathSyntaxError, GenericStrategy, \\\n SingleStepStrategy, SimplePathStrategy",
"class FakePath(Path):\n def __init__(self, strategy):\n self.strategy = strategy\n... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2006-2009 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://genshi.edgewall.org/wiki/License.
#
# This software consist... | [
[
1,
0,
0.0528,
0.0038,
0,
0.66,
0,
614,
0,
1,
0,
0,
614,
0,
0
],
[
1,
0,
0.0566,
0.0038,
0,
0.66,
0.1111,
609,
0,
1,
0,
0,
609,
0,
0
],
[
1,
0,
0.0604,
0.0038,
0,
... | [
"import doctest",
"from StringIO import StringIO",
"import sys",
"import unittest",
"from genshi.core import Attrs, Stream",
"from genshi.input import XMLParser, HTMLParser, ParseError",
"class XMLParserTestCase(unittest.TestCase):\n\n def test_text_node_pos_single_line(self):\n text = '<elem>... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2006 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://genshi.edgewall.org/wiki/License.
#
# This software consists of ... | [
[
1,
0,
0.4118,
0.0294,
0,
0.66,
0,
88,
0,
1,
0,
0,
88,
0,
0
],
[
2,
0,
0.6912,
0.4706,
0,
0.66,
0.5,
425,
0,
0,
1,
0,
0,
0,
17
],
[
1,
1,
0.5,
0.0294,
1,
0.65,
... | [
"import unittest",
"def suite():\n import genshi\n from genshi.tests import builder, core, input, output, path, util\n from genshi.filters import tests as filters\n from genshi.template import tests as template\n\n suite = unittest.TestSuite()\n suite.addTest(builder.suite())",
" import gen... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2006 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://genshi.edgewall.org/wiki/License.
#
# This software consists of ... | [
[
1,
0,
0.1867,
0.0133,
0,
0.66,
0,
614,
0,
1,
0,
0,
614,
0,
0
],
[
1,
0,
0.2,
0.0133,
0,
0.66,
0.1429,
88,
0,
1,
0,
0,
88,
0,
0
],
[
1,
0,
0.2267,
0.0133,
0,
0.66,... | [
"import doctest",
"import unittest",
"from genshi.builder import Element, tag",
"from genshi.core import Attrs, Markup, Stream",
"from genshi.input import XML",
"class ElementFactoryTestCase(unittest.TestCase):\n\n def test_link(self):\n link = tag.a(href='#', title='Foo', accesskey=None)('Bar')... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2006-2009 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://genshi.edgewall.org/wiki/License.
#
# This software consist... | [
[
8,
0,
0.0179,
0.0036,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0215,
0.0012,
0,
0.66,
0.0556,
808,
0,
1,
0,
0,
808,
0,
0
],
[
1,
0,
0.0227,
0.0012,
0,
0.66... | [
"\"\"\"This module provides different kinds of serialization methods for XML event\nstreams.\n\"\"\"",
"from itertools import chain",
"import re",
"from genshi.core import escape, Attrs, Markup, Namespace, QName, StreamEventKind",
"from genshi.core import START, END, TEXT, XML_DECL, DOCTYPE, START_NS, END_N... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2006-2009 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://genshi.edgewall.org/wiki/License.
#
# This software consist... | [
[
8,
0,
0.0511,
0.0036,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0584,
0.0036,
0,
0.66,
0.0833,
744,
0,
1,
0,
0,
744,
0,
0
],
[
1,
0,
0.062,
0.0036,
0,
0.66,... | [
"\"\"\"Various utility classes and functions.\"\"\"",
"import htmlentitydefs as entities",
"import re",
"__docformat__ = 'restructuredtext en'",
"class LRUCache(dict):\n \"\"\"A dictionary-like object that stores only a certain number of items, and\n discards its least recently used item when full.\n ... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2006-2009 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://genshi.edgewall.org/wiki/License.
#
# This software consist... | [
[
8,
0,
0.0173,
0.017,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0268,
0.0007,
0,
0.66,
0.0135,
193,
0,
1,
0,
0,
193,
0,
0
],
[
7,
0,
0.0285,
0.0026,
0,
0.66,... | [
"\"\"\"Basic support for evaluating XPath expressions against streams.\n\n>>> from genshi.input import XML\n>>> doc = XML('''<doc>\n... <items count=\"4\">\n... <item status=\"new\">\n... <summary>Foo</summary>\n... </item>",
"from collections import deque",
"try:\n reduce # builtin in P... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2006-2009 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://genshi.edgewall.org/wiki/License.
#
# This software consist... | [
[
1,
0,
0.0511,
0.0036,
0,
0.66,
0,
614,
0,
1,
0,
0,
614,
0,
0
],
[
1,
0,
0.0547,
0.0036,
0,
0.66,
0.0909,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0584,
0.0036,
0,
... | [
"import doctest",
"import os",
"import shutil",
"import tempfile",
"import unittest",
"from genshi.template.base import TemplateSyntaxError",
"from genshi.template.loader import TemplateLoader",
"from genshi.template.text import OldTextTemplate, NewTextTemplate",
"class OldTextTemplateTestCase(unitt... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2006-2007 Edgewall Software
# Copyright (C) 2006 Matthew Good
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://genshi.edgewall.org/wiki/... | [
[
1,
0,
0.0568,
0.0038,
0,
0.66,
0,
614,
0,
1,
0,
0,
614,
0,
0
],
[
1,
0,
0.0606,
0.0038,
0,
0.66,
0.0909,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0644,
0.0038,
0,
... | [
"import doctest",
"import os",
"import unittest",
"from genshi.core import Stream",
"from genshi.output import DocType",
"from genshi.template import MarkupTemplate, TextTemplate, NewTextTemplate",
"from genshi.template.plugin import ConfigurationError, \\\n MarkupTempl... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2006-2007 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://genshi.edgewall.org/wiki/License.
#
# This software consist... | [
[
1,
0,
0.56,
0.04,
0,
0.66,
0,
614,
0,
1,
0,
0,
614,
0,
0
],
[
1,
0,
0.6,
0.04,
0,
0.66,
0.25,
88,
0,
1,
0,
0,
88,
0,
0
],
[
1,
0,
0.68,
0.04,
0,
0.66,
0.5,
... | [
"import doctest",
"import unittest",
"from genshi.template.base import Template",
"def suite():\n suite = unittest.TestSuite()\n suite.addTest(doctest.DocTestSuite(Template.__module__))\n return suite",
" suite = unittest.TestSuite()",
" suite.addTest(doctest.DocTestSuite(Template.__module_... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2006-2007 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://genshi.edgewall.org/wiki/License.
#
# This software consist... | [
[
1,
0,
0.4375,
0.0312,
0,
0.66,
0,
614,
0,
1,
0,
0,
614,
0,
0
],
[
1,
0,
0.4688,
0.0312,
0,
0.66,
0.3333,
88,
0,
1,
0,
0,
88,
0,
0
],
[
2,
0,
0.7188,
0.4062,
0,
0.... | [
"import doctest",
"import unittest",
"def suite():\n from genshi.template.tests import base, directives, eval, interpolation, \\\n loader, markup, plugin, text\n suite = unittest.TestSuite()\n suite.addTest(base.suite())\n suite.addTest(directives.suite())\n s... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2006-2008 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://genshi.edgewall.org/wiki/License.
#
# This software consist... | [
[
1,
0,
0.0303,
0.0022,
0,
0.66,
0,
614,
0,
1,
0,
0,
614,
0,
0
],
[
1,
0,
0.0325,
0.0022,
0,
0.66,
0.1,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0346,
0.0022,
0,
0.6... | [
"import doctest",
"import os",
"import shutil",
"import tempfile",
"import unittest",
"from genshi.core import TEXT",
"from genshi.template.loader import TemplateLoader",
"from genshi.template.markup import MarkupTemplate",
"class TemplateLoaderTestCase(unittest.TestCase):\n \"\"\"Tests for the t... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2006-2009 Edgewall Software
# Copyright (C) 2006 Matthew Good
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://genshi.edgewall.org/wiki/... | [
[
8,
0,
0.0909,
0.017,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.108,
0.0057,
0,
0.66,
0.0833,
329,
0,
3,
0,
0,
329,
0,
0
],
[
1,
0,
0.1136,
0.0057,
0,
0.66,
... | [
"\"\"\"Basic support for the template engine plugin API used by TurboGears and\nCherryPy/Buffet.\n\"\"\"",
"from genshi.input import ET, HTML, XML",
"from genshi.output import DocType",
"from genshi.template.base import Template",
"from genshi.template.loader import TemplateLoader",
"from genshi.template.... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2008-2009 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://genshi.edgewall.org/wiki/License.
#
# This software consist... | [
[
8,
0,
0.0277,
0.002,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0317,
0.002,
0,
0.66,
0.125,
738,
0,
1,
0,
0,
738,
0,
0
],
[
1,
0,
0.0337,
0.002,
0,
0.66,
... | [
"\"\"\"Emulation of the proper abstract syntax tree API for Python 2.4.\"\"\"",
"import compiler",
"import compiler.ast",
"from genshi.template import _ast24 as _ast",
"__all__ = ['_ast', 'parse']",
"__docformat__ = 'restructuredtext en'",
"def _new(cls, *args, **kwargs):\n ret = cls()\n if ret._f... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2006-2007 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://genshi.edgewall.org/wiki/License.
#
# This software consist... | [
[
8,
0,
0.6087,
0.0435,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.7391,
0.1304,
0,
0.66,
0.2,
152,
0,
6,
0,
0,
152,
0,
0
],
[
1,
0,
0.8261,
0.0435,
0,
0.66,
... | [
"\"\"\"Implementation of the template engine.\"\"\"",
"from genshi.template.base import Context, Template, TemplateError, \\\n TemplateRuntimeError, TemplateSyntaxError, \\\n BadDirectiveError",
"from genshi.template.loader import TemplateLoader, T... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2008-2009 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://genshi.edgewall.org/wiki/License.
#
# This software consist... | [
[
8,
0,
0.018,
0.0013,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
7,
0,
0.0244,
0.009,
0,
0.66,
0.25,
0,
0,
1,
0,
0,
0,
0,
1
],
[
1,
1,
0.0219,
0.0013,
1,
0.58,
0,... | [
"\"\"\"Support classes for generating code from abstract syntax trees.\"\"\"",
"try:\n import _ast\nexcept ImportError:\n from genshi.template.ast24 import _ast, parse\nelse:\n def parse(source, mode):\n return compile(source, '', mode, _ast.PyCF_ONLY_AST)",
" import _ast",
" from genshi... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2006-2009 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://genshi.edgewall.org/wiki/License.
#
# This software consist... | [
[
8,
0,
0.0418,
0.003,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0478,
0.003,
0,
0.66,
0.0909,
688,
0,
1,
0,
0,
688,
0,
0
],
[
7,
0,
0.0552,
0.0119,
0,
0.66,
... | [
"\"\"\"Template loading and caching.\"\"\"",
"import os",
"try:\n import threading\nexcept ImportError:\n import dummy_threading as threading",
" import threading",
" import dummy_threading as threading",
"from genshi.template.base import TemplateError",
"from genshi.util import LRUCache",
... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2009 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://genshi.edgewall.org/wiki/License.
#
# This software consist... | [
[
8,
0,
0.0237,
0.0267,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0382,
0.0008,
0,
0.66,
0.0233,
540,
0,
1,
0,
0,
540,
0,
0
],
[
1,
0,
0.0389,
0.0008,
0,
0.66... | [
"\"\"\"A filter for functional-style transformations of markup streams.\n\nThe `Transformer` filter provides a variety of transformations that can be\napplied to parts of streams that match given XPath expressions. These\ntransformations can be chained to achieve results that would be comparitively\ntedious to achi... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2007 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://genshi.edgewall.org/wiki/License.
#
# This software consists of ... | [
[
1,
0,
0.0094,
0.0007,
0,
0.66,
0,
614,
0,
1,
0,
0,
614,
0,
0
],
[
1,
0,
0.01,
0.0007,
0,
0.66,
0.0294,
276,
0,
1,
0,
0,
276,
0,
0
],
[
1,
0,
0.0107,
0.0007,
0,
0.... | [
"import doctest",
"from pprint import pprint",
"import unittest",
"from genshi import HTML",
"from genshi.builder import Element",
"from genshi.core import START, END, TEXT, QName, Attrs",
"from genshi.filters.transform import Transformer, StreamBuffer, ENTER, EXIT, \\\n ... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2006-2009 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://genshi.edgewall.org/wiki/License.
#
# This software consist... | [
[
1,
0,
0.0295,
0.0021,
0,
0.66,
0,
614,
0,
1,
0,
0,
614,
0,
0
],
[
1,
0,
0.0316,
0.0021,
0,
0.66,
0.125,
88,
0,
1,
0,
0,
88,
0,
0
],
[
1,
0,
0.0358,
0.0021,
0,
0.6... | [
"import doctest",
"import unittest",
"from genshi.input import HTML, ParseError",
"from genshi.filters.html import HTMLFormFiller, HTMLSanitizer",
"from genshi.template import MarkupTemplate",
"class HTMLFormFillerTestCase(unittest.TestCase):\n\n def test_fill_input_text_no_value(self):\n html =... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2008 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://genshi.edgewall.org/wiki/License.
#
# This software consist... | [
[
1,
0,
0.5185,
0.037,
0,
0.66,
0,
614,
0,
1,
0,
0,
614,
0,
0
],
[
1,
0,
0.5556,
0.037,
0,
0.66,
0.3333,
88,
0,
1,
0,
0,
88,
0,
0
],
[
2,
0,
0.7593,
0.2963,
0,
0.66... | [
"import doctest",
"import unittest",
"def suite():\n from genshi.filters.tests import html, i18n, transform\n suite = unittest.TestSuite()\n suite.addTest(html.suite())\n suite.addTest(i18n.suite())\n if hasattr(doctest, 'NORMALIZE_WHITESPACE'):\n suite.addTest(transform.suite())\n retu... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2009 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://genshi.edgewall.org/wiki/License.
#
# This software consist... | [
[
1,
0,
0.0086,
0.0006,
0,
0.66,
0,
426,
0,
1,
0,
0,
426,
0,
0
],
[
1,
0,
0.0092,
0.0006,
0,
0.66,
0.0769,
614,
0,
1,
0,
0,
614,
0,
0
],
[
1,
0,
0.0098,
0.0006,
0,
... | [
"from datetime import datetime",
"import doctest",
"from gettext import NullTranslations",
"from StringIO import StringIO",
"import unittest",
"from genshi.core import Attrs",
"from genshi.template import MarkupTemplate, Context",
"from genshi.filters.i18n import Translator, extract",
"from genshi.i... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2006-2009 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://genshi.edgewall.org/wiki/License.
#
# This software consist... | [
[
8,
0,
0.0309,
0.0022,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
7,
0,
0.0386,
0.0088,
0,
0.66,
0.125,
0,
0,
1,
0,
0,
0,
0,
0
],
[
8,
1,
0.0375,
0.0022,
1,
0.21,
... | [
"\"\"\"Implementation of a number of stream filters.\"\"\"",
"try:\n any\nexcept NameError:\n from genshi.util import any",
" any",
" from genshi.util import any",
"import re",
"from genshi.core import Attrs, QName, stripentities",
"from genshi.core import END, START, TEXT, COMMENT",
"__al... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2009 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://genshi.edgewall.org/wiki/License.
#
# This software consist... | [
[
8,
0,
0.7,
0.05,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.8,
0.05,
0,
0.66,
0.25,
844,
0,
2,
0,
0,
844,
0,
0
],
[
1,
0,
0.85,
0.05,
0,
0.66,
0.5,
5... | [
"\"\"\"Implementation of a number of stream filters.\"\"\"",
"from genshi.filters.html import HTMLFormFiller, HTMLSanitizer",
"from genshi.filters.i18n import Translator",
"from genshi.filters.transform import Transformer",
"__docformat__ = 'restructuredtext en'"
] |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2009 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://genshi.edgewall.org/wiki/License.
#
# This software consist... | [
[
8,
0,
0.0141,
0.0051,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
7,
0,
0.0192,
0.0034,
0,
0.66,
0.0333,
0,
0,
1,
0,
0,
0,
0,
0
],
[
8,
1,
0.0188,
0.0009,
1,
0.48,
... | [
"\"\"\"Directives and utilities for internationalization and localization of\ntemplates.\n\n:since: version 0.4\n:note: Directives support added since version 0.6\n\"\"\"",
"try:\n any\nexcept NameError:\n from genshi.util import any",
" any",
" from genshi.util import any",
"from gettext import... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2006-2009 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://genshi.edgewall.org/wiki/License.
#
# This software consist... | [
[
8,
0,
0.6538,
0.2692,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.8462,
0.0385,
0,
0.66,
0.25,
959,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.8846,
0.0385,
0,
0.66,
... | [
"\"\"\"This package provides various means for generating and processing web markup\n(XML or HTML).\n\nThe design is centered around the concept of streams of markup events (similar\nin concept to SAX parsing events) which can be processed in a uniform manner\nindependently of where or how they are produced.\n\"\"\... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2006-2009 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://genshi.edgewall.org/wiki/License.
#
# This software consist... | [
[
8,
0,
0.1156,
0.156,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1992,
0.0056,
0,
0.66,
0.1111,
987,
0,
8,
0,
0,
987,
0,
0
],
[
14,
0,
0.2061,
0.0028,
0,
0.66... | [
"\"\"\"Support for programmatically generating markup streams from Python code using\na very simple syntax. The main entry point to this module is the `tag` object\n(which is actually an instance of the ``ElementFactory`` class). You should\nrarely (if ever) need to directly import and use any of the other classes ... |
import unittest
import doctest
class OptionalExtensionTestSuite(unittest.TestSuite):
def run(self, result):
import simplejson
run = unittest.TestSuite.run
run(self, result)
simplejson._toggle_speedups(False)
run(self, result)
simplejson._toggle_speedups(True)
... | [
[
1,
0,
0.0159,
0.0159,
0,
0.66,
0,
88,
0,
1,
0,
0,
88,
0,
0
],
[
1,
0,
0.0317,
0.0159,
0,
0.66,
0.1667,
614,
0,
1,
0,
0,
614,
0,
0
],
[
3,
0,
0.1429,
0.1429,
0,
0.... | [
"import unittest",
"import doctest",
"class OptionalExtensionTestSuite(unittest.TestSuite):\n def run(self, result):\n import simplejson\n run = unittest.TestSuite.run\n run(self, result)\n simplejson._toggle_speedups(False)\n run(self, result)\n simplejson._toggle_s... |
"""Implementation of JSONEncoder
"""
import re
from decimal import Decimal
def _import_speedups():
try:
from simplejson import _speedups
return _speedups.encode_basestring_ascii, _speedups.make_encoder
except ImportError:
return None, None
c_encode_basestring_ascii, c_make_encoder = _im... | [
[
8,
0,
0.003,
0.004,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.006,
0.002,
0,
0.66,
0.0588,
540,
0,
1,
0,
0,
540,
0,
0
],
[
1,
0,
0.008,
0.002,
0,
0.66,
... | [
"\"\"\"Implementation of JSONEncoder\n\"\"\"",
"import re",
"from decimal import Decimal",
"def _import_speedups():\n try:\n from simplejson import _speedups\n return _speedups.encode_basestring_ascii, _speedups.make_encoder\n except ImportError:\n return None, None",
" try:\n ... |
r"""JSON (JavaScript Object Notation) <http://json.org> is a subset of
JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data
interchange format.
:mod:`simplejson` exposes an API familiar to users of the standard library
:mod:`marshal` and :mod:`pickle` modules. It is the externally maintained
version of ... | [
[
8,
0,
0.1144,
0.2265,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.2288,
0.0023,
0,
0.66,
0.0625,
162,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.2357,
0.0114,
0,
0.66... | [
"r\"\"\"JSON (JavaScript Object Notation) <http://json.org> is a subset of\nJavaScript syntax (ECMA-262 3rd edition) used as a lightweight data\ninterchange format.\n\n:mod:`simplejson` exposes an API familiar to users of the standard library\n:mod:`marshal` and :mod:`pickle` modules. It is the externally maintaine... |
"""JSON token scanner
"""
import re
def _import_c_make_scanner():
try:
from simplejson._speedups import make_scanner
return make_scanner
except ImportError:
return None
c_make_scanner = _import_c_make_scanner()
__all__ = ['make_scanner']
NUMBER_RE = re.compile(
r'(-?(?:0|[1-9]\d*))... | [
[
8,
0,
0.0195,
0.026,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.039,
0.013,
0,
0.66,
0.1429,
540,
0,
1,
0,
0,
540,
0,
0
],
[
2,
0,
0.0844,
0.0779,
0,
0.66,
... | [
"\"\"\"JSON token scanner\n\"\"\"",
"import re",
"def _import_c_make_scanner():\n try:\n from simplejson._speedups import make_scanner\n return make_scanner\n except ImportError:\n return None",
" try:\n from simplejson._speedups import make_scanner\n return make_sc... |
"""Drop-in replacement for collections.OrderedDict by Raymond Hettinger
http://code.activestate.com/recipes/576693/
"""
from UserDict import DictMixin
# Modified from original to support Python 2.4, see
# http://code.google.com/p/simplejson/issues/detail?id=53
try:
all
except NameError:
def all(seq):
... | [
[
8,
0,
0.0252,
0.042,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0504,
0.0084,
0,
0.66,
0.3333,
351,
0,
1,
0,
0,
351,
0,
0
],
[
7,
0,
0.1134,
0.0672,
0,
0.66,... | [
"\"\"\"Drop-in replacement for collections.OrderedDict by Raymond Hettinger\n\nhttp://code.activestate.com/recipes/576693/\n\n\"\"\"",
"from UserDict import DictMixin",
"try:\n all\nexcept NameError:\n def all(seq):\n for elem in seq:\n if not elem:\n return False\n ... |
import logging
import os
#initialize logging
def create_env():
"""Sets logging level if LOGGING_DEBUG is set"""
default_log_level = logging.INFO
if os.environ.get("LOGGING_DEBUG") in ("1", "True", "on"):
default_log_level = logging.DEBUG
return default_log_level
class Formatter(object):
... | [
[
1,
0,
0.0204,
0.0204,
0,
0.66,
0,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.0408,
0.0204,
0,
0.66,
0.1667,
688,
0,
1,
0,
0,
688,
0,
0
],
[
2,
0,
0.1837,
0.1429,
0,
... | [
"import logging",
"import os",
"def create_env():\n \"\"\"Sets logging level if LOGGING_DEBUG is set\"\"\"\n\n default_log_level = logging.INFO\n if os.environ.get(\"LOGGING_DEBUG\") in (\"1\", \"True\", \"on\"):\n default_log_level = logging.DEBUG\n return default_log_level",
" \"\"\"Se... |
"""
Author: Noah Gift
Date: 08/05/2009
A really simple set of defaults for logging
============================================
You simply do this::
>>> from sensible.loginit import logger
>>> log = logger("MyApp")
>>> log.info("stuff")
2009-08-04 23:56:22,583 - MyApp - INFO - stuff
Environmental ... | [
[
8,
0,
0.5227,
1,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
]
] | [
"\"\"\"\nAuthor: Noah Gift\nDate: 08/05/2009\n\nA really simple set of defaults for logging\n============================================\n\nYou simply do this::"
] |
from _BookShelf import _BookShelf
class BookShelf(_BookShelf):
pass
# Custom logic goes here. | [
[
1,
0,
0.2,
0.2,
0,
0.66,
0,
291,
0,
1,
0,
0,
291,
0,
0
],
[
3,
0,
0.7,
0.4,
0,
0.66,
1,
80,
0,
0,
0,
0,
291,
0,
0
]
] | [
"from _BookShelf import _BookShelf",
"class BookShelf(_BookShelf):\n pass"
] |
"""
Copyright (c) 2003-2010 Gustavo Niemeyer <gustavo@niemeyer.net>
This module offers extensions to the standard python 2.3+
datetime module.
"""
__author__ = "Gustavo Niemeyer <gustavo@niemeyer.net>"
__license__ = "PSF License"
__version__ = "1.5"
| [
[
8,
0,
0.3889,
0.6667,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.7778,
0.1111,
0,
0.66,
0.3333,
777,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.8889,
0.1111,
0,
0.66... | [
"\"\"\"\nCopyright (c) 2003-2010 Gustavo Niemeyer <gustavo@niemeyer.net>\n\nThis module offers extensions to the standard python 2.3+\ndatetime module.\n\"\"\"",
"__author__ = \"Gustavo Niemeyer <gustavo@niemeyer.net>\"",
"__license__ = \"PSF License\"",
"__version__ = \"1.5\""
] |
"""
Copyright (c) 2003-2005 Gustavo Niemeyer <gustavo@niemeyer.net>
This module offers extensions to the standard python 2.3+
datetime module.
"""
from dateutil.tz import tzfile
from tarfile import TarFile
import os
__author__ = "Gustavo Niemeyer <gustavo@niemeyer.net>"
__license__ = "PSF License"
__all__ = ["setca... | [
[
8,
0,
0.0402,
0.069,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0805,
0.0115,
0,
0.66,
0.0714,
872,
0,
1,
0,
0,
872,
0,
0
],
[
1,
0,
0.092,
0.0115,
0,
0.66,
... | [
"\"\"\"\nCopyright (c) 2003-2005 Gustavo Niemeyer <gustavo@niemeyer.net>\n\nThis module offers extensions to the standard python 2.3+\ndatetime module.\n\"\"\"",
"from dateutil.tz import tzfile",
"from tarfile import TarFile",
"import os",
"__author__ = \"Gustavo Niemeyer <gustavo@niemeyer.net>\"",
"__li... |
# This code was originally contributed by Jeffrey Harris.
import datetime
import struct
import _winreg
__author__ = "Jeffrey Harris & Gustavo Niemeyer <gustavo@niemeyer.net>"
__all__ = ["tzwin", "tzwinlocal"]
ONEWEEK = datetime.timedelta(7)
TZKEYNAMENT = r"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones"
TZ... | [
[
1,
0,
0.0111,
0.0056,
0,
0.66,
0,
426,
0,
1,
0,
0,
426,
0,
0
],
[
1,
0,
0.0167,
0.0056,
0,
0.66,
0.0667,
399,
0,
1,
0,
0,
399,
0,
0
],
[
1,
0,
0.0222,
0.0056,
0,
... | [
"import datetime",
"import struct",
"import _winreg",
"__author__ = \"Jeffrey Harris & Gustavo Niemeyer <gustavo@niemeyer.net>\"",
"__all__ = [\"tzwin\", \"tzwinlocal\"]",
"ONEWEEK = datetime.timedelta(7)",
"TZKEYNAMENT = r\"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Time Zones\"",
"TZKEYNAME9X ... |
from _Book import _Book
class Book(_Book):
pass
# Custom logic goes here. | [
[
1,
0,
0.2,
0.2,
0,
0.66,
0,
208,
0,
1,
0,
0,
208,
0,
0
],
[
3,
0,
0.7,
0.4,
0,
0.66,
1,
97,
0,
0,
0,
0,
208,
0,
0
]
] | [
"from _Book import _Book",
"class Book(_Book):\n pass"
] |
'''
Module which brings history information about files from Mercurial.
@author: Rodrigo Damazio
'''
import re
import subprocess
REVISION_REGEX = re.compile(r'(?P<hash>[0-9a-f]{12}):.*')
def _GetOutputLines(args):
'''
Runs an external process and returns its output as a list of lines.
@param args: the argume... | [
[
8,
0,
0.0319,
0.0532,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0745,
0.0106,
0,
0.66,
0.1429,
540,
0,
1,
0,
0,
540,
0,
0
],
[
1,
0,
0.0851,
0.0106,
0,
0.66... | [
"'''\nModule which brings history information about files from Mercurial.\n\n@author: Rodrigo Damazio\n'''",
"import re",
"import subprocess",
"REVISION_REGEX = re.compile(r'(?P<hash>[0-9a-f]{12}):.*')",
"def _GetOutputLines(args):\n '''\n Runs an external process and returns its output as a list of lines... |
#!/usr/bin/python
'''
Entry point for My Tracks i18n tool.
@author: Rodrigo Damazio
'''
import mytracks.files
import mytracks.translate
import mytracks.validate
import sys
def Usage():
print 'Usage: %s <command> [<language> ...]\n' % sys.argv[0]
print 'Commands are:'
print ' cleanup'
print ' translate'
p... | [
[
8,
0,
0.0417,
0.0521,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0833,
0.0104,
0,
0.66,
0.125,
640,
0,
1,
0,
0,
640,
0,
0
],
[
1,
0,
0.0938,
0.0104,
0,
0.66,... | [
"'''\nEntry point for My Tracks i18n tool.\n\n@author: Rodrigo Damazio\n'''",
"import mytracks.files",
"import mytracks.translate",
"import mytracks.validate",
"import sys",
"def Usage():\n print('Usage: %s <command> [<language> ...]\\n' % sys.argv[0])\n print('Commands are:')\n print(' cleanup')\n p... |
'''
Module which prompts the user for translations and saves them.
TODO: implement
@author: Rodrigo Damazio
'''
class Translator(object):
'''
classdocs
'''
def __init__(self, language):
'''
Constructor
'''
self._language = language
def Translate(self, string_names):
print string_names | [
[
8,
0,
0.1905,
0.3333,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
3,
0,
0.7143,
0.619,
0,
0.66,
1,
229,
0,
2,
0,
0,
186,
0,
1
],
[
8,
1,
0.5238,
0.1429,
1,
0.15,
... | [
"'''\nModule which prompts the user for translations and saves them.\n\nTODO: implement\n\n@author: Rodrigo Damazio\n'''",
"class Translator(object):\n '''\n classdocs\n '''\n\n def __init__(self, language):\n '''\n Constructor",
" '''\n classdocs\n '''",
" def __init__(self, language):\n '''... |
'''
Module which compares languague files to the master file and detects
issues.
@author: Rodrigo Damazio
'''
import os
from mytracks.parser import StringsParser
import mytracks.history
class Validator(object):
def __init__(self, languages):
'''
Builds a strings file validator.
Params:
@para... | [
[
8,
0,
0.0304,
0.0522,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0696,
0.0087,
0,
0.66,
0.25,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0783,
0.0087,
0,
0.66,
... | [
"'''\nModule which compares languague files to the master file and detects\nissues.\n\n@author: Rodrigo Damazio\n'''",
"import os",
"from mytracks.parser import StringsParser",
"import mytracks.history",
"class Validator(object):\n\n def __init__(self, languages):\n '''\n Builds a strings file valida... |
'''
Module for dealing with resource files (but not their contents).
@author: Rodrigo Damazio
'''
import os.path
from glob import glob
import re
MYTRACKS_RES_DIR = 'MyTracks/res'
ANDROID_MASTER_VALUES = 'values'
ANDROID_VALUES_MASK = 'values-*'
def GetMyTracksDir():
'''
Returns the directory in which the MyTrac... | [
[
8,
0,
0.0667,
0.1111,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1333,
0.0222,
0,
0.66,
0.125,
79,
0,
1,
0,
0,
79,
0,
0
],
[
1,
0,
0.1556,
0.0222,
0,
0.66,
... | [
"'''\nModule for dealing with resource files (but not their contents).\n\n@author: Rodrigo Damazio\n'''",
"import os.path",
"from glob import glob",
"import re",
"MYTRACKS_RES_DIR = 'MyTracks/res'",
"ANDROID_MASTER_VALUES = 'values'",
"ANDROID_VALUES_MASK = 'values-*'",
"def GetMyTracksDir():\n '''\n... |
'''
Module which parses a string XML file.
@author: Rodrigo Damazio
'''
from xml.parsers.expat import ParserCreate
import re
#import xml.etree.ElementTree as ET
class StringsParser(object):
'''
Parser for string XML files.
This object is not thread-safe and should be used for parsing a single file at
a time... | [
[
8,
0,
0.0261,
0.0435,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0609,
0.0087,
0,
0.66,
0.3333,
573,
0,
1,
0,
0,
573,
0,
0
],
[
1,
0,
0.0696,
0.0087,
0,
0.66... | [
"'''\nModule which parses a string XML file.\n\n@author: Rodrigo Damazio\n'''",
"from xml.parsers.expat import ParserCreate",
"import re",
"class StringsParser(object):\n '''\n Parser for string XML files.\n\n This object is not thread-safe and should be used for parsing a single file at\n a time, only.\n... |
#!/bin/env python
import xml.dom.minidom as dom
import sys
import struct
WEAP_NUM = 780
struct_fmt = "<H BBHBBBB 8B8B8b8b8b8b8H bbBBBB"
def pack_weapon(dict):
l = []
l.append(dict['drain'])
l.append(dict['shotRepeat'])
l.append(dict['multi'])
l.append(dict['weapAni'])
l.append(dict['max'])
l.append(dict['tx... | [
[
1,
0,
0.0129,
0.0043,
0,
0.66,
0,
770,
0,
1,
0,
0,
770,
0,
0
],
[
1,
0,
0.0172,
0.0043,
0,
0.66,
0.0833,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0215,
0.0043,
0,
... | [
"import xml.dom.minidom as dom",
"import sys",
"import struct",
"WEAP_NUM = 780",
"struct_fmt = \"<H BBHBBBB 8B8B8b8b8b8b8H bbBBBB\"",
"def pack_weapon(dict):\n\tl = []\n\n\tl.append(dict['drain'])\n\tl.append(dict['shotRepeat'])\n\tl.append(dict['multi'])\n\tl.append(dict['weapAni'])\n\tl.append(dict['ma... |
#!/usr/bin/python2.6
#
# Simple http server to emulate api.playfoursquare.com
import logging
import shutil
import sys
import urlparse
import SimpleHTTPServer
import BaseHTTPServer
class RequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
"""Handle playfoursquare.com requests, for testing."""
def do_GET(self... | [
[
1,
0,
0.0588,
0.0118,
0,
0.66,
0,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.0706,
0.0118,
0,
0.66,
0.125,
614,
0,
1,
0,
0,
614,
0,
0
],
[
1,
0,
0.0824,
0.0118,
0,
0... | [
"import logging",
"import shutil",
"import sys",
"import urlparse",
"import SimpleHTTPServer",
"import BaseHTTPServer",
"class RequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):\n \"\"\"Handle playfoursquare.com requests, for testing.\"\"\"\n\n def do_GET(self):\n logging.warn('do_GET: %s, %s',... |
#!/usr/bin/python
import datetime
import sys
import textwrap
import common
from xml.dom import pulldom
PARSER = """\
/**
* Copyright 2009 Joe LaPenna
*/
package com.joelapenna.foursquare.parsers;
import com.joelapenna.foursquare.Foursquare;
import com.joelapenna.foursquare.error.FoursquareError;
import com.joel... | [
[
1,
0,
0.0201,
0.0067,
0,
0.66,
0,
426,
0,
1,
0,
0,
426,
0,
0
],
[
1,
0,
0.0268,
0.0067,
0,
0.66,
0.0769,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0336,
0.0067,
0,
... | [
"import datetime",
"import sys",
"import textwrap",
"import common",
"from xml.dom import pulldom",
"PARSER = \"\"\"\\\n/**\n * Copyright 2009 Joe LaPenna\n */\n\npackage com.joelapenna.foursquare.parsers;\n\nimport com.joelapenna.foursquare.Foursquare;",
"BOOLEAN_STANZA = \"\"\"\\\n } else i... |
#!/usr/bin/python
"""
Pull a oAuth protected page from foursquare.
Expects ~/.oget to contain (one on each line):
CONSUMER_KEY
CONSUMER_KEY_SECRET
USERNAME
PASSWORD
Don't forget to chmod 600 the file!
"""
import httplib
import os
import re
import sys
import urllib
import urllib2
import urlparse
import user
from xml.... | [
[
8,
0,
0.0631,
0.0991,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1261,
0.009,
0,
0.66,
0.05,
2,
0,
1,
0,
0,
2,
0,
0
],
[
1,
0,
0.1351,
0.009,
0,
0.66,
0.... | [
"\"\"\"\nPull a oAuth protected page from foursquare.\n\nExpects ~/.oget to contain (one on each line):\nCONSUMER_KEY\nCONSUMER_KEY_SECRET\nUSERNAME\nPASSWORD",
"import httplib",
"import os",
"import re",
"import sys",
"import urllib",
"import urllib2",
"import urlparse",
"import user",
"from xml.... |
#!/usr/bin/python
import os
import subprocess
import sys
BASEDIR = '../main/src/com/joelapenna/foursquare'
TYPESDIR = '../captures/types/v1'
captures = sys.argv[1:]
if not captures:
captures = os.listdir(TYPESDIR)
for f in captures:
basename = f.split('.')[0]
javaname = ''.join([c.capitalize() for c in basena... | [
[
1,
0,
0.1111,
0.037,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.1481,
0.037,
0,
0.66,
0.1429,
394,
0,
1,
0,
0,
394,
0,
0
],
[
1,
0,
0.1852,
0.037,
0,
0.6... | [
"import os",
"import subprocess",
"import sys",
"BASEDIR = '../main/src/com/joelapenna/foursquare'",
"TYPESDIR = '../captures/types/v1'",
"captures = sys.argv[1:]",
"if not captures:\n captures = os.listdir(TYPESDIR)",
" captures = os.listdir(TYPESDIR)",
"for f in captures:\n basename = f.split('... |
#!/usr/bin/python
import logging
from xml.dom import minidom
from xml.dom import pulldom
BOOLEAN = "boolean"
STRING = "String"
GROUP = "Group"
# Interfaces that all FoursquareTypes implement.
DEFAULT_INTERFACES = ['FoursquareType']
# Interfaces that specific FoursqureTypes implement.
INTERFACES = {
}
DEFAULT_CLA... | [
[
1,
0,
0.0263,
0.0088,
0,
0.66,
0,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.0439,
0.0088,
0,
0.66,
0.0833,
290,
0,
1,
0,
0,
290,
0,
0
],
[
1,
0,
0.0526,
0.0088,
0,
... | [
"import logging",
"from xml.dom import minidom",
"from xml.dom import pulldom",
"BOOLEAN = \"boolean\"",
"STRING = \"String\"",
"GROUP = \"Group\"",
"DEFAULT_INTERFACES = ['FoursquareType']",
"INTERFACES = {\n}",
"DEFAULT_CLASS_IMPORTS = [\n]",
"CLASS_IMPORTS = {\n# 'Checkin': DEFAULT_CLASS_IMP... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2012 Zdenko Podobný
# Author: Zdenko Podobný
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LIC... | [
[
1,
0,
0.25,
0.25,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.5,
0.25,
0,
0.66,
0.5,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.75,
0.25,
0,
0.66,
1,
... | [
"import os",
"import sys",
"import ctypes"
] |
#!/usr/bin/env python
from distutils.core import setup
from crawle import VERSION
setup(name='CRAWL-E',
version=VERSION,
description='Highly distributed web crawling framework',
author='Bryce Boe',
author_email='bboe (_at_) cs.ucsb.edu',
url='http://code.google.com/p/crawl-e',
py_mo... | [
[
1,
0,
0.1667,
0.0833,
0,
0.66,
0,
152,
0,
1,
0,
0,
152,
0,
0
],
[
1,
0,
0.25,
0.0833,
0,
0.66,
0.5,
441,
0,
1,
0,
0,
441,
0,
0
],
[
8,
0,
0.7083,
0.6667,
0,
0.66,... | [
"from distutils.core import setup",
"from crawle import VERSION",
"setup(name='CRAWL-E',\n version=VERSION,\n description='Highly distributed web crawling framework',\n author='Bryce Boe',\n author_email='bboe (_at_) cs.ucsb.edu',\n url='http://code.google.com/p/crawl-e',\n py_modu... |
'''
Module which brings history information about files from Mercurial.
@author: Rodrigo Damazio
'''
import re
import subprocess
REVISION_REGEX = re.compile(r'(?P<hash>[0-9a-f]{12}):.*')
def _GetOutputLines(args):
'''
Runs an external process and returns its output as a list of lines.
@param args: the argume... | [
[
8,
0,
0.0319,
0.0532,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0745,
0.0106,
0,
0.66,
0.1429,
540,
0,
1,
0,
0,
540,
0,
0
],
[
1,
0,
0.0851,
0.0106,
0,
0.66... | [
"'''\nModule which brings history information about files from Mercurial.\n\n@author: Rodrigo Damazio\n'''",
"import re",
"import subprocess",
"REVISION_REGEX = re.compile(r'(?P<hash>[0-9a-f]{12}):.*')",
"def _GetOutputLines(args):\n '''\n Runs an external process and returns its output as a list of lines... |
#!/usr/bin/python
'''
Entry point for My Tracks i18n tool.
@author: Rodrigo Damazio
'''
import mytracks.files
import mytracks.translate
import mytracks.validate
import sys
def Usage():
print 'Usage: %s <command> [<language> ...]\n' % sys.argv[0]
print 'Commands are:'
print ' cleanup'
print ' translate'
p... | [
[
8,
0,
0.0417,
0.0521,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0833,
0.0104,
0,
0.66,
0.125,
640,
0,
1,
0,
0,
640,
0,
0
],
[
1,
0,
0.0938,
0.0104,
0,
0.66,... | [
"'''\nEntry point for My Tracks i18n tool.\n\n@author: Rodrigo Damazio\n'''",
"import mytracks.files",
"import mytracks.translate",
"import mytracks.validate",
"import sys",
"def Usage():\n print('Usage: %s <command> [<language> ...]\\n' % sys.argv[0])\n print('Commands are:')\n print(' cleanup')\n p... |
'''
Module which prompts the user for translations and saves them.
TODO: implement
@author: Rodrigo Damazio
'''
class Translator(object):
'''
classdocs
'''
def __init__(self, language):
'''
Constructor
'''
self._language = language
def Translate(self, string_names):
print string_names | [
[
8,
0,
0.1905,
0.3333,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
3,
0,
0.7143,
0.619,
0,
0.66,
1,
229,
0,
2,
0,
0,
186,
0,
1
],
[
8,
1,
0.5238,
0.1429,
1,
0.77,
... | [
"'''\nModule which prompts the user for translations and saves them.\n\nTODO: implement\n\n@author: Rodrigo Damazio\n'''",
"class Translator(object):\n '''\n classdocs\n '''\n\n def __init__(self, language):\n '''\n Constructor",
" '''\n classdocs\n '''",
" def __init__(self, language):\n '''... |
'''
Module which compares languague files to the master file and detects
issues.
@author: Rodrigo Damazio
'''
import os
from mytracks.parser import StringsParser
import mytracks.history
class Validator(object):
def __init__(self, languages):
'''
Builds a strings file validator.
Params:
@para... | [
[
8,
0,
0.0304,
0.0522,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0696,
0.0087,
0,
0.66,
0.25,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0783,
0.0087,
0,
0.66,
... | [
"'''\nModule which compares languague files to the master file and detects\nissues.\n\n@author: Rodrigo Damazio\n'''",
"import os",
"from mytracks.parser import StringsParser",
"import mytracks.history",
"class Validator(object):\n\n def __init__(self, languages):\n '''\n Builds a strings file valida... |
'''
Module for dealing with resource files (but not their contents).
@author: Rodrigo Damazio
'''
import os.path
from glob import glob
import re
MYTRACKS_RES_DIR = 'MyTracks/res'
ANDROID_MASTER_VALUES = 'values'
ANDROID_VALUES_MASK = 'values-*'
def GetMyTracksDir():
'''
Returns the directory in which the MyTrac... | [
[
8,
0,
0.0667,
0.1111,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1333,
0.0222,
0,
0.66,
0.125,
79,
0,
1,
0,
0,
79,
0,
0
],
[
1,
0,
0.1556,
0.0222,
0,
0.66,
... | [
"'''\nModule for dealing with resource files (but not their contents).\n\n@author: Rodrigo Damazio\n'''",
"import os.path",
"from glob import glob",
"import re",
"MYTRACKS_RES_DIR = 'MyTracks/res'",
"ANDROID_MASTER_VALUES = 'values'",
"ANDROID_VALUES_MASK = 'values-*'",
"def GetMyTracksDir():\n '''\n... |
'''
Module which parses a string XML file.
@author: Rodrigo Damazio
'''
from xml.parsers.expat import ParserCreate
import re
#import xml.etree.ElementTree as ET
class StringsParser(object):
'''
Parser for string XML files.
This object is not thread-safe and should be used for parsing a single file at
a time... | [
[
8,
0,
0.0261,
0.0435,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0609,
0.0087,
0,
0.66,
0.3333,
573,
0,
1,
0,
0,
573,
0,
0
],
[
1,
0,
0.0696,
0.0087,
0,
0.66... | [
"'''\nModule which parses a string XML file.\n\n@author: Rodrigo Damazio\n'''",
"from xml.parsers.expat import ParserCreate",
"import re",
"class StringsParser(object):\n '''\n Parser for string XML files.\n\n This object is not thread-safe and should be used for parsing a single file at\n a time, only.\n... |
import socket
import urllib
__author__="uli"
__date__ ="$12.01.2009 16:48:52$"
if __name__ == "__main__":
url = raw_input("URL: ")
count = int(raw_input("Count: "))
traffic = 0 #Traffic in bytes
for i in xrange(count):
print "Starting %ith download" % (i+1)
socket = urllib.urlopen(url)... | [
[
1,
0,
0.0556,
0.0556,
0,
0.66,
0,
687,
0,
1,
0,
0,
687,
0,
0
],
[
1,
0,
0.1111,
0.0556,
0,
0.66,
0.25,
614,
0,
1,
0,
0,
614,
0,
0
],
[
14,
0,
0.2222,
0.0556,
0,
0... | [
"import socket",
"import urllib",
"__author__=\"uli\"",
"__date__ =\"$12.01.2009 16:48:52$\"",
"if __name__ == \"__main__\":\n url = raw_input(\"URL: \")\n count = int(raw_input(\"Count: \"))\n traffic = 0 #Traffic in bytes\n for i in xrange(count):\n print(\"Starting %ith download\" % (i... |
# -*- coding: UTF-8 -*-
#
# gameOver.py
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# ... | [
[
8,
0,
0.2672,
0.069,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.3103,
0.0172,
0,
0.66,
0.25,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.3276,
0.0172,
0,
0.66,
... | [
"'''\nCreated on 27/06/2012\n@author: Juan Pablo Moreno y Alejandro Duarte\n'''",
"from random import randint",
"import pygame",
"from funcionesBasicas import Funciones as funciones",
"class GameOver():\n\t\n\tdef __init__(self, ventana):\n\t\tself.ventana = ventana\n\t\tself.imagen = randint(1,3)\n\t\tself... |
# -*- coding: UTF-8 -*-
#
# menu.py
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
... | [
[
8,
0,
0.1281,
0.0331,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1488,
0.0083,
0,
0.66,
0.2,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.157,
0.0083,
0,
0.66,
... | [
"'''\nCreated on 30/06/2012\n@author: Juan Pablo Moreno y Alejandro Duarte\n'''",
"import sys",
"import pygame",
"from funcionesBasicas import Funciones as funciones",
"from objetos import Cursor, Boton",
"class Menu_UDTanks():\n\t\"\"\"Menu principal del juego, tiene 5 botones y un sonido en reproduccion... |
# -*- coding: UTF-8 -*-
#
# intro.py
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# ... | [
[
8,
0,
0.25,
0.0645,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.2903,
0.0161,
0,
0.66,
0.25,
87,
0,
1,
0,
0,
87,
0,
0
],
[
1,
0,
0.3065,
0.0161,
0,
0.66,
... | [
"'''\nCreated on 10/07/2012\n@author: Juan Pablo Moreno y Alejandro Duarte\n'''",
"import pygame",
"from funcionesBasicas import Funciones as funciones",
"class Intro():\n\t\"\"\"Introduccion al juego, muestra los logotipos de la universidad y de Pygroup.\n\tImporta y ejecuta el menu principal.\n\tEsta es la ... |
# -*- coding: UTF-8 -*-
#
# funciones.py
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# ... | [
[
8,
0,
0.1092,
0.0282,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1338,
0.007,
0,
0.66,
0.25,
87,
0,
1,
0,
0,
87,
0,
0
],
[
1,
0,
0.1408,
0.007,
0,
0.66,
... | [
"'''\nCreated on 10/05/2012\n@author: Juan Pablo Moreno y Alejandro Duarte\n'''",
"import pygame",
"from tkinter import Tk, Entry, Button, StringVar",
"from math import degrees, radians, sin, cos, atan2",
"class Funciones():\n\t'''\n\tConstantes y metodos estaticos para el uso general del programa.\n\tTales... |
# -*- coding: UTF-8 -*-
#
# nivel_1.py
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# ... | [
[
8,
0,
0.0738,
0.019,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0905,
0.0048,
0,
0.66,
0.3333,
262,
0,
1,
0,
0,
262,
0,
0
],
[
1,
0,
0.0952,
0.0048,
0,
0.66,... | [
"'''\nCreated on 10/05/2012\n@author: Juan Pablo Moreno y Alejandro Duarte\n'''",
"from funcionesBasicas import Funciones as funciones",
"from objetos import *",
"class Nivel1():\n\t\"\"\"Escena numero 1 del juego\"\"\"\n\t\n\tdef __init__(self, pantalla, nombre):\n\t\tself.ventana = pantalla\n\t\tself.imagen... |
# -*- coding: UTF-8 -*-
#
# puntajes.py
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# ... | [
[
8,
0,
0.25,
0.0645,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.2903,
0.0161,
0,
0.66,
0.3333,
87,
0,
1,
0,
0,
87,
0,
0
],
[
1,
0,
0.3065,
0.0161,
0,
0.66,
... | [
"'''\nCreated on 8/07/2012\n@author: Juan Pablo Moreno y Alejandro Duarte\n'''",
"import pygame",
"from funcionesBasicas import Funciones as funciones",
"class Puntajes():\n\t\n\tdef __init__(self, pantalla):\n\t\tself.ventana = pantalla\n\t\tself.imagen_fondo = funciones.cargarImagen(\"imagenes/puntajes.jpg\... |
# -*- coding: UTF-8 -*-
#
# objetos.py
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# ... | [
[
8,
0,
0.062,
0.016,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.072,
0.004,
0,
0.66,
0.0833,
87,
0,
2,
0,
0,
87,
0,
0
],
[
1,
0,
0.076,
0.004,
0,
0.66,
0.... | [
"'''\nCreated on 10/05/2012\n@author: Juan Pablo Moreno y Alejandro Duarte\n'''",
"import pygame, random",
"from pygame.locals import *",
"from funcionesBasicas import Funciones as funciones",
"class Cursor(pygame.Rect):\n\t\n\tdef __init__(self):\n\t\tpygame.Rect.__init__(self,0,0,1,1)\n\t\t\n\tdef actuali... |
# -*- coding: UTF-8 -*-
#
# creditos.py
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# ... | [
[
8,
0,
0.2672,
0.069,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.3103,
0.0172,
0,
0.66,
0.3333,
87,
0,
1,
0,
0,
87,
0,
0
],
[
1,
0,
0.3276,
0.0172,
0,
0.66,
... | [
"'''\nCreated on 26/06/2012\n@author: Juan Pablo Moreno y Alejandro Duarte\n'''",
"import pygame",
"from funcionesBasicas import Funciones as funciones",
"class Creditos():\n\t\n\tdef __init__(self, ventana):\n\t\tself.ventana = ventana\n\t\tself.imagen_fondo = funciones.cargarImagen(\"imagenes/creditos.jpg\"... |
#!/usr/bin/env python
import sys
import string
if len( sys.argv ) == 1 :
for asc_line in sys.stdin.readlines():
mpw_line = string.replace(asc_line, "\\xA5", "\245")
mpw_line = string.replace(mpw_line, "\\xB6", "\266")
mpw_line = string.replace(mpw_line, "\\xC4", "\304")
mpw_line = string.replace(mpw_... | [
[
1,
0,
0.0833,
0.0417,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.125,
0.0417,
0,
0.66,
0.5,
890,
0,
1,
0,
0,
890,
0,
0
],
[
4,
0,
0.6042,
0.8333,
0,
0.66... | [
"import sys",
"import string",
"if len( sys.argv ) == 1 :\n for asc_line in sys.stdin.readlines():\n mpw_line = string.replace(asc_line, \"\\\\xA5\", \"\\245\")\n mpw_line = string.replace(mpw_line, \"\\\\xB6\", \"\\266\")\n mpw_line = string.replace(mpw_line, \"\\\\xC4\", \"\\304\")\n mpw_line = s... |
#!/usr/bin/env python
import sys
import string
if len( sys.argv ) == 1 :
for asc_line in sys.stdin.readlines():
mpw_line = string.replace(asc_line, "\\xA5", "\245")
mpw_line = string.replace(mpw_line, "\\xB6", "\266")
mpw_line = string.replace(mpw_line, "\\xC4", "\304")
mpw_line = string.replace(mpw_... | [
[
1,
0,
0.0833,
0.0417,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.125,
0.0417,
0,
0.66,
0.5,
890,
0,
1,
0,
0,
890,
0,
0
],
[
4,
0,
0.6042,
0.8333,
0,
0.66... | [
"import sys",
"import string",
"if len( sys.argv ) == 1 :\n for asc_line in sys.stdin.readlines():\n mpw_line = string.replace(asc_line, \"\\\\xA5\", \"\\245\")\n mpw_line = string.replace(mpw_line, \"\\\\xB6\", \"\\266\")\n mpw_line = string.replace(mpw_line, \"\\\\xC4\", \"\\304\")\n mpw_line = s... |
#!/usr/bin/env python
#
#
# FreeType 2 glyph name builder
#
# Copyright 1996-2000, 2003, 2005, 2007, 2008, 2011 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
# and distributed under the terms of the FreeType project license,
# LI... | [
[
8,
0,
0.0042,
0.0016,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0055,
0.0002,
0,
0.66,
0.0714,
509,
0,
5,
0,
0,
509,
0,
0
],
[
14,
0,
0.0173,
0.0195,
0,
0.6... | [
"\"\"\"\\\n\nusage: %s <output-file>\n\n This python script generates the glyph names tables defined in the\n `psnames' module.\n\n Its single argument is the name of the header file to be created.",
"import sys, string, struct, re, os.path",
"mac_standard_names = \\\n[\n # 0\n \".notdef\", \".null\", \"no... |
# compute arctangent table for CORDIC computations in fttrigon.c
import sys, math
#units = 64*65536.0 # don't change !!
units = 256
scale = units/math.pi
shrink = 1.0
comma = ""
def calc_val( x ):
global units, shrink
angle = math.atan(x)
shrink = shrink * math.cos(angle)
return angle/math.pi *... | [
[
1,
0,
0.026,
0.013,
0,
0.66,
0,
509,
0,
2,
0,
0,
509,
0,
0
],
[
14,
0,
0.0649,
0.013,
0,
0.66,
0.0714,
805,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.0779,
0.013,
0,
0.66... | [
"import sys, math",
"units = 256",
"scale = units/math.pi",
"shrink = 1.0",
"comma = \"\"",
"def calc_val( x ):\n global units, shrink\n angle = math.atan(x)\n shrink = shrink * math.cos(angle)\n return angle/math.pi * units",
" angle = math.atan(x)",
" shrink = shrink * math.co... |
#!/usr/bin/env python
#
# Check trace components in FreeType 2 source.
# Author: suzuki toshiya, 2009
#
# This code is explicitly into the public domain.
import sys
import os
import re
SRC_FILE_LIST = []
USED_COMPONENT = {}
KNOWN_COMPONENT = {}
SRC_FILE_DIRS = [ "src" ]
TRACE_DEF_FILES = [ "include/freetype/in... | [
[
1,
0,
0.0796,
0.0088,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0885,
0.0088,
0,
0.66,
0.0455,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0973,
0.0088,
0,
... | [
"import sys",
"import os",
"import re",
"SRC_FILE_LIST = []",
"USED_COMPONENT = {}",
"KNOWN_COMPONENT = {}",
"SRC_FILE_DIRS = [ \"src\" ]",
"TRACE_DEF_FILES = [ \"include/freetype/internal/fttrace.h\" ]",
"for i in range( 1, len( sys.argv ) ):\n if sys.argv[i].startswith( \"--help\" ):\n pr... |
#!/usr/bin/env python
#
#
# FreeType 2 glyph name builder
#
# Copyright 1996-2000, 2003, 2005, 2007, 2008, 2011 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
# and distributed under the terms of the FreeType project license,
# LI... | [
[
8,
0,
0.0042,
0.0016,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0055,
0.0002,
0,
0.66,
0.0714,
509,
0,
5,
0,
0,
509,
0,
0
],
[
14,
0,
0.0173,
0.0195,
0,
0.6... | [
"\"\"\"\\\n\nusage: %s <output-file>\n\n This python script generates the glyph names tables defined in the\n `psnames' module.\n\n Its single argument is the name of the header file to be created.",
"import sys, string, struct, re, os.path",
"mac_standard_names = \\\n[\n # 0\n \".notdef\", \".null\", \"no... |
#!/usr/bin/env python
#
# Check trace components in FreeType 2 source.
# Author: suzuki toshiya, 2009
#
# This code is explicitly into the public domain.
import sys
import os
import re
SRC_FILE_LIST = []
USED_COMPONENT = {}
KNOWN_COMPONENT = {}
SRC_FILE_DIRS = [ "src" ]
TRACE_DEF_FILES = [ "include/freetype/in... | [
[
1,
0,
0.0796,
0.0088,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0885,
0.0088,
0,
0.66,
0.0455,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0973,
0.0088,
0,
... | [
"import sys",
"import os",
"import re",
"SRC_FILE_LIST = []",
"USED_COMPONENT = {}",
"KNOWN_COMPONENT = {}",
"SRC_FILE_DIRS = [ \"src\" ]",
"TRACE_DEF_FILES = [ \"include/freetype/internal/fttrace.h\" ]",
"for i in range( 1, len( sys.argv ) ):\n if sys.argv[i].startswith( \"--help\" ):\n pr... |
#!/usr/bin/env python
#
# DocMaker (c) 2002, 2004, 2008 David Turner <david@freetype.org>
#
# This program is a re-write of the original DocMaker took used
# to generate the API Reference of the FreeType font engine
# by converting in-source comments into structured HTML.
#
# This new version is capable of outputting ... | [
[
1,
0,
0.1509,
0.0094,
0,
0.66,
0,
648,
0,
1,
0,
0,
648,
0,
0
],
[
1,
0,
0.1604,
0.0094,
0,
0.66,
0.1111,
273,
0,
1,
0,
0,
273,
0,
0
],
[
1,
0,
0.1698,
0.0094,
0,
... | [
"from sources import *",
"from content import *",
"from utils import *",
"from formatter import *",
"from tohtml import *",
"import utils",
"import sys, os, time, string, glob, getopt",
"def usage():\n print(\"\\nDocMaker Usage information\\n\")\n print(\" docmaker [options] file1 [... |
#!/usr/bin/env python
#
# DocBeauty (c) 2003, 2004, 2008 David Turner <david@freetype.org>
#
# This program is used to beautify the documentation comments used
# in the FreeType 2 public headers.
#
from sources import *
from content import *
from utils import *
import utils
import sys, os, time, string, getopt
... | [
[
1,
0,
0.0796,
0.0088,
0,
0.66,
0,
648,
0,
1,
0,
0,
648,
0,
0
],
[
1,
0,
0.0885,
0.0088,
0,
0.66,
0.1111,
273,
0,
1,
0,
0,
273,
0,
0
],
[
1,
0,
0.0973,
0.0088,
0,
... | [
"from sources import *",
"from content import *",
"from utils import *",
"import utils",
"import sys, os, time, string, getopt",
"content_processor = ContentProcessor()",
"def beautify_block( block ):\n if block.content:\n content_processor.reset()\n\n markups = content_processor.pro... |
# Sources (c) 2002, 2003, 2004, 2006, 2007, 2008, 2009
# David Turner <david@freetype.org>
#
#
# this file contains definitions of classes needed to decompose
# C sources files into a series of multi-line "blocks". There are
# two kinds of blocks:
#
# - normal blocks, which contain source code or ordinary comment... | [
[
1,
0,
0.0634,
0.0029,
0,
0.66,
0,
286,
0,
5,
0,
0,
286,
0,
0
],
[
3,
0,
0.1167,
0.0231,
0,
0.66,
0.05,
659,
0,
1,
0,
0,
0,
0,
3
],
[
2,
1,
0.1196,
0.0173,
1,
0.43... | [
"import fileinput, re, sys, os, string",
"class SourceBlockFormat:\n\n def __init__( self, id, start, column, end ):\n \"\"\"create a block pattern, used to recognize special documentation blocks\"\"\"\n self.id = id\n self.start = re.compile( start, re.VERBOSE )\n self.colum... |
# Formatter (c) 2002, 2004, 2007, 2008 David Turner <david@freetype.org>
#
from sources import *
from content import *
from utils import *
# This is the base Formatter class. Its purpose is to convert
# a content processor's data into specific documents (i.e., table of
# contents, global index, and individual API... | [
[
1,
0,
0.0213,
0.0053,
0,
0.66,
0,
648,
0,
1,
0,
0,
648,
0,
0
],
[
1,
0,
0.0266,
0.0053,
0,
0.66,
0.3333,
273,
0,
1,
0,
0,
273,
0,
0
],
[
1,
0,
0.0319,
0.0053,
0,
... | [
"from sources import *",
"from content import *",
"from utils import *",
"class Formatter:\n\n def __init__( self, processor ):\n self.processor = processor\n self.identifiers = {}\n self.chapters = processor.chapters\n self.sections = processor.sections.values()\n ... |
#!/usr/bin/env python
#
# DocMaker (c) 2002, 2004, 2008 David Turner <david@freetype.org>
#
# This program is a re-write of the original DocMaker took used
# to generate the API Reference of the FreeType font engine
# by converting in-source comments into structured HTML.
#
# This new version is capable of outputting ... | [
[
1,
0,
0.1509,
0.0094,
0,
0.66,
0,
648,
0,
1,
0,
0,
648,
0,
0
],
[
1,
0,
0.1604,
0.0094,
0,
0.66,
0.1111,
273,
0,
1,
0,
0,
273,
0,
0
],
[
1,
0,
0.1698,
0.0094,
0,
... | [
"from sources import *",
"from content import *",
"from utils import *",
"from formatter import *",
"from tohtml import *",
"import utils",
"import sys, os, time, string, glob, getopt",
"def usage():\n print(\"\\nDocMaker Usage information\\n\")\n print(\" docmaker [options] file1 [... |
# Utils (c) 2002, 2004, 2007, 2008 David Turner <david@freetype.org>
#
import string, sys, os, glob
# current output directory
#
output_dir = None
# This function is used to sort the index. It is a simple lexicographical
# sort, except that it places capital letters before lowercase ones.
#
def index_sort( s1, ... | [
[
1,
0,
0.0303,
0.0076,
0,
0.66,
0,
890,
0,
4,
0,
0,
890,
0,
0
],
[
14,
0,
0.0606,
0.0076,
0,
0.66,
0.125,
577,
1,
0,
0,
0,
0,
9,
0
],
[
2,
0,
0.2121,
0.2197,
0,
0.... | [
"import string, sys, os, glob",
"output_dir = None",
"def index_sort( s1, s2 ):\n if not s1:\n return -1\n\n if not s2:\n return 1\n\n l1 = len( s1 )",
" if not s1:\n return -1",
" return -1",
" if not s2:\n return 1",
" return 1",
" l1 = le... |
# Content (c) 2002, 2004, 2006, 2007, 2008, 2009
# David Turner <david@freetype.org>
#
# This file contains routines used to parse the content of documentation
# comment blocks and build more structured objects out of them.
#
from sources import *
from utils import *
import string, re
# this regular expression... | [
[
1,
0,
0.0137,
0.0017,
0,
0.66,
0,
648,
0,
1,
0,
0,
648,
0,
0
],
[
1,
0,
0.0154,
0.0017,
0,
0.66,
0.0667,
970,
0,
1,
0,
0,
970,
0,
0
],
[
1,
0,
0.0171,
0.0017,
0,
... | [
"from sources import *",
"from utils import *",
"import string, re",
"re_code_start = re.compile( r\"(\\s*){\\s*$\" )",
"re_code_end = re.compile( r\"(\\s*)}\\s*$\" )",
"re_identifier = re.compile( r'(\\w*)' )",
"re_header_macro = re.compile( r'^#define\\s{1,}(\\w{1,}_H)\\s{1,}<(.*)>' )",
"class Do... |
#!/usr/bin/env python
#
# DocBeauty (c) 2003, 2004, 2008 David Turner <david@freetype.org>
#
# This program is used to beautify the documentation comments used
# in the FreeType 2 public headers.
#
from sources import *
from content import *
from utils import *
import utils
import sys, os, time, string, getopt
... | [
[
1,
0,
0.0796,
0.0088,
0,
0.66,
0,
648,
0,
1,
0,
0,
648,
0,
0
],
[
1,
0,
0.0885,
0.0088,
0,
0.66,
0.1111,
273,
0,
1,
0,
0,
273,
0,
0
],
[
1,
0,
0.0973,
0.0088,
0,
... | [
"from sources import *",
"from content import *",
"from utils import *",
"import utils",
"import sys, os, time, string, getopt",
"content_processor = ContentProcessor()",
"def beautify_block( block ):\n if block.content:\n content_processor.reset()\n\n markups = content_processor.pro... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.