code stringlengths 1 1.49M | vector listlengths 0 7.38k | snippet listlengths 0 7.38k |
|---|---|---|
#!/usr/bin/env python
import sys
from distutils.core import setup
required = []
setup(
name='google-docs-fs',
version='1.0rc2',
description='Treat Google Docs as a local file system',
author='Scott Walton',
author_email='d38dm8nw81k1ng@gmail.com',
license='GPLv2',
url='http://code.google.... | [
[
1,
0,
0.1579,
0.0526,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.2105,
0.0526,
0,
0.66,
0.3333,
152,
0,
1,
0,
0,
152,
0,
0
],
[
14,
0,
0.3158,
0.0526,
0,
... | [
"import sys",
"from distutils.core import setup",
"required = []",
"setup(\n name='google-docs-fs',\n version='1.0rc2',\n description='Treat Google Docs as a local file system',\n author='Scott Walton',\n author_email='d38dm8nw81k1ng@gmail.com',\n license='GPLv2',\n url='http://code.googl... |
#!/usr/bin/env python
import sys
import os
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
from googledocsfs import gFile
gFile.main()
| [
[
1,
0,
0.2857,
0.1429,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.4286,
0.1429,
0,
0.66,
0.25,
688,
0,
1,
0,
0,
688,
0,
0
],
[
8,
0,
0.5714,
0.1429,
0,
0.... | [
"import sys",
"import os",
"sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))",
"from googledocsfs import gFile",
"gFile.main()"
] |
#!/usr/bin/env python
#
# gNet.py
#
# Copyright 2009 Scott C. Walton <d38dm8nw81k1ng@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License (version 2), as
# published by the Free Software Foundation
#
# This program is dist... | [
[
1,
0,
0.0764,
0.0036,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.08,
0.0036,
0,
0.66,
0.1667,
617,
0,
1,
0,
0,
617,
0,
0
],
[
1,
0,
0.0836,
0.0036,
0,
0.... | [
"import os",
"import gdata.docs.service",
"import gdata.docs",
"from gdata import MediaSource",
"class GNet(object):\n \"\"\"\n Performs all the main interfacing with Google Docs server as well\n as storing the user's session data\n \"\"\"\n\n def __init__(self, em, pw):\n \"\"\"",
"... |
#!/usr/bin/env python
'''
Map Genearator Source Code
Ripped from MUDServ to avoid writing a dungeon generator in Erlang for 7DRL 2011
'''
import sys
import json
import mutex
import math
from random import *
from ConfigParser import *
from time import sleep
__version__ = '0.1'
__author__ = 'Ian Wagner and Mic... | [
[
8,
0,
0.0066,
0.0059,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0118,
0.0015,
0,
0.66,
0.0286,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0133,
0.0015,
0,
0.66... | [
"'''\n Map Genearator Source Code\n Ripped from MUDServ to avoid writing a dungeon generator in Erlang for 7DRL 2011\n'''",
"import sys",
"import json",
"import mutex",
"import math",
"from random import *",
"from ConfigParser import *",
"from time import sleep",
"__version__ = '0.1'",
"__au... |
'''
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.53,
... | [
"'''\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... |
# Copyright 2014 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 applicable law or... | [
[
1,
0,
0.0055,
0.0055,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0109,
0.0055,
0,
0.66,
0.0625,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0164,
0.0055,
0,
... | [
"import os",
"import sys",
"from tarfile import TarFile, TarInfo",
"from matplotlib import pylab as pl",
"import numpy as n",
"import getopt as opt",
"from python_util.util import *",
"from math import sqrt, ceil, floor",
"from python_util.gpumodel import IGPUModel",
"import random as r",
"impor... |
# Copyright 2014 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 applicable law or... | [
[
1,
0,
0.121,
0.0064,
0,
0.66,
0,
223,
0,
1,
0,
0,
223,
0,
0
],
[
1,
0,
0.1274,
0.0064,
0,
0.66,
0.0417,
609,
0,
1,
0,
0,
609,
0,
0
],
[
1,
0,
0.1338,
0.0064,
0,
0... | [
"import tarfile",
"from StringIO import StringIO",
"from random import shuffle",
"import sys",
"from time import time",
"from pyext._MakeDataPyExt import resizeJPEG",
"import itertools",
"import os",
"import cPickle",
"import scipy.io",
"import math",
"import argparse as argp",
"CROP_TO_SQUA... |
# Copyright 2014 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 applicable law or... | [] | [] |
# Copyright 2014 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 applicable law or... | [
[
1,
0,
0.2778,
0.0185,
0,
0.66,
0,
658,
0,
1,
0,
0,
658,
0,
0
],
[
1,
0,
0.2963,
0.0185,
0,
0.66,
0.1111,
954,
0,
1,
0,
0,
954,
0,
0
],
[
1,
0,
0.3148,
0.0185,
0,
... | [
"from python_util.gpumodel import *",
"import numpy as n",
"import numpy.random as nr",
"def get_src(filename):\n src = IGPUModel.load_checkpoint(filename)\n return src['model_state']['layers']",
" src = IGPUModel.load_checkpoint(filename)",
" return src['model_state']['layers']",
"def makew... |
# Copyright 2014 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 applicable law or... | [
[
1,
0,
0.0519,
0.0035,
0,
0.66,
0,
954,
0,
1,
0,
0,
954,
0,
0
],
[
1,
0,
0.0554,
0.0035,
0,
0.66,
0.05,
181,
0,
1,
0,
0,
181,
0,
0
],
[
1,
0,
0.0588,
0.0035,
0,
0.... | [
"import numpy as n",
"import numpy.random as nr",
"import random as r",
"from python_util.util import *",
"from python_util.data import *",
"from python_util.options import *",
"from python_util.gpumodel import *",
"import sys",
"import math as m",
"import layer as lay",
"from convdata import Im... |
# Copyright 2014 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 applicable law or... | [
[
1,
0,
0.0515,
0.0034,
0,
0.66,
0,
260,
0,
1,
0,
0,
260,
0,
0
],
[
1,
0,
0.055,
0.0034,
0,
0.66,
0.0625,
181,
0,
1,
0,
0,
181,
0,
0
],
[
1,
0,
0.0584,
0.0034,
0,
0... | [
"from python_util.data import *",
"import numpy.random as nr",
"import numpy as n",
"import random as r",
"from time import time",
"from threading import Thread",
"from math import sqrt",
"import sys",
"from PIL import Image",
"from StringIO import StringIO",
"from time import time",
"import i... |
# Copyright 2014 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 applicable law or... | [
[
1,
0,
0.0773,
0.0052,
0,
0.66,
0,
954,
0,
1,
0,
0,
954,
0,
0
],
[
1,
0,
0.0825,
0.0052,
0,
0.66,
0.0769,
181,
0,
3,
0,
0,
181,
0,
0
],
[
1,
0,
0.0876,
0.0052,
0,
... | [
"import numpy as n",
"from numpy.random import randn, rand, random_integers",
"import os",
"from threading import Thread",
"from util import *",
"BATCH_META_FILE = \"batches.meta\"",
"class DataLoaderThread(Thread):\n def __init__(self, path, tgt):\n Thread.__init__(self)\n self.path = ... |
# Copyright 2014 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 applicable law or... | [
[
1,
0,
0.1596,
0.0106,
0,
0.66,
0,
540,
0,
1,
0,
0,
540,
0,
0
],
[
1,
0,
0.1702,
0.0106,
0,
0.66,
0.0714,
279,
0,
1,
0,
0,
279,
0,
0
],
[
1,
0,
0.1809,
0.0106,
0,
... | [
"import re",
"import cPickle",
"import os",
"from cStringIO import StringIO",
"class UnpickleError(Exception):\n pass",
"GPU_LOCK_NO_SCRIPT = -2",
"GPU_LOCK_NO_LOCK = -1",
"def pickle(filename, data):\n fo = filename\n if type(filename) == str:\n fo = open(filename, \"w\")\n \n c... |
# Copyright 2014 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 applicable law or... | [] | [] |
#!/usr/bin/python
# Filename:altman.py
from com.android.monkeyrunner import MonkeyRunner,MonkeyDevice,MonkeyImage
import sys,os
ACTION_DOWN = 1
ACTION_UP = 0
ACTION_MOVE = 2
file_handle = None
#log_content = ""
download_log_command = "adb pull /sdcard/altman.log ."
#sets a variable with the package's internal
pac... | [
[
1,
0,
0.0336,
0.0067,
0,
0.66,
0,
719,
0,
3,
0,
0,
719,
0,
0
],
[
1,
0,
0.0403,
0.0067,
0,
0.66,
0.0667,
509,
0,
2,
0,
0,
509,
0,
0
],
[
14,
0,
0.0537,
0.0067,
0,
... | [
"from com.android.monkeyrunner import MonkeyRunner,MonkeyDevice,MonkeyImage",
"import sys,os",
"ACTION_DOWN = 1",
"ACTION_UP = 0",
"ACTION_MOVE = 2",
"file_handle = None",
"download_log_command = \"adb pull /sdcard/altman.log .\"",
"package = 'com.taobao.taobao'",
"mainActivity = 'com.taobao.tao.Wel... |
#!/usr/bin/python
# Filename:altman.py
from com.android.monkeyrunner import MonkeyRunner,MonkeyDevice,MonkeyImage
import sys,os
ACTION_DOWN = 1
ACTION_UP = 0
ACTION_MOVE = 2
file_handle = None
#log_content = ""
download_log_command = "adb pull /sdcard/altman.log ."
#sets a variable with the package's internal
pac... | [
[
1,
0,
0.0336,
0.0067,
0,
0.66,
0,
719,
0,
3,
0,
0,
719,
0,
0
],
[
1,
0,
0.0403,
0.0067,
0,
0.66,
0.0667,
509,
0,
2,
0,
0,
509,
0,
0
],
[
14,
0,
0.0537,
0.0067,
0,
... | [
"from com.android.monkeyrunner import MonkeyRunner,MonkeyDevice,MonkeyImage",
"import sys,os",
"ACTION_DOWN = 1",
"ACTION_UP = 0",
"ACTION_MOVE = 2",
"file_handle = None",
"download_log_command = \"adb pull /sdcard/altman.log .\"",
"package = 'com.taobao.taobao'",
"mainActivity = 'com.taobao.tao.Wel... |
# Pseudo-Python rendition of the code for ``get_next_access_unit()``.
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of ... | [
[
2,
0,
0.586,
0.8344,
0,
0.66,
0,
323,
0,
1,
1,
0,
0,
0,
32
],
[
8,
1,
0.1815,
0.0127,
1,
0.47,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
1,
0.1911,
0.0064,
1,
0.47,
... | [
"def get_next_access_unit(context):\n \"\"\"Retrieve the next access unit from the file described by `context`.\n \"\"\"\n access_unit = build_access_unit()\n if context.pending_nal: # i.e., we already had a NAL to start this unit\n access_unit.append(context.pending_nal,TRUE,context.pending_list... |
#! /usr/bin/env python
"""Build HTML from the reStructuredText files in this directory.
This is a script just so I don't have to remember the particular incantation
required. It's not in the Makefile because I'm not yet sure it belongs there...
Requires Python and docutils.
Uses rst2html.py on individual files becau... | [
[
8,
0,
0.1275,
0.1961,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.7255,
0.0196,
0,
0.66,
0.3333,
688,
0,
1,
0,
0,
688,
0,
0
],
[
2,
0,
0.8333,
0.1569,
0,
0.66... | [
"\"\"\"Build HTML from the reStructuredText files in this directory.\n\nThis is a script just so I don't have to remember the particular incantation\nrequired. It's not in the Makefile because I'm not yet sure it belongs there...\n\nRequires Python and docutils.\n\nUses rst2html.py on individual files because that ... |
"""Setup.py -- for building tstools Pyrex modules
"""
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#... | [
[
8,
0,
0.0341,
0.0455,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.6364,
0.0227,
0,
0.66,
0.2,
152,
0,
1,
0,
0,
152,
0,
0
],
[
1,
0,
0.6591,
0.0227,
0,
0.66,
... | [
"\"\"\"Setup.py -- for building tstools Pyrex modules\n\"\"\"",
"from distutils.core import setup",
"from Pyrex.Distutils.extension import Extension",
"from Pyrex.Distutils import build_ext",
"tstools = Extension(\"tstools/tstools\",\n\t\t ['tstools/tstools.pyx'],\n\t\t include_dirs=['..'],\n\t\t l... |
"""tstools -- a package of Pyrex bindings for the tstools
This is being developed on a Mac, running OS X, and also tested on my Ubuntu
system at work.
I do not expect it to build (as it stands) on Windows, as it is making
assumptions that may not follow thereon.
It is my intent to worry about Windows after it works ... | [
[
8,
0,
0.1538,
0.2821,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
1,
0.0256,
0,
0.66,
1,
687,
0,
1,
0,
0,
687,
0,
0
]
] | [
"\"\"\"tstools -- a package of Pyrex bindings for the tstools\n\nThis is being developed on a Mac, running OS X, and also tested on my Ubuntu\nsystem at work.\n\nI do not expect it to build (as it stands) on Windows, as it is making\nassumptions that may not follow thereon.",
"from tstools import *"
] |
#! /usr/bin/env python
"""sockread.py -- a simple client to read from a socket
"""
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obta... | [
[
8,
0,
0.0284,
0.0227,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.3295,
0.0114,
0,
0.66,
0.1429,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.3409,
0.0114,
0,
0.66... | [
"\"\"\"sockread.py -- a simple client to read from a socket\n\"\"\"",
"import sys",
"import socket",
"class DoneException(Exception):\n pass",
"def get_packet(sock,packet_size=188):\n \"\"\"Read a packet from the socket, coping with partial reads.\n \"\"\"\n data = \"\"\n total = 0\n while... |
#====================================================================
# 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 string
import random
alphabets = string.letters + string.digits
len1 = 30000
len2 = 30000
f1 = open("random1", "w")
f2 = open("random2", "w")
for i in range(len1):
f1.write(alphabets[random.randint(0, len(alphabets) - 1)])
for i in range(len2):
f2.write(alphabets[random.randint(0, len(alphabets) - 1... | [
[
1,
0,
0.0526,
0.0526,
0,
0.66,
0,
890,
0,
1,
0,
0,
890,
0,
0
],
[
1,
0,
0.1053,
0.0526,
0,
0.66,
0.1,
715,
0,
1,
0,
0,
715,
0,
0
],
[
14,
0,
0.2105,
0.0526,
0,
0.... | [
"import string",
"import random",
"alphabets = string.letters + string.digits",
"len1 = 30000",
"len2 = 30000",
"f1 = open(\"random1\", \"w\")",
"f2 = open(\"random2\", \"w\")",
"for i in range(len1):\n f1.write(alphabets[random.randint(0, len(alphabets) - 1)])",
" f1.write(alphabets[random.ra... |
def lcs(A, B):
m = len(A)
n = len(B)
assert(m <= n)
M = [-1] * (m+1) # M is (m+1) * (m+1)
for i in range(len(M)):
M[i] = [-1] * (m+1)
diagonal_pos = m - 1
length_MAX = 0
pos_A = 0
upper_B = 0
# Calculate M(i, j)
while length_MAX < diagonal_pos:... | [
[
2,
0,
0.4882,
0.9647,
0,
0.66,
0,
957,
0,
2,
1,
0,
0,
0,
11
],
[
14,
1,
0.0235,
0.0118,
1,
0.92,
0,
711,
3,
1,
0,
0,
890,
10,
1
],
[
14,
1,
0.0353,
0.0118,
1,
0.9... | [
"def lcs(A, B):\n m = len(A)\n n = len(B)\n\n assert(m <= n)\n\n M = [-1] * (m+1) # M is (m+1) * (m+1)\n for i in range(len(M)):",
" m = len(A)",
" n = len(B)",
" M = [-1] * (m+1) # M is (m+1) * (m+1)",
" for i in range(len(M)):\n M[i] = [-1] * (m+1)",
" M[i] = [-1... |
import math
import wave
import array
def createSine( freq=440,length = 3 ,volume = .85, sampleRate =44100) :
sin = math.sin
pi = math.pi
twopi = 2*pi
data = array.array('h')
numSamples = int(length * sampleRate)
cyclesPerSample = float(freq)/sampleRate
volumeScale = volume*32767
for samp in xrange(numSamples... | [
[
1,
0,
0.0145,
0.0145,
0,
0.66,
0,
526,
0,
1,
0,
0,
526,
0,
0
],
[
1,
0,
0.029,
0.0145,
0,
0.66,
0.1667,
906,
0,
1,
0,
0,
906,
0,
0
],
[
1,
0,
0.0435,
0.0145,
0,
0... | [
"import math",
"import wave",
"import array",
"def createSine( freq=440,length = 3 ,volume = .85, sampleRate =44100) :\n sin = math.sin\n pi = math.pi\n twopi = 2*pi\n data = array.array('h')\n numSamples = int(length * sampleRate)\n cyclesPerSample = float(freq)/sampleRate\n volumeScale = volume*32767",
"... |
""" adapted from javascript by http://no.nonsense.ee/qthmap/
"""
import android, time, os, math
def returnQth(lat, lng):
qth = ''
lat += 90
lng += 180
lat = lat / 10 + 0.0000001
lng = lng / 20 + 0.0000001
qth += chr(65 + lng) + chr(65 + lat)
lat = 10 * (lat - math.floor(lat))
lng = 10 * (... | [
[
8,
0,
0.0326,
0.0435,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.087,
0.0217,
0,
0.66,
0.0909,
275,
0,
4,
0,
0,
275,
0,
0
],
[
2,
0,
0.3152,
0.4348,
0,
0.66,... | [
"\"\"\" adapted from javascript by http://no.nonsense.ee/qthmap/\n\"\"\"",
"import android, time, os, math",
"def returnQth(lat, lng):\n qth = '' \n lat += 90 \n lng += 180\n lat = lat / 10 + 0.0000001\n lng = lng / 20 + 0.0000001\n qth += chr(65 + lng) + chr(65 + lat)\n lat = 10 * (lat - math.floor(lat)... |
import math
import wave
import array
def createSine( freq=440,length = 3 ,volume = .85, sampleRate =44100) :
sin = math.sin
pi = math.pi
twopi = 2*pi
data = array.array('h')
numSamples = int(length * sampleRate)
cyclesPerSample = float(freq)/sampleRate
volumeScale = (.85)*32767
for samp in xrang... | [
[
1,
0,
0.0357,
0.0357,
0,
0.66,
0,
526,
0,
1,
0,
0,
526,
0,
0
],
[
1,
0,
0.0714,
0.0357,
0,
0.66,
0.1429,
906,
0,
1,
0,
0,
906,
0,
0
],
[
1,
0,
0.1071,
0.0357,
0,
... | [
"import math",
"import wave",
"import array",
"def createSine( freq=440,length = 3 ,volume = .85, sampleRate =44100) :\n sin = math.sin\n pi = math.pi\n twopi = 2*pi\n data = array.array('h')\n numSamples = int(length * sampleRate)\n cyclesPerSample = float(freq)/sampleRate\n volumeScale = (.85)*32767",
" ... |
import math
import wave
import array
def createSine( freq=440,length = 3 ,volume = .85, sampleRate =44100) :
sin = math.sin
pi = math.pi
twopi = 2*pi
data = array.array('h')
numSamples = int(length * sampleRate)
cyclesPerSample = float(freq)/sampleRate
volumeScale = (.85)*32767
for samp in xrang... | [
[
1,
0,
0.0286,
0.0286,
0,
0.66,
0,
526,
0,
1,
0,
0,
526,
0,
0
],
[
1,
0,
0.0571,
0.0286,
0,
0.66,
0.1111,
906,
0,
1,
0,
0,
906,
0,
0
],
[
1,
0,
0.0857,
0.0286,
0,
... | [
"import math",
"import wave",
"import array",
"def createSine( freq=440,length = 3 ,volume = .85, sampleRate =44100) :\n sin = math.sin\n pi = math.pi\n twopi = 2*pi\n data = array.array('h')\n numSamples = int(length * sampleRate)\n cyclesPerSample = float(freq)/sampleRate\n volumeScale = (.85)*32767",
" ... |
#!/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/env python
import sys
import os
from lib import main
main.main(fullscreen=True)
| [
[
1,
0,
0.5,
0.1667,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.6667,
0.1667,
0,
0.66,
0.3333,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.8333,
0.1667,
0,
0.6... | [
"import sys",
"import os",
"from lib import main",
"main.main(fullscreen=True)"
] |
from setuptools import setup, find_packages
setup(
name="666 Luftballons",
version="1.0",
description="Puzzle/action game in which you try to stomp devils in "
"balloons.",
author="Thijs Jonkman & Jeroen Vloothuis",
packages=find_packages(),
install_requires=[
'setuptools... | [
[
1,
0,
0.0526,
0.0526,
0,
0.66,
0,
182,
0,
2,
0,
0,
182,
0,
0
],
[
8,
0,
0.5789,
0.8947,
0,
0.66,
1,
234,
3,
7,
0,
0,
0,
0,
2
]
] | [
"from setuptools import setup, find_packages",
"setup(\n name=\"666 Luftballons\",\n version=\"1.0\",\n description=\"Puzzle/action game in which you try to stomp devils in \"\n \"balloons.\",\n author=\"Thijs Jonkman & Jeroen Vloothuis\",\n packages=find_packages(),\n install_req... |
#! /usr/bin/env python
import sys
import os
from lib import main
main.main(fullscreen=True)
| [
[
1,
0,
0.5,
0.1667,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.6667,
0.1667,
0,
0.66,
0.3333,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.8333,
0.1667,
0,
0.6... | [
"import sys",
"import os",
"from lib import main",
"main.main(fullscreen=True)"
] |
import pygame
from game import Game
from credits import CreditsScreen
from highscore import HighScoreScreen
from help import HelpScreen
import data
from foot import Foot, GodlyCloud
from clouds import Clouds
class Button(pygame.sprite.Sprite):
def __init__(self, normal_image, highlight_image, sound=None):
... | [
[
1,
0,
0.0056,
0.0056,
0,
0.66,
0,
87,
0,
1,
0,
0,
87,
0,
0
],
[
1,
0,
0.0111,
0.0056,
0,
0.66,
0.1111,
339,
0,
1,
0,
0,
339,
0,
0
],
[
1,
0,
0.0167,
0.0056,
0,
0.... | [
"import pygame",
"from game import Game",
"from credits import CreditsScreen",
"from highscore import HighScoreScreen",
"from help import HelpScreen",
"import data",
"from foot import Foot, GodlyCloud",
"from clouds import Clouds",
"class Button(pygame.sprite.Sprite):\n def __init__(self, normal_... |
import pygame
class GodlyCloud(pygame.sprite.RenderUpdates):
def __init__(self, cloud, foot, square_size, max_column, droprange,
offset=0):
super(GodlyCloud, self).__init__()
self.column = 0
self.max_column = max_column
self.foot = Foot(foot, square_size, droprange... | [
[
1,
0,
0.0082,
0.0082,
0,
0.66,
0,
87,
0,
1,
0,
0,
87,
0,
0
],
[
3,
0,
0.1025,
0.1639,
0,
0.66,
0.3333,
850,
0,
2,
0,
0,
725,
0,
7
],
[
2,
1,
0.0697,
0.0656,
1,
0.... | [
"import pygame",
"class GodlyCloud(pygame.sprite.RenderUpdates):\n\n def __init__(self, cloud, foot, square_size, max_column, droprange,\n offset=0):\n super(GodlyCloud, self).__init__()\n self.column = 0\n self.max_column = max_column\n self.foot = Foot(foot, square... |
'''Simple data loader module.
Loads data files from the "data" directory shipped with a game.
Enhancing this to handle caching etc. is left as an exercise for the reader.
'''
import os
import sys
import pygame
from animation import Animation
data_py = os.path.abspath(os.path.dirname(__file__))
data_dir = os.path.no... | [
[
8,
0,
0.0455,
0.0779,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1039,
0.013,
0,
0.66,
0.0588,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.1169,
0.013,
0,
0.66,
... | [
"'''Simple data loader module.\n\nLoads data files from the \"data\" directory shipped with a game.\n\nEnhancing this to handle caching etc. is left as an exercise for the reader.\n'''",
"import os",
"import sys",
"import pygame",
"from animation import Animation",
"data_py = os.path.abspath(os.path.dirna... |
import sys
from balloon import BalloonFactory, BalloonGenerator
from field import Field, Pop, TimedSprite
from foot import Foot, GodlyCloud
import data
from gameinfo import GameInfo, ScoreSystem, Timer
from animation import Animation
import pygame
from background import Sun
from spiral import Spiral
from clouds import ... | [
[
1,
0,
0.0037,
0.0037,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0074,
0.0037,
0,
0.66,
0.0833,
860,
0,
2,
0,
0,
860,
0,
0
],
[
1,
0,
0.0112,
0.0037,
0,
... | [
"import sys",
"from balloon import BalloonFactory, BalloonGenerator",
"from field import Field, Pop, TimedSprite",
"from foot import Foot, GodlyCloud",
"import data",
"from gameinfo import GameInfo, ScoreSystem, Timer",
"from animation import Animation",
"import pygame",
"from background import Sun"... |
import os
import pygame
import data
import pickle
class HighScores(object):
def __init__(self, filename):
self.filename = filename
self.max_scores = 6
self.load()
@property
def path(self):
return os.path.expanduser(os.path.join('~', '.' + self.filename))
def load(self)... | [
[
1,
0,
0.0109,
0.0109,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0217,
0.0109,
0,
0.66,
0.2,
87,
0,
1,
0,
0,
87,
0,
0
],
[
1,
0,
0.0326,
0.0109,
0,
0.66,... | [
"import os",
"import pygame",
"import data",
"import pickle",
"class HighScores(object):\n def __init__(self, filename):\n self.filename = filename\n self.max_scores = 6\n self.load()\n\n @property\n def path(self):",
" def __init__(self, filename):\n self.filename ... |
import pygame
from foot import Foot
class TimedSprite(pygame.sprite.Sprite):
def __init__(self, image, display_time, position):
super(Pop, self).__init__()
self.image = image
self.rect = image.get_rect()
self.rect.center = position
self.clock = pygame.time.Clock()
se... | [
[
1,
0,
0.0164,
0.0164,
0,
0.66,
0,
87,
0,
1,
0,
0,
87,
0,
0
],
[
1,
0,
0.0328,
0.0164,
0,
0.66,
0.25,
251,
0,
1,
0,
0,
251,
0,
0
],
[
3,
0,
0.1721,
0.2295,
0,
0.66... | [
"import pygame",
"from foot import Foot",
"class TimedSprite(pygame.sprite.Sprite):\n def __init__(self, image, display_time, position):\n super(Pop, self).__init__()\n self.image = image\n self.rect = image.get_rect()\n self.rect.center = position\n self.clock = pygame.tim... |
'''Game main module.
Contains the entry point used by the run_game.py script.
Feel free to put all your game code here, or in other modules in this "lib"
directory.
'''
import data
import os
import pygame
from startscreen import StartScreen
from optparse import OptionParser
def main(fullscreen=False):
parser = ... | [
[
8,
0,
0.0952,
0.1667,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.2143,
0.0238,
0,
0.66,
0.1667,
929,
0,
1,
0,
0,
929,
0,
0
],
[
1,
0,
0.2381,
0.0238,
0,
0.66... | [
"'''Game main module.\n\nContains the entry point used by the run_game.py script.\n\nFeel free to put all your game code here, or in other modules in this \"lib\"\ndirectory.\n'''",
"import data",
"import os",
"import pygame",
"from startscreen import StartScreen",
"from optparse import OptionParser",
"... |
import pygame
import math
_movement = {
0:(0,1),
1:(1,1),
2:(1,0),
3:(1,-1),
4:(0,-1),
-3:(-1,-1),
-2:(-1,0),
-1:(-1,1)}
class Sun(pygame.sprite.Sprite):
def __init__(self, animation):
super(Sun, self).__init__()
self.animation = animation
self.rect = self.i... | [
[
1,
0,
0.0112,
0.0112,
0,
0.66,
0,
87,
0,
1,
0,
0,
87,
0,
0
],
[
1,
0,
0.0225,
0.0112,
0,
0.66,
0.3333,
526,
0,
1,
0,
0,
526,
0,
0
],
[
14,
0,
0.0899,
0.1011,
0,
0... | [
"import pygame",
"import math",
"_movement = {\n 0:(0,1),\n 1:(1,1),\n 2:(1,0),\n 3:(1,-1),\n 4:(0,-1),\n -3:(-1,-1),\n -2:(-1,0),",
"class Sun(pygame.sprite.Sprite):\n def __init__(self, animation):\n super(Sun, self).__init__()\n self.animation = animation\n self... |
import pygame
import data
class CreditsScreen(object):
def run(self, screen):
from keys import *
background = data.load_graphic('credits.png')
screen.blit(background, (0, 0))
pygame.display.update()
clock = pygame.time.Clock()
while True:
clock.tick(80)
... | [
[
1,
0,
0.0455,
0.0455,
0,
0.66,
0,
87,
0,
1,
0,
0,
87,
0,
0
],
[
1,
0,
0.0909,
0.0455,
0,
0.66,
0.5,
929,
0,
1,
0,
0,
929,
0,
0
],
[
3,
0,
0.5909,
0.8636,
0,
0.66,... | [
"import pygame",
"import data",
"class CreditsScreen(object):\n def run(self, screen):\n from keys import *\n background = data.load_graphic('credits.png')\n screen.blit(background, (0, 0))\n pygame.display.update()\n\n clock = pygame.time.Clock()",
" def run(self, scr... |
import pygame
import random
import time
class Balloon(pygame.sprite.Sprite):
def __init__(self, normal_animation, fire_animation, cell, type):
super(Balloon, self).__init__()
self.normal_animation = normal_animation
self.fire_animation = fire_animation
self.current_animation = self.... | [
[
1,
0,
0.0159,
0.0159,
0,
0.66,
0,
87,
0,
1,
0,
0,
87,
0,
0
],
[
1,
0,
0.0317,
0.0159,
0,
0.66,
0.2,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.0476,
0.0159,
0,
0.66,... | [
"import pygame",
"import random",
"import time",
"class Balloon(pygame.sprite.Sprite):\n def __init__(self, normal_animation, fire_animation, cell, type):\n super(Balloon, self).__init__()\n self.normal_animation = normal_animation\n self.fire_animation = fire_animation\n self.c... |
import ConfigParser
def load_data_configuration(data_dir):
configuration = ConfigParser.ConfigParser()
configuration.read([data_dir])
return configuration
| [
[
1,
0,
0.1667,
0.1667,
0,
0.66,
0,
272,
0,
1,
0,
0,
272,
0,
0
],
[
2,
0,
0.75,
0.6667,
0,
0.66,
1,
984,
0,
1,
1,
0,
0,
0,
2
],
[
14,
1,
0.6667,
0.1667,
1,
0.78,
... | [
"import ConfigParser",
"def load_data_configuration(data_dir):\n configuration = ConfigParser.ConfigParser()\n configuration.read([data_dir])\n return configuration",
" configuration = ConfigParser.ConfigParser()",
" configuration.read([data_dir])",
" return configuration"
] |
import pygame
class Spiral(pygame.sprite.Sprite):
def __init__(self, animation_clock_wise, animation_counter_clock_wise):
super(Spiral, self).__init__()
self.animation, self.animation_clock_wise = animation_clock_wise, animation_clock_wise
self.animation_counter_clock_wise = animation_count... | [
[
1,
0,
0.0476,
0.0476,
0,
0.66,
0,
87,
0,
1,
0,
0,
87,
0,
0
],
[
3,
0,
0.5476,
0.8571,
0,
0.66,
1,
882,
0,
3,
0,
0,
589,
0,
3
],
[
2,
1,
0.3333,
0.3333,
1,
0.17,
... | [
"import pygame",
"class Spiral(pygame.sprite.Sprite):\n def __init__(self, animation_clock_wise, animation_counter_clock_wise):\n super(Spiral, self).__init__()\n self.animation, self.animation_clock_wise = animation_clock_wise, animation_clock_wise\n self.animation_counter_clock_wise = an... |
import pygame
import data
class HelpScreen(object):
def run(self, screen):
from keys import *
background = data.load_graphic('help.png')
screen.blit(background, (0, 0))
pygame.display.update()
clock = pygame.time.Clock()
while True:
clock.tick(80)
... | [
[
1,
0,
0.0455,
0.0455,
0,
0.66,
0,
87,
0,
1,
0,
0,
87,
0,
0
],
[
1,
0,
0.0909,
0.0455,
0,
0.66,
0.5,
929,
0,
1,
0,
0,
929,
0,
0
],
[
3,
0,
0.5909,
0.8636,
0,
0.66,... | [
"import pygame",
"import data",
"class HelpScreen(object):\n def run(self, screen):\n from keys import *\n background = data.load_graphic('help.png')\n screen.blit(background, (0, 0))\n pygame.display.update()\n\n clock = pygame.time.Clock()",
" def run(self, screen):\... |
import pygame
K_LEFT, K_RIGHT = pygame.K_LEFT, pygame.K_RIGHT
DROP_KEYS = (pygame.K_SPACE, pygame.K_DOWN, pygame.K_RETURN)
TO_LEFT, TO_RIGHT = (-1, 1)
ROTATE_RIGHT_KEYS = (pygame.K_d,)
ROTATE_LEFT_KEYS = (pygame.K_s,)
QUIT_KEYS = (pygame.K_q, pygame.K_ESCAPE)
| [
[
1,
0,
0.1,
0.1,
0,
0.66,
0,
87,
0,
1,
0,
0,
87,
0,
0
],
[
14,
0,
0.3,
0.1,
0,
0.66,
0.1667,
248,
0,
0,
0,
0,
0,
8,
0
],
[
14,
0,
0.4,
0.1,
0,
0.66,
0.3333,
... | [
"import pygame",
"K_LEFT, K_RIGHT = pygame.K_LEFT, pygame.K_RIGHT",
"DROP_KEYS = (pygame.K_SPACE, pygame.K_DOWN, pygame.K_RETURN)",
"TO_LEFT, TO_RIGHT = (-1, 1)",
"ROTATE_RIGHT_KEYS = (pygame.K_d,)",
"ROTATE_LEFT_KEYS = (pygame.K_s,)",
"QUIT_KEYS = (pygame.K_q, pygame.K_ESCAPE)"
] |
import pygame
class Animation(object):
def __init__(self, images, fps):
self.images = images
self.current_image = 0
self.animation_frame_rate = fps
self.animation_time_passed = 0
self.animation_frame_time = 1000 / self.animation_frame_rate
self.clock = pygame.time.Cl... | [
[
1,
0,
0.05,
0.05,
0,
0.66,
0,
87,
0,
1,
0,
0,
87,
0,
0
],
[
3,
0,
0.575,
0.9,
0,
0.66,
1,
873,
0,
2,
0,
0,
186,
0,
3
],
[
2,
1,
0.35,
0.35,
1,
0.67,
0,
55... | [
"import pygame",
"class Animation(object):\n def __init__(self, images, fps):\n self.images = images\n self.current_image = 0\n self.animation_frame_rate = fps\n self.animation_time_passed = 0\n self.animation_frame_time = 1000 / self.animation_frame_rate\n self.clock ... |
import pygame
import random
import time
class GameInfo(pygame.sprite.RenderUpdates):
def __init__(self, score, timer, score_animations, numerals, timer_banner,
combo_banner, score_banner):
super(GameInfo, self).__init__()
combo_panel = ComboPanel(score, score_animations, combo_bann... | [
[
1,
0,
0.0069,
0.0069,
0,
0.66,
0,
87,
0,
1,
0,
0,
87,
0,
0
],
[
1,
0,
0.0138,
0.0069,
0,
0.66,
0.125,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.0207,
0.0069,
0,
0.6... | [
"import pygame",
"import random",
"import time",
"class GameInfo(pygame.sprite.RenderUpdates):\n def __init__(self, score, timer, score_animations, numerals, timer_banner,\n combo_banner, score_banner):\n super(GameInfo, self).__init__()\n combo_panel = ComboPanel(score, score... |
import pygame
import random
class Clouds(pygame.sprite.RenderUpdates):
def __init__(self, clouds):
super(Clouds, self).__init__()
self.clouds_gfx = clouds
self.layers = 6
self.layer_distance = 600 / self.layers
self.speeds = range(6, 12)
self.creat_clouds()
... | [
[
1,
0,
0.0175,
0.0175,
0,
0.66,
0,
87,
0,
1,
0,
0,
87,
0,
0
],
[
1,
0,
0.0351,
0.0175,
0,
0.66,
0.3333,
715,
0,
1,
0,
0,
715,
0,
0
],
[
3,
0,
0.307,
0.4912,
0,
0.6... | [
"import pygame",
"import random",
"class Clouds(pygame.sprite.RenderUpdates):\n def __init__(self, clouds):\n super(Clouds, self).__init__()\n self.clouds_gfx = clouds\n self.layers = 6\n self.layer_distance = 600 / self.layers\n self.speeds = range(6, 12)",
" def __in... |
#!/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... |
#
# Modificacion del ejemplo http://matplotlib.org/examples/animation/animate_decay.html
#
# Requiere matplotlib
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
# CONFIG
XLIMITS = (0, 5)
YLIMITS = (-1.1, 1.1)
CONTINUO = False
INTERVAL_UPDATE = 10
#Dummy generator of data.... | [
[
1,
0,
0.1,
0.0167,
0,
0.66,
0,
954,
0,
1,
0,
0,
954,
0,
0
],
[
1,
0,
0.1167,
0.0167,
0,
0.66,
0.0526,
596,
0,
1,
0,
0,
596,
0,
0
],
[
1,
0,
0.1333,
0.0167,
0,
0.6... | [
"import numpy as np",
"import matplotlib.pyplot as plt",
"import matplotlib.animation as animation",
"XLIMITS = (0, 5)",
"YLIMITS = (-1.1, 1.1)",
"CONTINUO = False",
"INTERVAL_UPDATE = 10",
"def data_gen():\n t = data_gen.t\n cnt = 0\n while cnt < 1000:\n cnt+=1\n t += 0.05\n yiel... |
#!/usr/bin/env python
import sys
def data_gen ():
line = sys.stdin.readline()
while line:
try:
val = int(line)
yield val
except:
pass
line = sys.stdin.readline()
COUNT = 8
MIX = 0.95
gen = data_gen()
buf = []
output = None
for emt in gen:
if ou... | [
[
1,
0,
0.0909,
0.0303,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
2,
0,
0.2727,
0.2727,
0,
0.66,
0.1429,
359,
0,
0,
0,
0,
0,
0,
3
],
[
14,
1,
0.1818,
0.0303,
1,
0... | [
"import sys",
"def data_gen ():\n line = sys.stdin.readline()\n while line:\n try:\n val = int(line)\n yield val\n except:\n pass",
" line = sys.stdin.readline()",
" while line:\n try:\n val = int(line)\n yield val\n ... |
#!/usr/bin/env python
from fw_interface import app_request, get_mediciones
app_request('APP_ADC_START')
while True:
for n in get_mediciones():
print n
| [
[
1,
0,
0.375,
0.125,
0,
0.66,
0,
489,
0,
2,
0,
0,
489,
0,
0
],
[
8,
0,
0.5,
0.125,
0,
0.66,
0.5,
514,
3,
1,
0,
0,
0,
0,
1
],
[
5,
0,
0.875,
0.375,
0,
0.66,
1,
... | [
"from fw_interface import app_request, get_mediciones",
"app_request('APP_ADC_START')",
"while True:\n for n in get_mediciones():\n print(n)",
" for n in get_mediciones():\n print(n)",
" print(n)"
] |
#!/usr/bin/env python
FREQ_BUF_LEN = 8
from peak import F_SAMPLE, pulse_peak_gen
gen = pulse_peak_gen()
buf = []
freq_buf = []
while len(buf)+1 < 4:
buf.append(gen.next()[0])
while True:
buf.append(gen.next()[0])
dist_buf = []
dist_buf.append(buf[3] - buf[1])
dist_buf.append(buf[2] - buf[0... | [
[
14,
0,
0.0938,
0.0312,
0,
0.66,
0,
357,
1,
0,
0,
0,
0,
1,
0
],
[
1,
0,
0.1562,
0.0312,
0,
0.66,
0.1667,
281,
0,
2,
0,
0,
281,
0,
0
],
[
14,
0,
0.2188,
0.0312,
0,
... | [
"FREQ_BUF_LEN = 8",
"from peak import F_SAMPLE, pulse_peak_gen",
"gen = pulse_peak_gen()",
"buf = []",
"freq_buf = []",
"while len(buf)+1 < 4:\n buf.append(gen.next()[0])",
" buf.append(gen.next()[0])",
"while True:\n buf.append(gen.next()[0])\n \n dist_buf = []\n dist_buf.append(buf... |
#!/usr/bin/env python2.6
# -*- coding: utf-8 -*-
""" Bootloader interface: macros y funciones del bootloader usb compartidos
entre el firmware del bootloader del dispositivo y el software de aplicación.
(Definido en USB_BL_Interface.h)
"""
import ctypes as c
## Constantes globlales
INVALID_HANDLE_VALUE = 0
##... | [
[
8,
0,
0.0315,
0.028,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.049,
0.007,
0,
0.66,
0.0213,
182,
0,
1,
0,
0,
182,
0,
0
],
[
14,
0,
0.0699,
0.007,
0,
0.66,
... | [
"\"\"\" Bootloader interface: macros y funciones del bootloader usb compartidos\n entre el firmware del bootloader del dispositivo y el software de aplicación.\n (Definido en USB_BL_Interface.h)\n\"\"\"",
"import ctypes as c",
"INVALID_HANDLE_VALUE = 0",
"BL_MODE_SERIAL_STR_LAST_CHAR='~'",
"CMD_GET_DE... |
#!/usr/bin/env python
# Modificacion del ejemplo http://matplotlib.org/examples/animation/animate_decay.html
#
# Requiere matplotlib
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
import sys
# CONFIG
XLIMITS = (0, 1)
YLIMITS = (0, 3.3)
CONTINUO = True
INTERVAL_UPDATE = 10... | [
[
1,
0,
0.0968,
0.0161,
0,
0.66,
0,
954,
0,
1,
0,
0,
954,
0,
0
],
[
1,
0,
0.1129,
0.0161,
0,
0.66,
0.0476,
596,
0,
1,
0,
0,
596,
0,
0
],
[
1,
0,
0.129,
0.0161,
0,
0... | [
"import numpy as np",
"import matplotlib.pyplot as plt",
"import matplotlib.animation as animation",
"import sys",
"XLIMITS = (0, 1)",
"YLIMITS = (0, 3.3)",
"CONTINUO = True",
"INTERVAL_UPDATE = 10",
"F_SAMPLE = 1000.0",
"STEP = 1.0/F_SAMPLE",
"def data_gen():\n StartTime = 0.0\n line = sys.... |
#!/usr/bin/env python2.6
# -*- coding: utf-8 -*-
""" Interface con el firmware del bootloader: funciones que se comunican
directamente con el bootloader en el dispositivo.
"""
import ctypes as c
from bl_interface import *
from usb_interface import *
import time
SI_SUCCESS = 0
## USBXpress Read/Write Timeouts (in... | [
[
8,
0,
0.0084,
0.0063,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0126,
0.0021,
0,
0.66,
0.0526,
182,
0,
1,
0,
0,
182,
0,
0
],
[
1,
0,
0.0147,
0.0021,
0,
0.66... | [
"\"\"\" Interface con el firmware del bootloader: funciones que se comunican \n directamente con el bootloader en el dispositivo.\n\"\"\"",
"import ctypes as c",
"from bl_interface import *",
"from usb_interface import *",
"import time",
"SI_SUCCESS = 0",
"USBX_READ_TIMEOUT = 500",
"USBX_WRITE_TI... |
#!/usr/bin/env python2.6
# -*- coding: utf-8 -*-
""" Interfaz con libSiUSBXp
"""
from bl_interface import *
import ctypes as c
import time
# Global para referir a libSiUSBXp
api = c.CDLL('./libSiUSBXp.so')
if api is None:
raise ValueError('No se encuentra la librería libSiUSBXp.so')
## CheckRxQueue timeout (in m... | [
[
8,
0,
0.0222,
0.0127,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.038,
0.0063,
0,
0.66,
0.0714,
839,
0,
1,
0,
0,
839,
0,
0
],
[
1,
0,
0.0443,
0.0063,
0,
0.66,... | [
"\"\"\" Interfaz con libSiUSBXp\n\"\"\"",
"from bl_interface import *",
"import ctypes as c",
"import time",
"api = c.CDLL('./libSiUSBXp.so')",
"if api is None:\n raise ValueError('No se encuentra la librería libSiUSBXp.so')",
"USBX_CHECKRXQUEUE_TIMEOUT = 100",
"def WaitForDeviceRXQueue (deviceHand... |
#!/usr/bin/env python2.6
# -*- coding: utf-8 -*-
""" Upgrade de firmware para dispositivos con bootloader usbxpress
"""
# lo que sigue: verificar WriteFlash en fw_interface.py
# paso 3: verificar crc
# verificar polinomio
__version__='0.1'
#import wx
import time
import ctypes as c
from fw_interface import *
f... | [
[
8,
0,
0.0361,
0.0206,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.1031,
0.0103,
0,
0.66,
0.0435,
162,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.1237,
0.0103,
0,
0.66,... | [
"\"\"\" Upgrade de firmware para dispositivos con bootloader usbxpress\n\"\"\"",
"__version__='0.1'",
"import time",
"import ctypes as c",
"from fw_interface import *",
"from util import *",
"from intelhex import IntelHex ## http://www.bialix.com/intelhex/",
"import sys",
"if len(sys.argv)<2:\n p... |
#!/usr/bin/env python2.6
# -*- coding: utf-8 -*-
""" Funciones de proposito general que no estan en libreria estandar
"""
import subprocess as sub
def cmd(string):
proc=sub.Popen(string,shell=True,stdout=sub.PIPE)
out=proc.stdout.read()
print out
def pregunta_sn(pregunta, usarDefault = True, defaultSi = ... | [
[
8,
0,
0.1207,
0.069,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.2069,
0.0345,
0,
0.66,
0.3333,
394,
0,
1,
0,
0,
394,
0,
0
],
[
2,
0,
0.3276,
0.1379,
0,
0.66,... | [
"\"\"\" Funciones de proposito general que no estan en libreria estandar\n\"\"\"",
"import subprocess as sub",
"def cmd(string):\n proc=sub.Popen(string,shell=True,stdout=sub.PIPE)\n out=proc.stdout.read()\n print(out)",
" proc=sub.Popen(string,shell=True,stdout=sub.PIPE)",
" out=proc.stdout.... |
#!/usr/bin/env python
"""
Matplotlib Animation Example
author: Jake Vanderplas
email: vanderplas@astro.washington.edu
website: http://jakevdp.github.com
license: BSD
Please feel free to use and modify this, but keep the above information. Thanks!
"""
import numpy as np
from matplotlib import pyplot as plt
from matpl... | [
[
8,
0,
0.0619,
0.0928,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1237,
0.0103,
0,
0.66,
0.0455,
954,
0,
1,
0,
0,
954,
0,
0
],
[
1,
0,
0.134,
0.0103,
0,
0.66,... | [
"\"\"\"\nMatplotlib Animation Example\n\nauthor: Jake Vanderplas\nemail: vanderplas@astro.washington.edu\nwebsite: http://jakevdp.github.com\nlicense: BSD\nPlease feel free to use and modify this, but keep the above information. Thanks!",
"import numpy as np",
"from matplotlib import pyplot as plt",
"from mat... |
#!/usr/bin/env python
import sys
F_SAMPLE = 1000.0
MAX_PULSE = 120.0
PEAK_RADIUS = 2
MIN_BEAT = 50.0
MAX_BEAT = 130.0
def data_gen ():
line = sys.stdin.readline()
current_x = 0
while line:
try:
val = int(line)
yield current_x, val
except:
pass
l... | [
[
1,
0,
0.0176,
0.0059,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
14,
0,
0.0294,
0.0059,
0,
0.66,
0.0526,
925,
1,
0,
0,
0,
0,
2,
0
],
[
14,
0,
0.0353,
0.0059,
0,
... | [
"import sys",
"F_SAMPLE = 1000.0",
"MAX_PULSE = 120.0",
"PEAK_RADIUS = 2",
"MIN_BEAT = 50.0",
"MAX_BEAT = 130.0",
"def data_gen ():\n line = sys.stdin.readline()\n current_x = 0\n while line:\n try:\n val = int(line)\n yield current_x, val\n except:",
" ... |
#!/usr/bin/env python
# Copyright 2010 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 la... | [
[
1,
0,
0.3542,
0.0208,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.375,
0.0208,
0,
0.66,
0.1429,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.3958,
0.0208,
0,
0... | [
"import sys",
"import os",
"from StringIO import StringIO",
"from PIL import Image",
"import datauri",
"def image_to_data_uri_(im):\n f = StringIO()\n im.save(f, 'PNG')\n uri = datauri.to_data_uri(f.getvalue(), 'foo.png')\n f.close()\n return uri",
" f = StringIO()",
" im.save(f, 'PNG')",
" ... |
#!/usr/bin/env python
# Copyright 2010 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 la... | [
[
1,
0,
0.5,
0.0294,
0,
0.66,
0,
177,
0,
1,
0,
0,
177,
0,
0
],
[
1,
0,
0.5294,
0.0294,
0,
0.66,
0.2,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.5588,
0.0294,
0,
0.66,
... | [
"import base64",
"import sys",
"import mimetypes",
"def to_data_uri(data, file_name):\n '''Takes a file object and returns its data: string.'''\n mime_type = mimetypes.guess_type(file_name)\n return 'data:%(mimetype)s;base64,%(data)s' % dict(mimetype=mime_type[0],\n data=base64.b64encode(data))",
" ... |
#!/usr/bin/env python
# Copyright 2010 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 la... | [
[
1,
0,
0.1753,
0.0103,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.1856,
0.0103,
0,
0.66,
0.1,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.1959,
0.0103,
0,
0.6... | [
"import sys",
"import os",
"from StringIO import StringIO",
"from PIL import Image",
"import datauri",
"RGBA_BLACK = (0, 0, 0, 255)",
"sign_ = lambda n: -1 if n < 0 else (1 if n > 0 else 0)",
"def find_black_region_(im, sx, sy, ex, ey):\n dx = sign_(ex - sx)\n dy = sign_(ey - sy)\n if abs(dx) == ab... |
#!/usr/bin/env python
# Copyright 2010 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 la... | [
[
1,
0,
0.2881,
0.0169,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.3051,
0.0169,
0,
0.66,
0.1667,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.322,
0.0169,
0,
0... | [
"import sys",
"import os",
"import os.path",
"import shutil",
"import zipfile",
"def main():\n params = {}\n params['id'] = sys.argv[1]\n params['displayname'] = sys.argv[2]\n params['description'] = sys.argv[3]\n\n zip_file = zipfile.ZipFile('dist/stencil-%s.zip' % params['id'], 'w',\n zipfile.... |
#!/usr/bin/env python
#-*- coding:utf-8 -*-
"""
Este modulo define la clase Ecuacion, que permite interpretar una ecuacion
de una cadena de caracteres y separala en sus componentes, para ser
almacenados en notacion polaca inversa.
"""
import re
class Ecuacion(object):
"""
Represent... | [
[
8,
0,
0.0316,
0.0263,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0474,
0.0053,
0,
0.66,
0.25,
540,
0,
1,
0,
0,
540,
0,
0
],
[
3,
0,
0.4658,
0.8211,
0,
0.66,
... | [
"\"\"\"\n Este modulo define la clase Ecuacion, que permite interpretar una ecuacion\n de una cadena de caracteres y separala en sus componentes, para ser\n almacenados en notacion polaca inversa. \n\"\"\"",
"import re",
"class Ecuacion(object):\n \"\"\"\n Representa una ecuacion, ... |
#!/usr/bin/env python
#-*- coding:utf-8 -*-
"""
Objetos encargados de realizar operaciones entre dos parametros;
uno denominado izquierdo y el otro derecho.
"""
class EvaluadorAbstracto (object):
"""
Define la interfaz necesaria para todo evaluador.
"""
def get_nombre(self)... | [
[
8,
0,
0.0247,
0.0179,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
3,
0,
0.0717,
0.0673,
0,
0.66,
0.0714,
102,
0,
2,
0,
0,
186,
0,
0
],
[
8,
1,
0.0493,
0.0135,
1,
0.24... | [
"\"\"\"\n Objetos encargados de realizar operaciones entre dos parametros;\n uno denominado izquierdo y el otro derecho. \n\"\"\"",
"class EvaluadorAbstracto (object):\n \"\"\"\n Define la interfaz necesaria para todo evaluador. \n \"\"\"\n def get_nombre(self):\n \"\"\"... |
#!/usr/bin/env python
#-*- coding:utf-8 -*-
"""
Genera un archivo de comandos para ser procesado por el modulo motor.
Genera en base a los parametros, un conjunto de atributos, un conjunto de
reglas con los mismos, y finalmente estimulos para intentar disparar
alguna regla.
"""
import rand... | [
[
8,
0,
0.0455,
0.042,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0769,
0.007,
0,
0.66,
0.1667,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.0909,
0.007,
0,
0.66,
... | [
"\"\"\"\n Genera un archivo de comandos para ser procesado por el modulo motor.\n Genera en base a los parametros, un conjunto de atributos, un conjunto de\n reglas con los mismos, y finalmente estimulos para intentar disparar\n alguna regla. \n\"\"\"",
"import random",
"from optparse imp... |
#!/usr/bin/env python
#-*- coding:utf-8 -*-
"""
Genera un archivo de comandos para ser procesado por el modulo motor.
Genera en base a los parametros, un conjunto de atributos, un conjunto de
reglas con los mismos, y finalmente estimulos para intentar disparar
alguna regla.
"""
import rand... | [
[
8,
0,
0.0455,
0.042,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0769,
0.007,
0,
0.66,
0.1667,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.0909,
0.007,
0,
0.66,
... | [
"\"\"\"\n Genera un archivo de comandos para ser procesado por el modulo motor.\n Genera en base a los parametros, un conjunto de atributos, un conjunto de\n reglas con los mismos, y finalmente estimulos para intentar disparar\n alguna regla. \n\"\"\"",
"import random",
"from optparse imp... |
#!/usr/bin/env python
#-*- coding:utf-8 -*-
"""
El modulo **motor** proporciona clases de utilidad, para la construccion
de un motor de inferencia, en conjunto con una manera de definir reglas y
hechos que las disparen, como asi tambien poder consultar el estado del
grafo subyacente de la red de infere... | [
[
8,
0,
0.0285,
0.0449,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0553,
0.0017,
0,
0.66,
0.0833,
773,
0,
1,
0,
0,
773,
0,
0
],
[
1,
0,
0.0604,
0.0017,
0,
0.66... | [
"\"\"\"\n El modulo **motor** proporciona clases de utilidad, para la construccion\n de un motor de inferencia, en conjunto con una manera de definir reglas y\n hechos que las disparen, como asi tambien poder consultar el estado del\n grafo subyacente de la red de inferencia construida.\n\n Operatori... |
#!/usr/bin/env python
#-*- coding:utf-8 -*-
"""
Aplica el concepto de mixin para definir atributos y gramatica comun.
- Nombre: objetos que tienen un nombre.
- Entrenamiento: objetos que tienen dos estados de entrenamiento.
- Output: objetos que tienen un conjunto de salida.
(ej... | [
[
8,
0,
0.0753,
0.0753,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
3,
0,
0.2258,
0.2043,
0,
0.66,
0.25,
642,
0,
3,
0,
0,
186,
0,
0
],
[
8,
1,
0.1505,
0.0323,
1,
0.85,
... | [
"\"\"\"\n Aplica el concepto de mixin para definir atributos y gramatica comun.\n - Nombre: objetos que tienen un nombre.\n - Entrenamiento: objetos que tienen dos estados de entrenamiento.\n - Output: objetos que tienen un conjunto de salida.\n (ejemplo: un nodo de un arbol de gr... |
#!/usr/bin/env python
#-*- coding:utf-8 -*-
"""
Objetos encargados de realizar operaciones entre dos parametros;
uno denominado izquierdo y el otro derecho.
"""
class EvaluadorAbstracto (object):
"""
Define la interfaz necesaria para todo evaluador.
"""
def get_nombre(self)... | [
[
8,
0,
0.0247,
0.0179,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
3,
0,
0.0717,
0.0673,
0,
0.66,
0.0714,
102,
0,
2,
0,
0,
186,
0,
0
],
[
8,
1,
0.0493,
0.0135,
1,
0.28... | [
"\"\"\"\n Objetos encargados de realizar operaciones entre dos parametros;\n uno denominado izquierdo y el otro derecho. \n\"\"\"",
"class EvaluadorAbstracto (object):\n \"\"\"\n Define la interfaz necesaria para todo evaluador. \n \"\"\"\n def get_nombre(self):\n \"\"\"... |
#!/usr/bin/env python
#-*- coding:utf-8 -*-
"""
Este modulo define la clase Ecuacion, que permite interpretar una ecuacion
de una cadena de caracteres y separala en sus componentes, para ser
almacenados en notacion polaca inversa.
"""
import re
class Ecuacion(object):
"""
Represent... | [
[
8,
0,
0.0316,
0.0263,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0474,
0.0053,
0,
0.66,
0.25,
540,
0,
1,
0,
0,
540,
0,
0
],
[
3,
0,
0.4658,
0.8211,
0,
0.66,
... | [
"\"\"\"\n Este modulo define la clase Ecuacion, que permite interpretar una ecuacion\n de una cadena de caracteres y separala en sus componentes, para ser\n almacenados en notacion polaca inversa. \n\"\"\"",
"import re",
"class Ecuacion(object):\n \"\"\"\n Representa una ecuacion, ... |
#!/usr/bin/env python
#-*- coding:utf-8 -*-
"""
Aplica el concepto de mixin para definir atributos y gramatica comun.
- Nombre: objetos que tienen un nombre.
- Entrenamiento: objetos que tienen dos estados de entrenamiento.
- Output: objetos que tienen un conjunto de salida.
(ej... | [
[
8,
0,
0.0753,
0.0753,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
3,
0,
0.2258,
0.2043,
0,
0.66,
0.25,
642,
0,
3,
0,
0,
186,
0,
0
],
[
8,
1,
0.1505,
0.0323,
1,
0.38,
... | [
"\"\"\"\n Aplica el concepto de mixin para definir atributos y gramatica comun.\n - Nombre: objetos que tienen un nombre.\n - Entrenamiento: objetos que tienen dos estados de entrenamiento.\n - Output: objetos que tienen un conjunto de salida.\n (ejemplo: un nodo de un arbol de gr... |
#!/usr/bin/env python
#-*- coding:utf-8 -*-
"""
El modulo **motor** proporciona clases de utilidad, para la construccion
de un motor de inferencia, en conjunto con una manera de definir reglas y
hechos que las disparen, como asi tambien poder consultar el estado del
grafo subyacente de la red de infere... | [
[
8,
0,
0.0285,
0.0449,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0553,
0.0017,
0,
0.66,
0.0833,
773,
0,
1,
0,
0,
773,
0,
0
],
[
1,
0,
0.0604,
0.0017,
0,
0.66... | [
"\"\"\"\n El modulo **motor** proporciona clases de utilidad, para la construccion\n de un motor de inferencia, en conjunto con una manera de definir reglas y\n hechos que las disparen, como asi tambien poder consultar el estado del\n grafo subyacente de la red de inferencia construida.\n\n Operatori... |
#!/usr/bin/env python
#-*- coding:utf-8 -*-
import re
from Tarea import *
import Tesauro
# Transforma lineas de palabras separadas por algun elemento de @separadores, en lineas de palabras separadas por espacios que no estan en el conjunto listaNegra.
class Limpieza(Tarea):
# Metodo de utilidad para construir una... | [
[
1,
0,
0.037,
0.0093,
0,
0.66,
0,
540,
0,
1,
0,
0,
540,
0,
0
],
[
1,
0,
0.0556,
0.0093,
0,
0.66,
0.25,
536,
0,
1,
0,
0,
536,
0,
0
],
[
1,
0,
0.0648,
0.0093,
0,
0.6... | [
"import re",
"from Tarea import *",
"import Tesauro",
"class Limpieza(Tarea):\t\n\t# Metodo de utilidad para construir una lista negra a partir de un tesauro.\n\t# TODO La funcion esta definida aca, pero deberia definirse fuera de la clase Limpieza y usada para construir una instancia.\n\t@classmethod\n\tdef ... |
#!/usr/bin/env python
#-*- coding:utf-8 -*-
from Tarea import *
# Genera un dicccionario donde cada palabra indica la cantidad de veces que aparecio.
class ContarPalabras(Tarea):
def __init__(self, nombre, entrada = None, noLeer = None, salida = None, log = None, errores = None, mostrarN = 20):
Tarea.__init__(self... | [
[
1,
0,
0.0597,
0.0149,
0,
0.66,
0,
536,
0,
1,
0,
0,
536,
0,
0
],
[
3,
0,
0.5224,
0.8507,
0,
0.66,
0.5,
873,
0,
6,
0,
0,
536,
0,
19
],
[
2,
1,
0.1716,
0.1194,
1,
0.... | [
"from Tarea import *",
"class ContarPalabras(Tarea):\n\tdef __init__(self, nombre, entrada = None, noLeer = None, salida = None, log = None, errores = None, mostrarN = 20):\n\t\tTarea.__init__(self, nombre, entrada, noLeer, salida, log, errores)\n\n\t\tself.palabras = {}\n\t\t# Cantidad de palabras a mostrar\n\t\... |
#!/usr/bin/env python3
#-*- coding:utf-8 -*-
import sys
import logging
from echo3Ways import *
def main():
# Construir logger.
logger = logging.getLogger('echo3Ways.log')
hl = logging.FileHandler('echo3Ways.log')
formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s')
hl.setFormatter(formatter)
... | [
[
1,
0,
0.0833,
0.0208,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.1042,
0.0208,
0,
0.66,
0.25,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.1458,
0.0208,
0,
0.... | [
"import sys",
"import logging",
"from echo3Ways import *",
"def main():\n\t# Construir logger.\n\tlogger = logging.getLogger('echo3Ways.log')\n\thl = logging.FileHandler('echo3Ways.log')\n\tformatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s')\n\thl.setFormatter(formatter)\n\tlogger.addHandle... |
#!/usr/bin/env python3
#-*- coding:utf-8 -*-
import codecs
import os
import sys
import logging
import getopt
from ExtraerVerbosYSustantivos import *
from Limpieza import *
from ContarPalabras import *
def armarTareas():
return ('limpieza','extraer','contar')
def usage():
print ' Prototipo de control de tareas: Es... | [
[
1,
0,
0.028,
0.007,
0,
0.66,
0,
220,
0,
1,
0,
0,
220,
0,
0
],
[
1,
0,
0.035,
0.007,
0,
0.66,
0.0625,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.042,
0.007,
0,
0.66,
... | [
"import codecs",
"import os",
"import sys",
"import logging",
"import getopt",
"from ExtraerVerbosYSustantivos import *",
"from Limpieza import *",
"from ContarPalabras import *",
"def armarTareas():\n\treturn ('limpieza','extraer','contar')",
"\treturn ('limpieza','extraer','contar')",
"def usa... |
#!/usr/bin/env python
#-*- coding:utf-8 -*-
from __future__ import print_function
import re
import datetime
import sys
class Tarea (object):
NOERROR = 0
ERROR = 1
def __init__(self, nombre, entrada = None, noLeer = None, salida = None, log = None, errores = None):
# Nombre de la tarea.
self.nombre = nombre
... | [
[
1,
0,
0.0396,
0.0099,
0,
0.66,
0,
777,
0,
1,
0,
0,
777,
0,
0
],
[
1,
0,
0.0495,
0.0099,
0,
0.66,
0.2,
540,
0,
1,
0,
0,
540,
0,
0
],
[
1,
0,
0.0594,
0.0099,
0,
0.6... | [
"from __future__ import print_function",
"import re",
"import datetime",
"import sys",
"class Tarea (object):\n\tNOERROR = 0\n\tERROR = 1\n\n\tdef __init__(self, nombre, entrada = None, noLeer = None, salida = None, log = None, errores = None):\n\t\t# Nombre de la tarea.\n\t\tself.nombre = nombre\n\t\t# Obj... |
#!/usr/bin/env python3
#-*- coding:utf-8 -*-
import sys
import logging
from echo3Ways import *
def main():
# Construir logger.
logger = logging.getLogger('echo3Ways.log')
hl = logging.FileHandler('echo3Ways.log')
formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s')
hl.setFormatter(formatter)
... | [
[
1,
0,
0.0833,
0.0208,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.1042,
0.0208,
0,
0.66,
0.25,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.1458,
0.0208,
0,
0.... | [
"import sys",
"import logging",
"from echo3Ways import *",
"def main():\n\t# Construir logger.\n\tlogger = logging.getLogger('echo3Ways.log')\n\thl = logging.FileHandler('echo3Ways.log')\n\tformatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s')\n\thl.setFormatter(formatter)\n\tlogger.addHandle... |
#!/usr/bin/env python
#-*- coding:utf-8 -*-
#from __future__ import print_function
from Tarea import *
# Un ejemplo de tarea: entrada -> echo3Ways -> stdout \ log \ errores
class echo3Ways (Tarea):
def __init__(self, entrada, salida, log, errores):
Tarea.__init__(self,"echo3Ways",entrada,salida,log,errores)
def... | [
[
1,
0,
0.2083,
0.0417,
0,
0.66,
0,
536,
0,
1,
0,
0,
536,
0,
0
],
[
3,
0,
0.5833,
0.5417,
0,
0.66,
0.5,
968,
0,
2,
0,
0,
536,
0,
6
],
[
2,
1,
0.4375,
0.0833,
1,
0.5... | [
"from Tarea import *",
"class echo3Ways (Tarea):\n\n\tdef __init__(self, entrada, salida, log, errores):\n\t\tTarea.__init__(self,\"echo3Ways\",entrada,salida,log,errores)\n\n\tdef process(self, linea, nReg):\n\t\tmsg = linea.rstrip()",
"\tdef __init__(self, entrada, salida, log, errores):\n\t\tTarea.__init__(s... |
#!/usr/bin/env python
#-*- coding:utf-8 -*-
import re
from Tarea import *
import Tesauro
# Transforma lineas de palabras separadas por algun elemento de @separadores, en lineas de palabras separadas por espacios que no estan en el conjunto listaNegra.
class Limpieza(Tarea):
# Metodo de utilidad para construir una... | [
[
1,
0,
0.037,
0.0093,
0,
0.66,
0,
540,
0,
1,
0,
0,
540,
0,
0
],
[
1,
0,
0.0556,
0.0093,
0,
0.66,
0.25,
536,
0,
1,
0,
0,
536,
0,
0
],
[
1,
0,
0.0648,
0.0093,
0,
0.6... | [
"import re",
"from Tarea import *",
"import Tesauro",
"class Limpieza(Tarea):\t\n\t# Metodo de utilidad para construir una lista negra a partir de un tesauro.\n\t# TODO La funcion esta definida aca, pero deberia definirse fuera de la clase Limpieza y usada para construir una instancia.\n\t@classmethod\n\tdef ... |
#!/usr/bin/env python
#-*- coding:utf-8 -*-
from Tarea import *
# Genera un dicccionario donde cada palabra indica la cantidad de veces que aparecio.
class ContarPalabras(Tarea):
def __init__(self, nombre, entrada = None, noLeer = None, salida = None, log = None, errores = None, mostrarN = 20):
Tarea.__init__(self... | [
[
1,
0,
0.0597,
0.0149,
0,
0.66,
0,
536,
0,
1,
0,
0,
536,
0,
0
],
[
3,
0,
0.5224,
0.8507,
0,
0.66,
0.5,
873,
0,
6,
0,
0,
536,
0,
19
],
[
2,
1,
0.1716,
0.1194,
1,
0.... | [
"from Tarea import *",
"class ContarPalabras(Tarea):\n\tdef __init__(self, nombre, entrada = None, noLeer = None, salida = None, log = None, errores = None, mostrarN = 20):\n\t\tTarea.__init__(self, nombre, entrada, noLeer, salida, log, errores)\n\n\t\tself.palabras = {}\n\t\t# Cantidad de palabras a mostrar\n\t\... |
#!/usr/bin/env python
#-*- coding:utf-8 -*-
import os
class Tesauro:
def __init__(self):
self.adverbios = set( (
"apenas", "bastante", "casi", "cuanto", "demasiado", "justo", "mas", "menos", "mucho", "muy", "nada", "poco", "sobremanera", "tan", "todo", "tanto", "medio", "algo", "adelante", "adonde", "ahi", "aqu... | [
[
1,
0,
0.031,
0.0078,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
3,
0,
0.5078,
0.9302,
0,
0.66,
0.5,
776,
0,
1,
0,
0,
0,
0,
35
],
[
2,
1,
0.5116,
0.9225,
1,
0.42,... | [
"import os",
"class Tesauro:\n\tdef __init__(self):\n\t\tself.adverbios = set( (\n\t\t\t\"apenas\", \"bastante\", \"casi\", \"cuanto\", \"demasiado\", \"justo\", \"mas\", \"menos\", \"mucho\", \"muy\", \"nada\", \"poco\", \"sobremanera\", \"tan\", \"todo\", \"tanto\", \"medio\", \"algo\", \"adelante\", \"adonde\"... |
#!/usr/bin/env python
#-*- coding:utf-8 -*-
from Tarea import *
from Tesauro import *
# Transforma lineas que contienen solo palabras en minusculas separadas por espacios en una lista de lineas separadas por espacios que son o raices de verbos o palabras sueltas.
# TODO las palabras sueltas deberian ser solo sustanti... | [
[
1,
0,
0.0625,
0.0156,
0,
0.66,
0,
536,
0,
1,
0,
0,
536,
0,
0
],
[
1,
0,
0.0781,
0.0156,
0,
0.66,
0.3333,
776,
0,
1,
0,
0,
776,
0,
0
],
[
3,
0,
0.5469,
0.7969,
0,
... | [
"from Tarea import *",
"from Tesauro import *",
"class ExtraerVerbosYSustantivos(Tarea):\n\tdef __init__(self, nombre, entrada = None, noLeer = None, salida = None, log = None, errores = None, tesauro = None ):\n\t\tTarea.__init__(self, nombre, entrada, noLeer, salida, log, errores)\n\n\t\tif (tesauro == None):... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.