code
stringlengths
1
1.49M
vector
listlengths
0
7.38k
snippet
listlengths
0
7.38k
#!/usr/bin/python # # Copyright 2009 Google Inc. # # 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/LICENSE-2.0 # # unless required by applicable law or ag...
[ [ 8, 0, 0.0683, 0.0036, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.0755, 0.0036, 0, 0.66, 0.0769, 777, 1, 0, 0, 0, 0, 3, 0 ], [ 1, 0, 0.0827, 0.0036, 0, 0.66,...
[ "\"\"\"Check where hosts, ports and protocols are matched in a capirca policy.\"\"\"", "__author__ = 'watson@google.com (Tony Watson)'", "import sys", "import nacaddr", "import policy", "import port", "class Error(Exception):\n \"\"\"Base error class.\"\"\"", " \"\"\"Base error class.\"\"\"", "cla...
#!/usr/bin/python # # Copyright 2011 Google Inc. # # 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/LICENSE-2.0 # # unless required by applicable law or ag...
[ [ 8, 0, 0.0265, 0.0014, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.0292, 0.0014, 0, 0.66, 0.0625, 777, 1, 0, 0, 0, 0, 3, 0 ], [ 1, 0, 0.032, 0.0014, 0, 0.66, ...
[ "\"\"\"Iptables generator.\"\"\"", "__author__ = 'watson@google.com (Tony Watson)'", "import aclgenerator", "import logging", "import nacaddr", "import re", "class Term(aclgenerator.Term):\n \"\"\"Generate Iptables policy terms.\"\"\"\n\n # Validate that term does not contain any fields we do not\n #...
#!/usr/bin/python # # Copyright 2011 Google Inc. # # 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/LICENSE-2.0 # # unless required by applicable law or ag...
[ [ 8, 0, 0.0757, 0.004, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.0837, 0.004, 0, 0.66, 0.0769, 777, 1, 0, 0, 0, 0, 3, 0 ], [ 1, 0, 0.0916, 0.004, 0, 0.66, ...
[ "\"\"\"A subclass of the ipaddr library that includes comments for ipaddr objects.\"\"\"", "__author__ = 'watson@google.com (Tony Watson)'", "from third_party import ipaddr", "def IP(ipaddress, comment='', token=''):\n \"\"\"Take an ip string and return an object of the correct type.\n\n Args:\n ip_strin...
#!/usr/bin/python # # Copyright 2011 Google Inc. All Rights Reserved. # # 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/LICENSE-2.0 # # unless required by...
[ [ 14, 0, 0.0319, 0.0017, 0, 0.66, 0, 777, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.0336, 0.0017, 0, 0.66, 0.0909, 777, 1, 0, 0, 0, 0, 3, 0 ], [ 1, 0, 0.0387, 0.0017, 0, 0....
[ "__author__ = 'pmoody@google.com (Peter Moody)'", "__author__ = 'watson@google.com (Tony Watson)'", "import logging", "import aclgenerator", "import nacaddr", "class Error(Exception):\n pass", "class JuniperTermPortProtocolError(Error):\n pass", "class TcpEstablishedWithNonTcp(Error):\n pass", "c...
#!/usr/bin/python # # # Copyright 2009 Google Inc. # # 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/LICENSE-2.0 # # unless required by applicable law or ...
[ [ 8, 0, 0.3393, 0.0179, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.375, 0.0179, 0, 0.66, 0.2, 777, 1, 0, 0, 0, 0, 3, 0 ], [ 3, 0, 0.4375, 0.0357, 0, 0.66, ...
[ "\"\"\"Common library for network ports and protocol handling.\"\"\"", "__author__ = 'watson@google.com (Tony Watson)'", "class Error(Exception):\n \"\"\"Base error class.\"\"\"", " \"\"\"Base error class.\"\"\"", "class BadPortValue(Error):\n \"\"\"Invalid port format.\"\"\"", " \"\"\"Invalid port fo...
#!/usr/bin/python # Copyright 2009 Google Inc. # # 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/LICENSE-2.0 # # unless required by applicable law or agre...
[ [ 8, 0, 0.0289, 0.0016, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.0321, 0.0016, 0, 0.66, 0.0625, 777, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.0337, 0.0016, 0, 0.66...
[ "\"\"\"Cisco renderer.\"\"\"", "__author__ = 'pmoody@google.com (Peter Moody)'", "__author__ = 'watson@google.com (Tony Watson)'", "import logging", "import re", "from third_party import ipaddr", "import aclgenerator", "import nacaddr", "_ACTION_TABLE = {\n 'accept': 'permit',\n 'deny': 'deny'...
#!/usr/bin/python # # Copyright 2009 Google Inc. # # 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/LICENSE-2.0 # # unless required by applicable law or ag...
[ [ 8, 0, 0.0133, 0.0014, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.015, 0.0007, 0, 0.66, 0.013, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.0157, 0.0007, 0, 0.66, ...
[ "\"\"\"Parses the generic policy files and return a policy object for acl rendering.\n\"\"\"", "import os", "import sys", "import nacaddr", "import naming", "from third_party.ply import lex", "from third_party.ply import yacc", "DEFINITIONS = None", "DEFAULT_DEFINITIONS = './def'", "_ACTIONS = set...
#!/usr/bin/python # # Copyright 2009 Google Inc. # # 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/LICENSE-2.0 # # unless required by applicable law or ag...
[ [ 8, 0, 0.0133, 0.0014, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.015, 0.0007, 0, 0.66, 0.013, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.0157, 0.0007, 0, 0.66, ...
[ "\"\"\"Parses the generic policy files and return a policy object for acl rendering.\n\"\"\"", "import os", "import sys", "import nacaddr", "import naming", "from third_party.ply import lex", "from third_party.ply import yacc", "DEFINITIONS = None", "DEFAULT_DEFINITIONS = './def'", "_ACTIONS = set...
#!/usr/bin/python # # Copyright 2011 Google Inc. # # 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/LICENSE-2.0 # # unless required by applicable law or ag...
[ [ 8, 0, 0.0265, 0.0014, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.0292, 0.0014, 0, 0.66, 0.0625, 777, 1, 0, 0, 0, 0, 3, 0 ], [ 1, 0, 0.032, 0.0014, 0, 0.66, ...
[ "\"\"\"Iptables generator.\"\"\"", "__author__ = 'watson@google.com (Tony Watson)'", "import aclgenerator", "import logging", "import nacaddr", "import re", "class Term(aclgenerator.Term):\n \"\"\"Generate Iptables policy terms.\"\"\"\n\n # Validate that term does not contain any fields we do not\n #...
#!/usr/bin/python2.4 # # Copyright 2011 Google Inc. All Rights Reserved. """Speedway iptables generator. This is a subclass of Iptables lib.""" __author__ = 'watson@google.com (Tony Watson)' import iptables class Term(iptables.Term): """Generate Iptables policy terms.""" _PLATFORM = 'speedway' _PREJUMP_...
[ [ 8, 0, 0.2121, 0.0909, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.303, 0.0303, 0, 0.66, 0.25, 777, 1, 0, 0, 0, 0, 3, 0 ], [ 1, 0, 0.3636, 0.0303, 0, 0.66, ...
[ "\"\"\"Speedway iptables generator.\n\n This is a subclass of Iptables lib.\"\"\"", "__author__ = 'watson@google.com (Tony Watson)'", "import iptables", "class Term(iptables.Term):\n \"\"\"Generate Iptables policy terms.\"\"\"\n _PLATFORM = 'speedway'\n _PREJUMP_FORMAT = None\n _POSTJUMP_FORMAT = '-A %s...
# # Network access control library and utilities # # capirca/__init__.py # # This package is intended to simplify the process of developing # and working with large numbers of network access control lists # for various platforms that share common network and service # definitions. # # from capirca import naming # from ...
[ [ 14, 0, 0.8077, 0.0385, 0, 0.66, 0, 162, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.9038, 0.0769, 0, 0.66, 0.5, 272, 0, 0, 0, 0, 0, 5, 0 ], [ 14, 0, 1, 0.0385, 0, 0.66, ...
[ "__version__ = '1.0.0'", "__all__ = ['naming', 'policy', 'cisco', 'juniper', 'iptables',\n 'policyreader', 'aclcheck']", "__author__ = 'Paul (Tony) Watson (watson@gmail.com / watson@google.com)'" ]
#!/usr/bin/python # # Copyright 2011 Google Inc. # # 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/LICENSE-2.0 # # unless required by applicable law or ag...
[ [ 8, 0, 0.0757, 0.004, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.0837, 0.004, 0, 0.66, 0.0769, 777, 1, 0, 0, 0, 0, 3, 0 ], [ 1, 0, 0.0916, 0.004, 0, 0.66, ...
[ "\"\"\"A subclass of the ipaddr library that includes comments for ipaddr objects.\"\"\"", "__author__ = 'watson@google.com (Tony Watson)'", "from third_party import ipaddr", "def IP(ipaddress, comment='', token=''):\n \"\"\"Take an ip string and return an object of the correct type.\n\n Args:\n ip_strin...
#!/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 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 """ 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 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 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/python2.4 # # Copyright 2007 The Python-Twitter Developers # # 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/LICENSE-2.0 # # Unless required by...
[ [ 1, 0, 0.1978, 0.011, 0, 0.66, 0, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.2088, 0.011, 0, 0.66, 0.0625, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 7, 0, 0.2582, 0.044, 0, 0.6...
[ "import os", "import sys", "try:\n from urlparse import parse_qsl\nexcept:\n from cgi import parse_qsl", " from urlparse import parse_qsl", " from cgi import parse_qsl", "import oauth2 as oauth", "REQUEST_TOKEN_URL = 'https://api.twitter.com/oauth/request_token'", "ACCESS_TOKEN_URL = 'https://api...
#!/usr/bin/python2.4 '''Post a message to twitter''' __author__ = 'dewitt@google.com' import ConfigParser import getopt import os import sys import twitter USAGE = '''Usage: tweet [options] message This script posts a message to Twitter. Options: -h --help : print this help --consumer-key : the twit...
[ [ 8, 0, 0.0213, 0.0071, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.0355, 0.0071, 0, 0.66, 0.0667, 777, 1, 0, 0, 0, 0, 3, 0 ], [ 1, 0, 0.0496, 0.0071, 0, 0.66,...
[ "'''Post a message to twitter'''", "__author__ = 'dewitt@google.com'", "import ConfigParser", "import getopt", "import os", "import sys", "import twitter", "USAGE = '''Usage: tweet [options] message\n\n This script posts a message to Twitter.\n\n Options:\n\n -h --help : print this help\n --co...
#!/usr/bin/python2.4 # # Copyright 2007 The Python-Twitter Developers # # 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/LICENSE-2.0 # # Unless required by...
[ [ 8, 0, 0.2606, 0.0563, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.3099, 0.0141, 0, 0.66, 0.5, 614, 0, 1, 0, 0, 614, 0, 0 ], [ 3, 0, 0.7535, 0.507, 0, 0.66, ...
[ "'''A class that defines the default URL Shortener.\n\nTinyURL is provided as the default and as an example.\n'''", "import urllib", "class ShortenURL(object):\n '''Helper class to make URL Shortener calls if/when required'''\n def __init__(self,\n userid=None,\n password=N...
#!/usr/bin/python2.4 # # Copyright 2007 The Python-Twitter Developers # # 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/LICENSE-2.0 # # Unless required by...
[ [ 8, 0, 0.2329, 0.0137, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.2603, 0.0137, 0, 0.66, 0.125, 777, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.274, 0.0137, 0, 0.66, ...
[ "'''The setup and build script for the python-twitter library.'''", "__author__ = 'python-twitter@googlegroups.com'", "__version__ = '0.8.5'", "METADATA = dict(\n name = \"python-twitter\",\n version = __version__,\n py_modules = ['twitter'],\n author='The Python-Twitter Developers',\n author_email='pyth...
"""JSON token scanner """ import re try: from simplejson._speedups import make_scanner as c_make_scanner except ImportError: c_make_scanner = None __all__ = ['make_scanner'] NUMBER_RE = re.compile( r'(-?(?:0|[1-9]\d*))(\.\d+)?([eE][-+]?\d+)?', (re.VERBOSE | re.MULTILINE | re.DOTALL)) def py_make_scan...
[ [ 8, 0, 0.0231, 0.0308, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.0462, 0.0154, 0, 0.66, 0.1667, 540, 0, 1, 0, 0, 540, 0, 0 ], [ 7, 0, 0.0846, 0.0615, 0, 0.66...
[ "\"\"\"JSON token scanner\n\"\"\"", "import re", "try:\n from simplejson._speedups import make_scanner as c_make_scanner\nexcept ImportError:\n c_make_scanner = None", " from simplejson._speedups import make_scanner as c_make_scanner", " c_make_scanner = None", "__all__ = ['make_scanner']", ...
"""Implementation of JSONEncoder """ import re try: from simplejson._speedups import encode_basestring_ascii as c_encode_basestring_ascii except ImportError: c_encode_basestring_ascii = None try: from simplejson._speedups import make_encoder as c_make_encoder except ImportError: c_make_encoder = None ...
[ [ 8, 0, 0.0035, 0.0046, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.0069, 0.0023, 0, 0.66, 0.0667, 540, 0, 1, 0, 0, 540, 0, 0 ], [ 7, 0, 0.015, 0.0092, 0, 0.66,...
[ "\"\"\"Implementation of JSONEncoder\n\"\"\"", "import re", "try:\n from simplejson._speedups import encode_basestring_ascii as c_encode_basestring_ascii\nexcept ImportError:\n c_encode_basestring_ascii = None", " from simplejson._speedups import encode_basestring_ascii as c_encode_basestring_ascii",...
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.1582, 0.3133, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.3165, 0.0032, 0, 0.66, 0.1, 162, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.3244, 0.0127, 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...
#!/usr/bin/python import sys import os import os.path import ConfigParser import csv import httplib cwd = os.path.abspath((os.path.dirname(sys.argv[0]))) config_file = os.path.join(cwd, 'fetch_samples.conf') #print 'config file: %s' % config_file config = ConfigParser.RawConfigParser() config.read(config_file) samp...
[ [ 1, 0, 0.0769, 0.0256, 0, 0.66, 0, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.1026, 0.0256, 0, 0.66, 0.0714, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.1282, 0.0256, 0, ...
[ "import sys", "import os", "import os.path", "import ConfigParser", "import csv", "import httplib", "cwd = os.path.abspath((os.path.dirname(sys.argv[0])))", "config_file = os.path.join(cwd, 'fetch_samples.conf')", "config = ConfigParser.RawConfigParser()", "config.read(config_file)", "samples_di...
#!/usr/bin/python import sys import os import os.path import ConfigParser from xml.etree import ElementTree cwd = os.path.abspath((os.path.dirname(sys.argv[0]))) config_file = os.path.join(cwd, 'analyze_samples.conf') #print 'config file: %s' % config_file config = ConfigParser.RawConfigParser() config.read(config_f...
[ [ 1, 0, 0.0938, 0.0312, 0, 0.66, 0, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.125, 0.0312, 0, 0.66, 0.1, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.1562, 0.0312, 0, 0.66...
[ "import sys", "import os", "import os.path", "import ConfigParser", "from xml.etree import ElementTree", "cwd = os.path.abspath((os.path.dirname(sys.argv[0])))", "config_file = os.path.join(cwd, 'analyze_samples.conf')", "config = ConfigParser.RawConfigParser()", "config.read(config_file)", "sampl...
''' 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.35, ...
[ "'''\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 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...
''' 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...
#!/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 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...
dataTypes = ["CPTUndefinedDataType", "CPTIntegerDataType", "CPTUnsignedIntegerDataType", "CPTFloatingPointDataType", "CPTComplexFloatingPointDataType", "CPTDecimalDataType"] types = { "CPTUndefinedDataType" : [], "CPTIntegerDataType" : ["int8_t", "int16_t", "int32_t", "int64_t"], "CPTUnsignedIntegerDat...
[ [ 14, 0, 0.0068, 0.0068, 0, 0.66, 0, 302, 0, 0, 0, 0, 0, 5, 0 ], [ 14, 0, 0.0372, 0.0405, 0, 0.66, 0.04, 209, 0, 0, 0, 0, 0, 6, 0 ], [ 14, 0, 0.1115, 0.0946, 0, 0.6...
[ "dataTypes = [\"CPTUndefinedDataType\", \"CPTIntegerDataType\", \"CPTUnsignedIntegerDataType\", \"CPTFloatingPointDataType\", \"CPTComplexFloatingPointDataType\", \"CPTDecimalDataType\"]", "types = { \"CPTUndefinedDataType\" : [],\n \"CPTIntegerDataType\" : [\"int8_t\", \"int16_t\", \"int32_t\", \"int64_t\...
#!/usr/bin/env python from os import mkdir, makedirs, environ, chdir, getcwd, system, listdir from os.path import join from shutil import copy, copytree, move, rmtree, ignore_patterns # Usage def Usage(): return 'Usage: createrelease.py <version>' # Run Xcode def RunXcode(project, target): system('/usr/bin/x...
[ [ 1, 0, 0.0353, 0.0118, 0, 0.66, 0, 688, 0, 7, 0, 0, 688, 0, 0 ], [ 1, 0, 0.0471, 0.0118, 0, 0.66, 0.0213, 79, 0, 1, 0, 0, 79, 0, 0 ], [ 1, 0, 0.0588, 0.0118, 0, 0....
[ "from os import mkdir, makedirs, environ, chdir, getcwd, system, listdir", "from os.path import join", "from shutil import copy, copytree, move, rmtree, ignore_patterns", "def Usage():\n return 'Usage: createrelease.py <version>'", " return 'Usage: createrelease.py <version>'", "def RunXcode(project...
#!/usr/bin/env python #--------- # Script to change the prefix of a framework #--------- import os import re import string #------------------ # Config #------------------ oldPrefix = "CP" # Set to empty string if there is no old prefix newPrefix = "CPT" # Root directories origRootDir = "/Users/cormack/Desktop/Cor...
[ [ 1, 0, 0.1228, 0.0175, 0, 0.66, 0, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.1404, 0.0175, 0, 0.66, 0.1111, 540, 0, 1, 0, 0, 540, 0, 0 ], [ 1, 0, 0.1579, 0.0175, 0, ...
[ "import os", "import re", "import string", "oldPrefix = \"CP\" # Set to empty string if there is no old prefix", "newPrefix = \"CPT\"", "origRootDir = \"/Users/cormack/Desktop/CorePlotReprefix\"", "newRootDir = \"/Users/cormack/Desktop/CorePlotReprefixNew\"", "def treatDirectory(arg, dirName, names)...
#!/usr/bin/python # Recursive fibonacci for phase 4 def func4(x): if x <= 1 : return 1 else : y = func4(x-1) z = func4(x-2) return y + z if __name__ == "__main__": print func4(9)
[ [ 2, 0, 0.5714, 0.5, 0, 0.66, 0, 152, 0, 1, 1, 0, 0, 0, 2 ], [ 4, 1, 0.6071, 0.4286, 1, 0.46, 0, 0, 0, 0, 0, 0, 0, 0, 2 ], [ 13, 2, 0.5, 0.0714, 2, 0.56, 0, ...
[ "def func4(x):\n\tif x <= 1 :\n\t\treturn 1\n\telse :\n\t\ty = func4(x-1)\n\t\tz = func4(x-2)\n\t\treturn y + z", "\tif x <= 1 :\n\t\treturn 1\n\telse :\n\t\ty = func4(x-1)\n\t\tz = func4(x-2)\n\t\treturn y + z", "\t\treturn 1", "\t\ty = func4(x-1)", "\t\tz = func4(x-2)", "\t\treturn y + z", "if __name_...
#!/usr/bin/env pypy import os, sys, logging, re import argparse import fnmatch configurations = {'lite', 'pro'} package_dirs = { 'lite': ('src/cx/hell/android/pdfview',), 'pro': ('src/cx/hell/android/pdfviewpro',) } file_replaces = { 'lite': ( 'cx.hell.android.pdfview.', '"cx.hell.an...
[ [ 1, 0, 0.014, 0.0047, 0, 0.66, 0, 688, 0, 4, 0, 0, 688, 0, 0 ], [ 1, 0, 0.0187, 0.0047, 0, 0.66, 0.0526, 325, 0, 1, 0, 0, 325, 0, 0 ], [ 1, 0, 0.0234, 0.0047, 0, 0...
[ "import os, sys, logging, re", "import argparse", "import fnmatch", "configurations = {'lite', 'pro'}", "package_dirs = {\n 'lite': ('src/cx/hell/android/pdfview',),\n 'pro': ('src/cx/hell/android/pdfviewpro',)\n}", "file_replaces = {\n 'lite': (\n 'cx.hell.android.pdfview.',\n '\"c...
import sys import yaml import hashlib NS = 'Emitter' DEFINE = 'YAML_GEN_TESTS' EVENT_COUNT = 5 def encode_stream(line): for c in line: if c == '\n': yield '\\n' elif c == '"': yield '\\"' elif c == '\t': yield '\\t' elif ord(c) < 0x20: ...
[ [ 1, 0, 0.0054, 0.0054, 0, 0.66, 0, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.0109, 0.0054, 0, 0.66, 0.0476, 960, 0, 1, 0, 0, 960, 0, 0 ], [ 1, 0, 0.0163, 0.0054, 0, ...
[ "import sys", "import yaml", "import hashlib", "NS = 'Emitter'", "DEFINE = 'YAML_GEN_TESTS'", "EVENT_COUNT = 5", "def encode_stream(line):\n for c in line:\n if c == '\\n':\n yield '\\\\n'\n elif c == '\"':\n yield '\\\\\"'\n elif c == '\\t':\n yi...
import sys, os, glob def wavify(location): path = location.rsplit("/", 1)[0] + "/" in_fn = location.rsplit("/", 1)[1] out_fn = "_" + in_fn.rsplit(".", 1)[0] + ".wav" if not os.path.isfile(path + out_fn): tmp_fn = out_fn[1:-3]+"mp3" os.system("cp " + path + in_fn + " " + path + tmp_fn) tmp_fn2 = "tm...
[ [ 1, 0, 0.0233, 0.0233, 0, 0.66, 0, 509, 0, 3, 0, 0, 509, 0, 0 ], [ 2, 0, 0.2558, 0.3953, 0, 0.66, 0.3333, 488, 0, 1, 1, 0, 0, 0, 12 ], [ 14, 1, 0.093, 0.0233, 1, 0...
[ "import sys, os, glob", "def wavify(location):\n path = location.rsplit(\"/\", 1)[0] + \"/\"\n in_fn = location.rsplit(\"/\", 1)[1]\n out_fn = \"_\" + in_fn.rsplit(\".\", 1)[0] + \".wav\"\n if not os.path.isfile(path + out_fn):\n tmp_fn = out_fn[1:-3]+\"mp3\"\n os.system(\"cp \" + path + in_fn + \" \" +...
#!/usr/bin/env python # # Copyright 2006, 2007 Google Inc. All Rights Reserved. # Author: danderson@google.com (David Anderson) # # Script for uploading files to a Google Code project. # # This is intended to be both a useful script for people who want to # streamline project uploads and a reference implementation for ...
[ [ 8, 0, 0.2076, 0.0089, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.2188, 0.0045, 0, 0.66, 0.0833, 777, 1, 0, 0, 0, 0, 3, 0 ], [ 1, 0, 0.2277, 0.0045, 0, 0.66,...
[ "\"\"\"Google Code file uploader script.\n\"\"\"", "__author__ = 'danderson@google.com (David Anderson)'", "import httplib", "import os.path", "import optparse", "import getpass", "import base64", "import sys", "def upload(file, project_name, user_name, password, summary, labels=None):\n \"\"\"Uplo...
#==================================================================== # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you ...
[ [ 1, 0, 0.3514, 0.0135, 0, 0.66, 0, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.3649, 0.0135, 0, 0.66, 0.1111, 540, 0, 1, 0, 0, 540, 0, 0 ], [ 1, 0, 0.3784, 0.0135, 0, ...
[ "import os", "import re", "import tempfile", "import shutil", "ignore_pattern = re.compile('^(.svn|target|bin|classes)')", "java_pattern = re.compile('^.*\\.java')", "annot_pattern = re.compile('import org\\.apache\\.http\\.annotation\\.')", "def process_dir(dir):\n files = os.listdir(dir)\n for...
import sys import os import sre from sets import Set output = sre.compile(r"test_(.*).out") RUN_1_DIR = sys.argv[1] RUN_2_DIR = sys.argv[2] run_1_files = os.listdir(RUN_1_DIR) run_2_files = os.listdir(RUN_2_DIR) tests_1 = [] tests_2 = [] for _ in run_1_files: m = output.match(_) if m is None: continue tests...
[ [ 1, 0, 0.0115, 0.0115, 0, 0.66, 0, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.023, 0.0115, 0, 0.66, 0.0526, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.0345, 0.0115, 0, 0...
[ "import sys", "import os", "import sre", "from sets import Set", "output = sre.compile(r\"test_(.*).out\")", "RUN_1_DIR = sys.argv[1]", "RUN_2_DIR = sys.argv[2]", "run_1_files = os.listdir(RUN_1_DIR)", "run_2_files = os.listdir(RUN_2_DIR)", "tests_1 = []", "tests_2 = []", "for _ in run_1_files...
import sys import os import subprocess import re import select import string comment = re.compile(r'\s*#.*') assignment = re.compile(r'^([A-Za-z_][A-Za-z0-9_]*)\s*=\s*(.*)') continuation = re.compile(r'^\s') INTERSECT = sys.argv[1] TESTS = sys.argv[2] TGT_DIR = sys.argv[3] if not os.path.exists(TGT_DIR): os.makedi...
[ [ 1, 0, 0.0071, 0.0071, 0, 0.66, 0, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.0142, 0.0071, 0, 0.66, 0.0333, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.0213, 0.0071, 0, ...
[ "import sys", "import os", "import subprocess", "import re", "import select", "import string", "comment = re.compile(r'\\s*#.*')", "assignment = re.compile(r'^([A-Za-z_][A-Za-z0-9_]*)\\s*=\\s*(.*)')", "continuation = re.compile(r'^\\s')", "INTERSECT = sys.argv[1]", "TESTS = sys.argv[2]", "TGT_...
#!/usr/bin/python import httplib, urllib, sys import time # Define the parameters for the POST request and encode them in # a URL-safe format. def minimize(code): params = urllib.urlencode([ ('js_code', code), ('compilation_level', 'SIMPLE_OPTIMIZATIONS'), ('output_format', 'text'), ...
[ [ 1, 0, 0.1071, 0.0357, 0, 0.66, 0, 2, 0, 3, 0, 0, 2, 0, 0 ], [ 1, 0, 0.1429, 0.0357, 0, 0.66, 0.5, 654, 0, 1, 0, 0, 654, 0, 0 ], [ 2, 0, 0.6429, 0.75, 0, 0.66, ...
[ "import httplib, urllib, sys", "import time", "def minimize(code):\n\n params = urllib.urlencode([\n ('js_code', code),\n ('compilation_level', 'SIMPLE_OPTIMIZATIONS'),\n ('output_format', 'text'),\n ('output_info', 'compiled_code'),\n ])", " params = urllib.urlencode([\...
#!/usr/bin/python # This code is original from jsmin by Douglas Crockford, it was translated to # Python by Baruch Even. The original code had the following copyright and # license. # # /* jsmin.c # 2007-01-08 # # Copyright (c) 2002 Douglas Crockford (www.crockford.com) # # Permission is hereby granted, free of ch...
[ [ 1, 0, 0.1528, 0.0046, 0, 0.66, 0, 609, 0, 1, 0, 0, 609, 0, 0 ], [ 2, 0, 0.1782, 0.037, 0, 0.66, 0.1429, 275, 0, 1, 1, 0, 0, 0, 6 ], [ 14, 1, 0.1667, 0.0046, 1, 0....
[ "from StringIO import StringIO", "def jsmin(js):\n ins = StringIO(js)\n outs = StringIO()\n JavascriptMinify().minify(ins, outs)\n str = outs.getvalue()\n if len(str) > 0 and str[0] == '\\n':\n str = str[1:]\n return str", " ins = StringIO(js)", " outs = StringIO()", " Java...
#!/usr/bin/env python # # Script to provide a wrapper around the ShrinkSafe "web service" # <http://shrinksafe.dojotoolkit.org/> # # # We use this script for two reasons: # # * This avoids having to install and configure Java and the standalone # ShrinkSafe utility. # # * The current ShrinkSafe standalone utility...
[ [ 1, 0, 0.3148, 0.0185, 0, 0.66, 0, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.3519, 0.0185, 0, 0.66, 0.2, 614, 0, 1, 0, 0, 614, 0, 0 ], [ 1, 0, 0.3704, 0.0185, 0, 0.6...
[ "import sys", "import urllib", "import urllib2", "URL_SHRINK_SAFE = \"http://shrinksafe.dojotoolkit.org/shrinksafe.php\"", "BOUNDARY_MARKER = \"---------------------------72288400411964641492083565382\"", "if __name__ == \"__main__\":\n ## Grab the source code\n try:\n sourceFilename = sys.ar...
#!/usr/bin/env python # # Script to provide a wrapper around the ShrinkSafe "web service" # <http://shrinksafe.dojotoolkit.org/> # # # We use this script for two reasons: # # * This avoids having to install and configure Java and the standalone # ShrinkSafe utility. # # * The current ShrinkSafe standalone utility...
[ [ 1, 0, 0.3148, 0.0185, 0, 0.66, 0, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.3519, 0.0185, 0, 0.66, 0.2, 614, 0, 1, 0, 0, 614, 0, 0 ], [ 1, 0, 0.3704, 0.0185, 0, 0.6...
[ "import sys", "import urllib", "import urllib2", "URL_SHRINK_SAFE = \"http://shrinksafe.dojotoolkit.org/shrinksafe.php\"", "BOUNDARY_MARKER = \"---------------------------72288400411964641492083565382\"", "if __name__ == \"__main__\":\n ## Grab the source code\n try:\n sourceFilename = sys.ar...
# Copyright 2010 The Closure Library Authors. All Rights Reserved. # # 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/LICENSE-2.0 # # Unless required by a...
[ [ 8, 0, 0.2113, 0.0141, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.2394, 0.0141, 0, 0.66, 0.1429, 42, 0, 1, 0, 0, 42, 0, 0 ], [ 1, 0, 0.2535, 0.0141, 0, 0.66, ...
[ "\"\"\"Utility to use the Closure Compiler CLI from Python.\"\"\"", "import distutils.version", "import logging", "import re", "import subprocess", "_VERSION_REGEX = re.compile('\"([0-9][.0-9]*)')", "def _GetJavaVersion():\n \"\"\"Returns the string for the current version of Java installed.\"\"\"\n p...
import re import os def run(): sourceDirectory = "../lib/OpenLayers" allFiles = [] SUFFIX_JAVASCRIPT = ".js" ## Find all the Javascript source files for root, dirs, files in os.walk(sourceDirectory): for filename in files: if filename.endswith(SUFFIX_JAVASCRIPT) and not f...
[ [ 1, 0, 0.0455, 0.0455, 0, 0.66, 0, 540, 0, 1, 0, 0, 540, 0, 0 ], [ 1, 0, 0.0909, 0.0455, 0, 0.66, 0.5, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 2, 0, 0.5682, 0.9091, 0, 0.6...
[ "import re", "import os", "def run():\n sourceDirectory = \"../lib/OpenLayers\" \n allFiles = []\n SUFFIX_JAVASCRIPT = \".js\"\n ## Find all the Javascript source files\n for root, dirs, files in os.walk(sourceDirectory):\n for filename in files:\n if filename.endswith(SUFFIX...
#!/usr/bin/python import httplib, urllib, sys import time # Define the parameters for the POST request and encode them in # a URL-safe format. def minimize(code): params = urllib.urlencode([ ('js_code', code), ('compilation_level', 'SIMPLE_OPTIMIZATIONS'), ('output_format', 'text'), ...
[ [ 1, 0, 0.1071, 0.0357, 0, 0.66, 0, 2, 0, 3, 0, 0, 2, 0, 0 ], [ 1, 0, 0.1429, 0.0357, 0, 0.66, 0.5, 654, 0, 1, 0, 0, 654, 0, 0 ], [ 2, 0, 0.6429, 0.75, 0, 0.66, ...
[ "import httplib, urllib, sys", "import time", "def minimize(code):\n\n params = urllib.urlencode([\n ('js_code', code),\n ('compilation_level', 'SIMPLE_OPTIMIZATIONS'),\n ('output_format', 'text'),\n ('output_info', 'compiled_code'),\n ])", " params = urllib.urlencode([\...
""" toposort.py Sorts dictionary keys based on lists of dependencies. """ class MissingDependency(Exception): """Exception raised when a listed dependency is not in the dictionary.""" class Sorter(object): def __init__(self, dependencies): self.dependencies = dependencies self.visited = set() ...
[ [ 8, 0, 0.0714, 0.1143, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 3, 0, 0.1857, 0.0571, 0, 0.66, 0.3333, 635, 0, 0, 0, 0, 645, 0, 0 ], [ 8, 1, 0.2, 0.0286, 1, 0.43, ...
[ "\"\"\"\ntoposort.py\nSorts dictionary keys based on lists of dependencies.\n\"\"\"", "class MissingDependency(Exception):\n \"\"\"Exception raised when a listed dependency is not in the dictionary.\"\"\"", " \"\"\"Exception raised when a listed dependency is not in the dictionary.\"\"\"", "class Sorter...
#!/usr/bin/python # This code is original from jsmin by Douglas Crockford, it was translated to # Python by Baruch Even. The original code had the following copyright and # license. # # /* jsmin.c # 2007-01-08 # # Copyright (c) 2002 Douglas Crockford (www.crockford.com) # # Permission is hereby granted, free of ch...
[ [ 1, 0, 0.1528, 0.0046, 0, 0.66, 0, 609, 0, 1, 0, 0, 609, 0, 0 ], [ 2, 0, 0.1782, 0.037, 0, 0.66, 0.1429, 275, 0, 1, 1, 0, 0, 0, 6 ], [ 14, 1, 0.1667, 0.0046, 1, 0....
[ "from StringIO import StringIO", "def jsmin(js):\n ins = StringIO(js)\n outs = StringIO()\n JavascriptMinify().minify(ins, outs)\n str = outs.getvalue()\n if len(str) > 0 and str[0] == '\\n':\n str = str[1:]\n return str", " ins = StringIO(js)", " outs = StringIO()", " Java...
# Minimal Python Minimizer # Copyright 2008, Christopher Schmidt # Released under the MIT License # # Taken from: http://svn.crschmidt.net/personal/python/minimize.py # $Id: minimize.py 6 2008-01-03 06:33:35Z crschmidt $ # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software...
[ [ 1, 0, 0.5532, 0.0213, 0, 0.66, 0, 540, 0, 1, 0, 0, 540, 0, 0 ], [ 2, 0, 0.6277, 0.0851, 0, 0.66, 0.3333, 408, 0, 1, 1, 0, 0, 0, 2 ], [ 8, 1, 0.617, 0.0213, 1, 0.9...
[ "import re", "def strip_comments_helper(data):\n \"\"\"remove all /* */ format comments and surrounding whitespace.\"\"\"\n p = re.compile(r'[\\s]*/\\*.*?\\*/[\\s]*', re.DOTALL)\n return p.sub('',data)", " \"\"\"remove all /* */ format comments and surrounding whitespace.\"\"\"", " p = re.compi...
#!/usr/bin/env python """This is a blind proxy that we use to get around browser restrictions that prevent the Javascript from loading pages not on the same server as the Javascript. This has several problems: it's less efficient, it might break some sites, and it's a security risk because people can use this proxy ...
[ [ 1, 0, 0.25, 0.25, 0, 0.66, 0, 345, 0, 1, 0, 0, 345, 0, 0 ], [ 1, 0, 0.5, 0.25, 0, 0.66, 0.5, 934, 0, 1, 0, 0, 934, 0, 0 ], [ 1, 0, 0.75, 0.25, 0, 0.66, 1, ...
[ "import urllib2", "import cgi", "import sys, os" ]
#!/usr/bin/env python """This is a blind proxy that we use to get around browser restrictions that prevent the Javascript from loading pages not on the same server as the Javascript. This has several problems: it's less efficient, it might break some sites, and it's a security risk because people can use this proxy ...
[ [ 1, 0, 0.25, 0.25, 0, 0.66, 0, 345, 0, 1, 0, 0, 345, 0, 0 ], [ 1, 0, 0.5, 0.25, 0, 0.66, 0.5, 934, 0, 1, 0, 0, 934, 0, 0 ], [ 1, 0, 0.75, 0.25, 0, 0.66, 1, ...
[ "import urllib2", "import cgi", "import sys, os" ]
#!/usr/bin/python import httplib, urllib, sys import time # Define the parameters for the POST request and encode them in # a URL-safe format. def minimize(code): params = urllib.urlencode([ ('js_code', code), ('compilation_level', 'SIMPLE_OPTIMIZATIONS'), ('output_format', 'text'), ...
[ [ 1, 0, 0.1071, 0.0357, 0, 0.66, 0, 2, 0, 3, 0, 0, 2, 0, 0 ], [ 1, 0, 0.1429, 0.0357, 0, 0.66, 0.5, 654, 0, 1, 0, 0, 654, 0, 0 ], [ 2, 0, 0.6429, 0.75, 0, 0.66, ...
[ "import httplib, urllib, sys", "import time", "def minimize(code):\n\n params = urllib.urlencode([\n ('js_code', code),\n ('compilation_level', 'SIMPLE_OPTIMIZATIONS'),\n ('output_format', 'text'),\n ('output_info', 'compiled_code'),\n ])", " params = urllib.urlencode([\...
#!/usr/bin/python # This code is original from jsmin by Douglas Crockford, it was translated to # Python by Baruch Even. The original code had the following copyright and # license. # # /* jsmin.c # 2007-01-08 # # Copyright (c) 2002 Douglas Crockford (www.crockford.com) # # Permission is hereby granted, free of ch...
[ [ 1, 0, 0.1528, 0.0046, 0, 0.66, 0, 609, 0, 1, 0, 0, 609, 0, 0 ], [ 2, 0, 0.1782, 0.037, 0, 0.66, 0.1429, 275, 0, 1, 1, 0, 0, 0, 6 ], [ 14, 1, 0.1667, 0.0046, 1, 0....
[ "from StringIO import StringIO", "def jsmin(js):\n ins = StringIO(js)\n outs = StringIO()\n JavascriptMinify().minify(ins, outs)\n str = outs.getvalue()\n if len(str) > 0 and str[0] == '\\n':\n str = str[1:]\n return str", " ins = StringIO(js)", " outs = StringIO()", " Java...
#!/usr/bin/env python # # Script to provide a wrapper around the ShrinkSafe "web service" # <http://shrinksafe.dojotoolkit.org/> # # # We use this script for two reasons: # # * This avoids having to install and configure Java and the standalone # ShrinkSafe utility. # # * The current ShrinkSafe standalone utility...
[ [ 1, 0, 0.3148, 0.0185, 0, 0.66, 0, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.3519, 0.0185, 0, 0.66, 0.2, 614, 0, 1, 0, 0, 614, 0, 0 ], [ 1, 0, 0.3704, 0.0185, 0, 0.6...
[ "import sys", "import urllib", "import urllib2", "URL_SHRINK_SAFE = \"http://shrinksafe.dojotoolkit.org/shrinksafe.php\"", "BOUNDARY_MARKER = \"---------------------------72288400411964641492083565382\"", "if __name__ == \"__main__\":\n ## Grab the source code\n try:\n sourceFilename = sys.ar...
#!/usr/bin/env python # # Script to provide a wrapper around the ShrinkSafe "web service" # <http://shrinksafe.dojotoolkit.org/> # # # We use this script for two reasons: # # * This avoids having to install and configure Java and the standalone # ShrinkSafe utility. # # * The current ShrinkSafe standalone utility...
[ [ 1, 0, 0.3148, 0.0185, 0, 0.66, 0, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.3519, 0.0185, 0, 0.66, 0.2, 614, 0, 1, 0, 0, 614, 0, 0 ], [ 1, 0, 0.3704, 0.0185, 0, 0.6...
[ "import sys", "import urllib", "import urllib2", "URL_SHRINK_SAFE = \"http://shrinksafe.dojotoolkit.org/shrinksafe.php\"", "BOUNDARY_MARKER = \"---------------------------72288400411964641492083565382\"", "if __name__ == \"__main__\":\n ## Grab the source code\n try:\n sourceFilename = sys.ar...
# Copyright 2010 The Closure Library Authors. All Rights Reserved. # # 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/LICENSE-2.0 # # Unless required by a...
[ [ 8, 0, 0.2113, 0.0141, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.2394, 0.0141, 0, 0.66, 0.1429, 42, 0, 1, 0, 0, 42, 0, 0 ], [ 1, 0, 0.2535, 0.0141, 0, 0.66, ...
[ "\"\"\"Utility to use the Closure Compiler CLI from Python.\"\"\"", "import distutils.version", "import logging", "import re", "import subprocess", "_VERSION_REGEX = re.compile('\"([0-9][.0-9]*)')", "def _GetJavaVersion():\n \"\"\"Returns the string for the current version of Java installed.\"\"\"\n p...
import re import os def run(): sourceDirectory = "../lib/OpenLayers" allFiles = [] SUFFIX_JAVASCRIPT = ".js" ## Find all the Javascript source files for root, dirs, files in os.walk(sourceDirectory): for filename in files: if filename.endswith(SUFFIX_JAVASCRIPT) and not f...
[ [ 1, 0, 0.0455, 0.0455, 0, 0.66, 0, 540, 0, 1, 0, 0, 540, 0, 0 ], [ 1, 0, 0.0909, 0.0455, 0, 0.66, 0.5, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 2, 0, 0.5682, 0.9091, 0, 0.6...
[ "import re", "import os", "def run():\n sourceDirectory = \"../lib/OpenLayers\" \n allFiles = []\n SUFFIX_JAVASCRIPT = \".js\"\n ## Find all the Javascript source files\n for root, dirs, files in os.walk(sourceDirectory):\n for filename in files:\n if filename.endswith(SUFFIX...
#!/usr/bin/python import httplib, urllib, sys import time # Define the parameters for the POST request and encode them in # a URL-safe format. def minimize(code): params = urllib.urlencode([ ('js_code', code), ('compilation_level', 'SIMPLE_OPTIMIZATIONS'), ('output_format', 'text'), ...
[ [ 1, 0, 0.1071, 0.0357, 0, 0.66, 0, 2, 0, 3, 0, 0, 2, 0, 0 ], [ 1, 0, 0.1429, 0.0357, 0, 0.66, 0.5, 654, 0, 1, 0, 0, 654, 0, 0 ], [ 2, 0, 0.6429, 0.75, 0, 0.66, ...
[ "import httplib, urllib, sys", "import time", "def minimize(code):\n\n params = urllib.urlencode([\n ('js_code', code),\n ('compilation_level', 'SIMPLE_OPTIMIZATIONS'),\n ('output_format', 'text'),\n ('output_info', 'compiled_code'),\n ])", " params = urllib.urlencode([\...
""" toposort.py Sorts dictionary keys based on lists of dependencies. """ class MissingDependency(Exception): """Exception raised when a listed dependency is not in the dictionary.""" class Sorter(object): def __init__(self, dependencies): self.dependencies = dependencies self.visited = set() ...
[ [ 8, 0, 0.0714, 0.1143, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 3, 0, 0.1857, 0.0571, 0, 0.66, 0.3333, 635, 0, 0, 0, 0, 645, 0, 0 ], [ 8, 1, 0.2, 0.0286, 1, 0.88, ...
[ "\"\"\"\ntoposort.py\nSorts dictionary keys based on lists of dependencies.\n\"\"\"", "class MissingDependency(Exception):\n \"\"\"Exception raised when a listed dependency is not in the dictionary.\"\"\"", " \"\"\"Exception raised when a listed dependency is not in the dictionary.\"\"\"", "class Sorter...
#!/usr/bin/python # This code is original from jsmin by Douglas Crockford, it was translated to # Python by Baruch Even. The original code had the following copyright and # license. # # /* jsmin.c # 2007-01-08 # # Copyright (c) 2002 Douglas Crockford (www.crockford.com) # # Permission is hereby granted, free of ch...
[ [ 1, 0, 0.1528, 0.0046, 0, 0.66, 0, 609, 0, 1, 0, 0, 609, 0, 0 ], [ 2, 0, 0.1782, 0.037, 0, 0.66, 0.1429, 275, 0, 1, 1, 0, 0, 0, 6 ], [ 14, 1, 0.1667, 0.0046, 1, 0....
[ "from StringIO import StringIO", "def jsmin(js):\n ins = StringIO(js)\n outs = StringIO()\n JavascriptMinify().minify(ins, outs)\n str = outs.getvalue()\n if len(str) > 0 and str[0] == '\\n':\n str = str[1:]\n return str", " ins = StringIO(js)", " outs = StringIO()", " Java...
# Minimal Python Minimizer # Copyright 2008, Christopher Schmidt # Released under the MIT License # # Taken from: http://svn.crschmidt.net/personal/python/minimize.py # $Id: minimize.py 6 2008-01-03 06:33:35Z crschmidt $ # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software...
[ [ 1, 0, 0.5532, 0.0213, 0, 0.66, 0, 540, 0, 1, 0, 0, 540, 0, 0 ], [ 2, 0, 0.6277, 0.0851, 0, 0.66, 0.3333, 408, 0, 1, 1, 0, 0, 0, 2 ], [ 8, 1, 0.617, 0.0213, 1, 0.9...
[ "import re", "def strip_comments_helper(data):\n \"\"\"remove all /* */ format comments and surrounding whitespace.\"\"\"\n p = re.compile(r'[\\s]*/\\*.*?\\*/[\\s]*', re.DOTALL)\n return p.sub('',data)", " \"\"\"remove all /* */ format comments and surrounding whitespace.\"\"\"", " p = re.compi...
#!/usr/bin/env python """This is a blind proxy that we use to get around browser restrictions that prevent the Javascript from loading pages not on the same server as the Javascript. This has several problems: it's less efficient, it might break some sites, and it's a security risk because people can use this proxy ...
[ [ 1, 0, 0.25, 0.25, 0, 0.66, 0, 345, 0, 1, 0, 0, 345, 0, 0 ], [ 1, 0, 0.5, 0.25, 0, 0.66, 0.5, 934, 0, 1, 0, 0, 934, 0, 0 ], [ 1, 0, 0.75, 0.25, 0, 0.66, 1, ...
[ "import urllib2", "import cgi", "import sys, os" ]
#!/usr/bin/env python """This is a blind proxy that we use to get around browser restrictions that prevent the Javascript from loading pages not on the same server as the Javascript. This has several problems: it's less efficient, it might break some sites, and it's a security risk because people can use this proxy ...
[ [ 1, 0, 0.25, 0.25, 0, 0.66, 0, 345, 0, 1, 0, 0, 345, 0, 0 ], [ 1, 0, 0.5, 0.25, 0, 0.66, 0.5, 934, 0, 1, 0, 0, 934, 0, 0 ], [ 1, 0, 0.75, 0.25, 0, 0.66, 1, ...
[ "import urllib2", "import cgi", "import sys, os" ]
#!/usr/bin/env python import xml.dom.minidom import fcntl, time, sys from config import prefs class mydb: def __init__(self): self.active = [] self.update() def opendoc(self, lock=False): fd = open('db.xml', 'r+') if lock: fcntl.flock(fd, fcntl.LOCK_EX) da...
[ [ 1, 0, 0.0171, 0.0057, 0, 0.66, 0, 770, 0, 1, 0, 0, 770, 0, 0 ], [ 1, 0, 0.0229, 0.0057, 0, 0.66, 0.25, 488, 0, 3, 0, 0, 488, 0, 0 ], [ 1, 0, 0.0286, 0.0057, 0, 0....
[ "import xml.dom.minidom", "import fcntl, time, sys", "from config import prefs", "class mydb:\n def __init__(self):\n self.active = []\n self.update()\n\n\n def opendoc(self, lock=False):\n fd = open('db.xml', 'r+')", " def __init__(self):\n self.active = []\n sel...
#!/usr/bin/env python import re, os, time, sys from subprocess import PIPE from subprocess import Popen import subprocess from config import prefs if prefs['db_type'] == "xml": from xmldb import mydb else: from sql import mydb class backend: #clean up spacing so that tabs and multiple spaces and newlines...
[ [ 1, 0, 0.0124, 0.0041, 0, 0.66, 0, 540, 0, 4, 0, 0, 540, 0, 0 ], [ 1, 0, 0.0165, 0.0041, 0, 0.66, 0.1429, 394, 0, 1, 0, 0, 394, 0, 0 ], [ 1, 0, 0.0207, 0.0041, 0, ...
[ "import re, os, time, sys", "from subprocess import PIPE", "from subprocess import Popen", "import subprocess", "from config import prefs", "if prefs['db_type'] == \"xml\":\n from xmldb import mydb\nelse:\n from sql import mydb", " from xmldb import mydb", " from sql import mydb", "class...
#!/usr/bin/env python import time, sys from config import prefs #import the right database connection if prefs['db_type'] == 'mysql': import MySQLdb elif prefs['db_type'] == 'sqlite': from pysqlite2 import dbapi2 as sqlite #used by sqlite to make sure its in the same form as MySQLdb.cursors.DictCursor def d...
[ [ 1, 0, 0.0191, 0.0064, 0, 0.66, 0, 654, 0, 2, 0, 0, 654, 0, 0 ], [ 1, 0, 0.0255, 0.0064, 0, 0.66, 0.2, 308, 0, 1, 0, 0, 308, 0, 0 ], [ 4, 0, 0.0541, 0.0255, 0, 0.6...
[ "import time, sys", "from config import prefs", "if prefs['db_type'] == 'mysql':\n import MySQLdb\nelif prefs['db_type'] == 'sqlite':\n from pysqlite2 import dbapi2 as sqlite", " import MySQLdb", "elif prefs['db_type'] == 'sqlite':\n from pysqlite2 import dbapi2 as sqlite", " from pysqlite2...
#!/usr/bin/env python import ConfigParser, os #load database connection info config = ConfigParser.ConfigParser() config.readfp(open('../config.ini')) prefs = {} prefs['db_type'] = config.get('db','type') if prefs['db_type'] == 'mysql': prefs['db_host'] = config.get('db','host') prefs['db_user'] = config.get...
[ [ 1, 0, 0.0938, 0.0312, 0, 0.66, 0, 272, 0, 2, 0, 0, 272, 0, 0 ], [ 14, 0, 0.1875, 0.0312, 0, 0.66, 0.0588, 308, 3, 0, 0, 0, 272, 10, 1 ], [ 8, 0, 0.2188, 0.0312, 0, ...
[ "import ConfigParser, os", "config = ConfigParser.ConfigParser()", "config.readfp(open('../config.ini'))", "prefs = {}", "prefs['db_type'] = config.get('db','type')", "if prefs['db_type'] == 'mysql':\n prefs['db_host'] = config.get('db','host')\n prefs['db_user'] = config.get('db','user')\n prefs...
#!/usr/bin/env python import time, sys from config import prefs #import the right database connection if prefs['db_type'] == 'mysql': import MySQLdb elif prefs['db_type'] == 'sqlite': from pysqlite2 import dbapi2 as sqlite #used by sqlite to make sure its in the same form as MySQLdb.cursors.DictCursor def d...
[ [ 1, 0, 0.0191, 0.0064, 0, 0.66, 0, 654, 0, 2, 0, 0, 654, 0, 0 ], [ 1, 0, 0.0255, 0.0064, 0, 0.66, 0.2, 308, 0, 1, 0, 0, 308, 0, 0 ], [ 4, 0, 0.0541, 0.0255, 0, 0.6...
[ "import time, sys", "from config import prefs", "if prefs['db_type'] == 'mysql':\n import MySQLdb\nelif prefs['db_type'] == 'sqlite':\n from pysqlite2 import dbapi2 as sqlite", " import MySQLdb", "elif prefs['db_type'] == 'sqlite':\n from pysqlite2 import dbapi2 as sqlite", " from pysqlite2...
#!/usr/bin/env python import re, os, time, sys from subprocess import PIPE from subprocess import Popen import subprocess from config import prefs if prefs['db_type'] == "xml": from xmldb import mydb else: from sql import mydb class backend: #clean up spacing so that tabs and multiple spaces and newlines...
[ [ 1, 0, 0.0124, 0.0041, 0, 0.66, 0, 540, 0, 4, 0, 0, 540, 0, 0 ], [ 1, 0, 0.0165, 0.0041, 0, 0.66, 0.1429, 394, 0, 1, 0, 0, 394, 0, 0 ], [ 1, 0, 0.0207, 0.0041, 0, ...
[ "import re, os, time, sys", "from subprocess import PIPE", "from subprocess import Popen", "import subprocess", "from config import prefs", "if prefs['db_type'] == \"xml\":\n from xmldb import mydb\nelse:\n from sql import mydb", " from xmldb import mydb", " from sql import mydb", "class...
#!/usr/bin/env python import xml.dom.minidom import fcntl, time, sys from config import prefs class mydb: def __init__(self): self.active = [] self.update() def opendoc(self, lock=False): fd = open('db.xml', 'r+') if lock: fcntl.flock(fd, fcntl.LOCK_EX) da...
[ [ 1, 0, 0.0171, 0.0057, 0, 0.66, 0, 770, 0, 1, 0, 0, 770, 0, 0 ], [ 1, 0, 0.0229, 0.0057, 0, 0.66, 0.25, 488, 0, 3, 0, 0, 488, 0, 0 ], [ 1, 0, 0.0286, 0.0057, 0, 0....
[ "import xml.dom.minidom", "import fcntl, time, sys", "from config import prefs", "class mydb:\n def __init__(self):\n self.active = []\n self.update()\n\n\n def opendoc(self, lock=False):\n fd = open('db.xml', 'r+')", " def __init__(self):\n self.active = []\n sel...
#!/usr/bin/env python import ConfigParser, os #load database connection info config = ConfigParser.ConfigParser() config.readfp(open('../config.ini')) prefs = {} prefs['db_type'] = config.get('db','type') if prefs['db_type'] == 'mysql': prefs['db_host'] = config.get('db','host') prefs['db_user'] = config.get...
[ [ 1, 0, 0.0938, 0.0312, 0, 0.66, 0, 272, 0, 2, 0, 0, 272, 0, 0 ], [ 14, 0, 0.1875, 0.0312, 0, 0.66, 0.0588, 308, 3, 0, 0, 0, 272, 10, 1 ], [ 8, 0, 0.2188, 0.0312, 0, ...
[ "import ConfigParser, os", "config = ConfigParser.ConfigParser()", "config.readfp(open('../config.ini'))", "prefs = {}", "prefs['db_type'] = config.get('db','type')", "if prefs['db_type'] == 'mysql':\n prefs['db_host'] = config.get('db','host')\n prefs['db_user'] = config.get('db','user')\n prefs...
# -*- encoding: utf-8 -*- """Modulo para manejo de fichas""" import pygame from pygame.sprite import Sprite from config import PIECE_POSITIONS, THEME from common import load_image import states NORMAL, OVER, DRAG = 0, 1, 2 class Checker(Sprite): """Representa una pieza del juego. Interactúa con el objeto Mou...
[ [ 8, 0, 0.0156, 0.0078, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.0234, 0.0078, 0, 0.66, 0.1429, 87, 0, 1, 0, 0, 87, 0, 0 ], [ 1, 0, 0.0312, 0.0078, 0, 0.66, ...
[ "\"\"\"Modulo para manejo de fichas\"\"\"", "import pygame", "from pygame.sprite import Sprite", "from config import PIECE_POSITIONS, THEME", "from common import load_image", "import states", "NORMAL, OVER, DRAG = 0, 1, 2", "class Checker(Sprite):\n \"\"\"Representa una pieza del juego.\n\n Inte...
# -*- encoding: utf-8 -*- import pygame import scene import sys from config import * from pygame.locals import * import game import options import about import help class Menu(scene.Scene): def __init__(self, world, initial_position=0): self.opciones = opciones = [ ("Jugar", self.jugar), ...
[ [ 1, 0, 0.028, 0.0093, 0, 0.66, 0, 87, 0, 1, 0, 0, 87, 0, 0 ], [ 1, 0, 0.0374, 0.0093, 0, 0.66, 0.1111, 766, 0, 1, 0, 0, 766, 0, 0 ], [ 1, 0, 0.0467, 0.0093, 0, 0.6...
[ "import pygame", "import scene", "import sys", "from config import *", "from pygame.locals import *", "import game", "import options", "import about", "import help", "class Menu(scene.Scene):\n\n def __init__(self, world, initial_position=0):\n\n self.opciones = opciones = [\n ...
import pygame class Group(pygame.sprite.OrderedUpdates): def __init__(self, *s): pygame.sprite.OrderedUpdates.__init__(self, *s) def add_mouse(self, mouse): self.mouse = mouse self.add(mouse) def set_mouse_on_top(self): self.remove(self.mouse) self.add(self.mouse)...
[ [ 1, 0, 0.0714, 0.0714, 0, 0.66, 0, 87, 0, 1, 0, 0, 87, 0, 0 ], [ 3, 0, 0.6071, 0.8571, 0, 0.66, 1, 536, 0, 3, 0, 0, 496, 0, 4 ], [ 2, 1, 0.3929, 0.1429, 1, 0.33, ...
[ "import pygame", "class Group(pygame.sprite.OrderedUpdates):\n\n def __init__(self, *s):\n pygame.sprite.OrderedUpdates.__init__(self, *s)\n\n def add_mouse(self, mouse):\n self.mouse = mouse\n self.add(mouse)", " def __init__(self, *s):\n pygame.sprite.OrderedUpdates.__init...
# -*- encoding: utf-8 -*- """Modulo para manejo de fichas reina""" from checker import Checker import common from config import * class King(Checker): """Representa una pieza reina del juego. Realiza un comportamiento similar a Checker, solo que las finas dama pueden avanzar varios casilleros a la vez. ...
[ [ 8, 0, 0.0625, 0.0312, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.0938, 0.0312, 0, 0.66, 0.25, 279, 0, 1, 0, 0, 279, 0, 0 ], [ 1, 0, 0.125, 0.0312, 0, 0.66, ...
[ "\"\"\"Modulo para manejo de fichas reina\"\"\"", "from checker import Checker", "import common", "from config import *", "class King(Checker):\n \"\"\"Representa una pieza reina del juego.\n\n Realiza un comportamiento similar a Checker, solo que las\n finas dama pueden avanzar varios casilleros a...
#!/usr/bin/python # -*- encoding: utf-8 -*- from world import * import menu def main(): world = World(do_center_window=True) world.change_scene(menu.Menu(world)) world.loop() if __name__ == '__main__': main()
[ [ 1, 0, 0.25, 0.0833, 0, 0.66, 0, 939, 0, 1, 0, 0, 939, 0, 0 ], [ 1, 0, 0.3333, 0.0833, 0, 0.66, 0.3333, 671, 0, 1, 0, 0, 671, 0, 0 ], [ 2, 0, 0.625, 0.3333, 0, 0.6...
[ "from world import *", "import menu", "def main():\n world = World(do_center_window=True)\n world.change_scene(menu.Menu(world))\n world.loop()", " world = World(do_center_window=True)", " world.change_scene(menu.Menu(world))", " world.loop()", "if __name__ == '__main__':\n main()",...
#!/usr/bin/python # -*- encoding: utf-8 -*- from world import * import menu def main(): world = World(do_center_window=True) world.change_scene(menu.Menu(world)) world.loop() if __name__ == '__main__': main()
[ [ 1, 0, 0.25, 0.0833, 0, 0.66, 0, 939, 0, 1, 0, 0, 939, 0, 0 ], [ 1, 0, 0.3333, 0.0833, 0, 0.66, 0.3333, 671, 0, 1, 0, 0, 671, 0, 0 ], [ 2, 0, 0.625, 0.3333, 0, 0.6...
[ "from world import *", "import menu", "def main():\n world = World(do_center_window=True)\n world.change_scene(menu.Menu(world))\n world.loop()", " world = World(do_center_window=True)", " world.change_scene(menu.Menu(world))", " world.loop()", "if __name__ == '__main__':\n main()",...
# -*- encoding: utf-8 -*- PIECE1 = 'p1.png' PIECE2 = 'p2.png' TABLE = 'table.png' THEME = 'classic' WINDOW_TITLE = 'Another Checkers Game - beta' WINDOW_SIZE = (640, 480) MOTION_STEPS = 4.0 MENU_IMAGE = "ima/menu.png" MENU_FONT = "font/DejaVuSans.ttf" MENU_FONT_SIZE = 18 KEY_SOUND = "sounds/tecla.wav" PIECE_POSITIONS ...
[ [ 14, 0, 0.0426, 0.0213, 0, 0.66, 0, 241, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.0638, 0.0213, 0, 0.66, 0.0909, 454, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.0851, 0.0213, 0, 0...
[ "PIECE1 = 'p1.png'", "PIECE2 = 'p2.png'", "TABLE = 'table.png'", "THEME = 'classic'", "WINDOW_TITLE = 'Another Checkers Game - beta'", "WINDOW_SIZE = (640, 480)", "MOTION_STEPS = 4.0", "MENU_IMAGE = \"ima/menu.png\"", "MENU_FONT = \"font/DejaVuSans.ttf\"", "MENU_FONT_SIZE = 18", "KEY_SOUND = \"s...
class Scene: def __init__(self, world): self.world = world def update(self): pass def draw(self, screen): pass def on_event(self, event): pass
[ [ 3, 0, 0.5385, 1, 0, 0.66, 0, 581, 0, 4, 0, 0, 0, 0, 0 ], [ 2, 1, 0.2692, 0.1538, 1, 0.85, 0, 555, 0, 2, 0, 0, 0, 0, 0 ], [ 14, 2, 0.3077, 0.0769, 2, 0.86, 0, ...
[ "class Scene:\n\n def __init__(self, world):\n self.world = world\n\n def update(self):\n pass", " def __init__(self, world):\n self.world = world", " self.world = world", " def update(self):\n pass", " def draw(self, screen):\n pass", " def on_e...
#!/usr/bin/python # # made: http://www.websequencediagrams.com/embedding.html # # minor changes by Hugo Ruscitti import urllib import os import re import sys def getSequenceDiagram( text, outputFile, style = 'default' ): request = {} request["message"] = text request["style"] = style url = urllib.url...
[ [ 1, 0, 0.1, 0.0167, 0, 0.66, 0, 614, 0, 1, 0, 0, 614, 0, 0 ], [ 1, 0, 0.1167, 0.0167, 0, 0.66, 0.0625, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.1333, 0.0167, 0, 0.6...
[ "import urllib", "import os", "import re", "import sys", "def getSequenceDiagram( text, outputFile, style = 'default' ):\n request = {}\n request[\"message\"] = text\n request[\"style\"] = style\n\n url = urllib.urlencode(request)\n\n f = urllib.urlopen(\"http://www.websequencediagrams.com/\"...
#!/usr/bin/python # # made: http://www.websequencediagrams.com/embedding.html # # minor changes by Hugo Ruscitti import urllib import os import re import sys def getSequenceDiagram( text, outputFile, style = 'default' ): request = {} request["message"] = text request["style"] = style url = urllib.url...
[ [ 1, 0, 0.1, 0.0167, 0, 0.66, 0, 614, 0, 1, 0, 0, 614, 0, 0 ], [ 1, 0, 0.1167, 0.0167, 0, 0.66, 0.0625, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.1333, 0.0167, 0, 0.6...
[ "import urllib", "import os", "import re", "import sys", "def getSequenceDiagram( text, outputFile, style = 'default' ):\n request = {}\n request[\"message\"] = text\n request[\"style\"] = style\n\n url = urllib.urlencode(request)\n\n f = urllib.urlopen(\"http://www.websequencediagrams.com/\"...
# -*- coding: utf-8 -*- """ Manejo de los botones del juego""" import pygame from pygame.sprite import Sprite import common class Button(Sprite): """Clase para manejo de botones """ def __init__(self, label, font, pos_x, pos_y, callback): Sprite.__init__(self) self.glass_image = None se...
[ [ 8, 0, 0.0282, 0.0141, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.0423, 0.0141, 0, 0.66, 0.25, 87, 0, 1, 0, 0, 87, 0, 0 ], [ 1, 0, 0.0563, 0.0141, 0, 0.66, ...
[ "\"\"\" Manejo de los botones del juego\"\"\"", "import pygame", "from pygame.sprite import Sprite", "import common", "class Button(Sprite):\n \"\"\"Clase para manejo de botones \"\"\"\n def __init__(self, label, font, pos_x, pos_y, callback):\n Sprite.__init__(self)\n self.glass_image =...
# -*- coding: utf-8 -*- import common import pygame from pygame.sprite import Sprite from pygame import MOUSEBUTTONUP, MOUSEBUTTONDOWN, MOUSEMOTION, ACTIVEEVENT class Mouse(Sprite): """Representa al puntero del mouse, conoce todos los elementos de la interfaz y administrar las funcionalidades de 'arrastrar...
[ [ 1, 0, 0.0198, 0.0099, 0, 0.66, 0, 718, 0, 1, 0, 0, 718, 0, 0 ], [ 1, 0, 0.0297, 0.0099, 0, 0.66, 0.25, 87, 0, 1, 0, 0, 87, 0, 0 ], [ 1, 0, 0.0396, 0.0099, 0, 0.66...
[ "import common", "import pygame", "from pygame.sprite import Sprite", "from pygame import MOUSEBUTTONUP, MOUSEBUTTONDOWN, MOUSEMOTION, ACTIVEEVENT", "class Mouse(Sprite):\n \"\"\"Representa al puntero del mouse, conoce todos los elementos\n de la interfaz y administrar las funcionalidades de\n 'arr...
# -*- coding: utf-8 -*- """Administrador de GUI""" from pygame.sprite import Group class Gui(Group): """Administra todos los componentes de la interfaz. Gui recibe consultas y órdenes directamente desde el objeto Mouse.""" def __init__(self): Group.__init__(self) def add_widgets(self, wi...
[ [ 8, 0, 0.0392, 0.0196, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.0588, 0.0196, 0, 0.66, 0.3333, 215, 0, 1, 0, 0, 215, 0, 0 ], [ 3, 0, 0.4804, 0.7843, 0, 0.66...
[ "\"\"\"Administrador de GUI\"\"\"", "from pygame.sprite import Group", "class Gui(Group):\n \"\"\"Administra todos los componentes de la interfaz.\n\n Gui recibe consultas y órdenes directamente desde el objeto\n Mouse.\"\"\"\n\n def __init__(self):\n Group.__init__(self)", " \"\"\"Admin...
# -*- coding: utf-8 -*- """Modulo para manejor de turnos""" import pygame from pygame.sprite import Sprite import common from config import THEME class Turn(Sprite): """Representa un visor de turnos, indicando que jugador debe mover la siguiente pieza del juego.""" def __init__(self): Sprite.__ini...
[ [ 8, 0, 0.04, 0.02, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.06, 0.02, 0, 0.66, 0.2, 87, 0, 1, 0, 0, 87, 0, 0 ], [ 1, 0, 0.08, 0.02, 0, 0.66, 0.4, 21...
[ "\"\"\"Modulo para manejor de turnos\"\"\"", "import pygame", "from pygame.sprite import Sprite", "import common", "from config import THEME", "class Turn(Sprite):\n \"\"\"Representa un visor de turnos, indicando que jugador debe mover la\n siguiente pieza del juego.\"\"\"\n\n def __init__(self):...
from gui import Gui from mouse import Mouse from button import Button from turn import Turn
[ [ 1, 0, 0.25, 0.25, 0, 0.66, 0, 22, 0, 1, 0, 0, 22, 0, 0 ], [ 1, 0, 0.5, 0.25, 0, 0.66, 0.3333, 273, 0, 1, 0, 0, 273, 0, 0 ], [ 1, 0, 0.75, 0.25, 0, 0.66, 0.666...
[ "from gui import Gui", "from mouse import Mouse", "from button import Button", "from turn import Turn" ]
# -*- encoding: utf-8 -*- import common from config import PIECE_POSITIONS import pygame class State(object): """Representa un estado de comportamiento de Checker.""" def update(self): pass class Starting(State): """Realiza el efecto de interpolacion al iniciar el juego""" def __init__(self...
[ [ 1, 0, 0.0194, 0.0097, 0, 0.66, 0, 718, 0, 1, 0, 0, 718, 0, 0 ], [ 1, 0, 0.0291, 0.0097, 0, 0.66, 0.125, 308, 0, 1, 0, 0, 308, 0, 0 ], [ 1, 0, 0.0388, 0.0097, 0, 0...
[ "import common", "from config import PIECE_POSITIONS", "import pygame", "class State(object):\n \"\"\"Representa un estado de comportamiento de Checker.\"\"\"\n\n def update(self):\n pass", " \"\"\"Representa un estado de comportamiento de Checker.\"\"\"", " def update(self):\n p...
# -*- encoding: utf-8 -*- import pygame import scene from config import * from pygame.locals import * import menu class Help(scene.Scene): def __init__(self, world): scene.Scene.__init__(self, world) self.background = pygame.image.load("ima/help.png") def update(self): pass def ...
[ [ 1, 0, 0.0833, 0.0417, 0, 0.66, 0, 87, 0, 1, 0, 0, 87, 0, 0 ], [ 1, 0, 0.125, 0.0417, 0, 0.66, 0.2, 766, 0, 1, 0, 0, 766, 0, 0 ], [ 1, 0, 0.1667, 0.0417, 0, 0.66, ...
[ "import pygame", "import scene", "from config import *", "from pygame.locals import *", "import menu", "class Help(scene.Scene):\n\n def __init__(self, world):\n scene.Scene.__init__(self, world)\n self.background = pygame.image.load(\"ima/help.png\")\n\n def update(self):\n pa...
# -*- encoding: utf-8 -- """ Funciones comunes""" import pygame, pygame.font, pygame.event, pygame.draw, string from pygame.locals import MOUSEBUTTONDOWN, MOUSEBUTTONUP from pygame.locals import MOUSEMOTION, ACTIVEEVENT from pygame.locals import K_MINUS , K_RETURN, K_BACKSPACE, KEYDOWN, K_ESCAPE MOUSE_EVENTS = [MOU...
[ [ 8, 0, 0.0233, 0.0116, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.0465, 0.0116, 0, 0.66, 0.0909, 87, 0, 5, 0, 0, 87, 0, 0 ], [ 1, 0, 0.0698, 0.0116, 0, 0.66, ...
[ "\"\"\" Funciones comunes\"\"\"", "import pygame, pygame.font, pygame.event, pygame.draw, string", "from pygame.locals import MOUSEBUTTONDOWN, MOUSEBUTTONUP", "from pygame.locals import MOUSEMOTION, ACTIVEEVENT", "from pygame.locals import K_MINUS , K_RETURN, K_BACKSPACE, KEYDOWN, K_ESCAPE", "MOUSE_EVENTS...
# -*- encoding: utf-8 -*- import pygame import scene from config import * from pygame.locals import * import common import menu class Options(scene.Scene): def __init__(self, world): scene.Scene.__init__(self, world) self.background = pygame.image.load("ima/options.png") def update(self): ...
[ [ 1, 0, 0.08, 0.04, 0, 0.66, 0, 87, 0, 1, 0, 0, 87, 0, 0 ], [ 1, 0, 0.12, 0.04, 0, 0.66, 0.1667, 766, 0, 1, 0, 0, 766, 0, 0 ], [ 1, 0, 0.16, 0.04, 0, 0.66, 0.33...
[ "import pygame", "import scene", "from config import *", "from pygame.locals import *", "import common", "import menu", "class Options(scene.Scene):\n\n def __init__(self, world):\n scene.Scene.__init__(self, world)\n self.background = pygame.image.load(\"ima/options.png\")\n\n def u...
# -*- encoding: utf-8 -*- import pygame import scene from config import * from pygame.locals import * import menu class About(scene.Scene): def __init__(self, world): scene.Scene.__init__(self, world) self.background = pygame.image.load("ima/about.png") def update(self): pass de...
[ [ 1, 0, 0.0833, 0.0417, 0, 0.66, 0, 87, 0, 1, 0, 0, 87, 0, 0 ], [ 1, 0, 0.125, 0.0417, 0, 0.66, 0.2, 766, 0, 1, 0, 0, 766, 0, 0 ], [ 1, 0, 0.1667, 0.0417, 0, 0.66, ...
[ "import pygame", "import scene", "from config import *", "from pygame.locals import *", "import menu", "class About(scene.Scene):\n\n def __init__(self, world):\n scene.Scene.__init__(self, world)\n self.background = pygame.image.load(\"ima/about.png\")\n\n def update(self):\n ...
""" Modulo para manejo del tablero """ import pygame import gui from table import Table import common from config import * import os, re import group class World(object): """Representa el objeto principal del juego. Su responsabilidad es asegurar la velocidad constante del juego y propagar eventos.""" ...
[ [ 8, 0, 0.0152, 0.0152, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.0303, 0.0152, 0, 0.66, 0.125, 87, 0, 1, 0, 0, 87, 0, 0 ], [ 1, 0, 0.0455, 0.0152, 0, 0.66, ...
[ "\"\"\" Modulo para manejo del tablero \"\"\"", "import pygame", "import gui", "from table import Table", "import common", "from config import *", "import os, re", "import group", "class World(object):\n \"\"\"Representa el objeto principal del juego.\n\n Su responsabilidad es asegurar la velo...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ This file is part of the web2py Web Framework Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu> License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html) This is a WSGI handler for Apache Requires apache+mod_wsgi. In httpd.conf put something like: LoadMo...
[ [ 8, 0, 0.2619, 0.3571, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.5, 0.0238, 0, 0.66, 0.1, 136, 1, 0, 0, 0, 0, 4, 0 ], [ 14, 0, 0.5238, 0.0238, 0, 0.66, ...
[ "\"\"\"\nThis file is part of the web2py Web Framework\nCopyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu>\nLicense: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)\n\n\nThis is a WSGI handler for Apache\nRequires apache+mod_wsgi.", "LOGGING = False", "SOFTCRON = False", "import sys", "import os", ...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ This file is part of the web2py Web Framework Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu> License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html) This is a handler for lighttpd+fastcgi This file has to be in the PYTHONPATH Put something like this in the...
[ [ 8, 0, 0.2925, 0.4528, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.5472, 0.0189, 0, 0.66, 0.0833, 136, 1, 0, 0, 0, 0, 4, 0 ], [ 14, 0, 0.566, 0.0189, 0, 0.66,...
[ "\"\"\"\nThis file is part of the web2py Web Framework\nCopyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu>\nLicense: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)\n\nThis is a handler for lighttpd+fastcgi\nThis file has to be in the PYTHONPATH\nPut something like this in the lighttpd.conf file:", "LOGGIN...
#!/usr/bin/python # -*- coding: utf-8 -*- # when web2py is run as a windows service (web2py.exe -W) # it does not load the command line options but it # expects to find conifguration settings in a file called # # web2py/options.py # # this file is an example for options.py import socket import os ip = '0.0.0.0' po...
[ [ 1, 0, 0.3636, 0.0303, 0, 0.66, 0, 687, 0, 1, 0, 0, 687, 0, 0 ], [ 1, 0, 0.3939, 0.0303, 0, 0.66, 0.0588, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 14, 0, 0.4545, 0.0303, 0, ...
[ "import socket", "import os", "ip = '0.0.0.0'", "port = 80", "interfaces=[('0.0.0.0',80),('0.0.0.0',443,'ssl_private_key.pem','ssl_certificate.pem')]", "password = '<recycle>' # ## <recycle> means use the previous password", "pid_filename = 'httpserver.pid'", "log_filename = 'httpserver.log'", "pro...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ This file is part of the web2py Web Framework Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu> License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html) This file is based, althought a rewrite, on MIT code from the Bottle web framework. """ import os, sys, op...
[ [ 8, 0, 0.0409, 0.0409, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.0702, 0.0058, 0, 0.66, 0.1111, 688, 0, 3, 0, 0, 688, 0, 0 ], [ 14, 0, 0.076, 0.0058, 0, 0.66...
[ "\"\"\"\nThis file is part of the web2py Web Framework\nCopyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu>\nLicense: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)\n\nThis file is based, althought a rewrite, on MIT code from the Bottle web framework.\n\"\"\"", "import os, sys, optparse", "path = os.path...