code stringlengths 1 1.49M | vector listlengths 0 7.38k | snippet listlengths 0 7.38k |
|---|---|---|
#!/usr/bin/env python
# encoding: utf-8
import sys
import os
import time
from pyfann import libfann
def main():
connection_rate = 1
learning_rate = 0.7
num_output = 1
max_iterations = 5000
iterations_between_reports = 100
parameters = [{"title": "Abalone", "train_file": "abalone_trai... | [
[
1,
0,
0.0513,
0.0128,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0641,
0.0128,
0,
0.66,
0.2,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0769,
0.0128,
0,
0.6... | [
"import sys",
"import os",
"import time",
"from pyfann import libfann",
"def main():\n\tconnection_rate \t\t\t\t= 1\n\tlearning_rate \t\t\t\t\t= 0.7\n\t\n\tnum_output \t\t\t\t\t\t= 1\n\t\n\tmax_iterations \t\t\t\t\t= 5000\n\titerations_between_reports \t\t= 100",
"\tconnection_rate \t\t\t\t= 1",
"\tlear... |
#!/usr/bin/env python
# encoding: utf-8
import sys
import os
import time
from pyfann import libfann
def main():
learning_rate = 0.7
num_output = 1
max_iterations = 5000
iterations_between_reports = 100
parameters = [{"title": "Abalone",
"train_file": "abalone_train.data",
"t... | [
[
1,
0,
0.0421,
0.0105,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0526,
0.0105,
0,
0.66,
0.2,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0632,
0.0105,
0,
0.6... | [
"import sys",
"import os",
"import time",
"from pyfann import libfann",
"def main():\n\tlearning_rate \t\t\t\t\t= 0.7\n\t\n\tnum_output \t\t\t\t\t\t= 1\n\t\n\tmax_iterations \t\t\t\t\t= 5000\n\titerations_between_reports \t\t= 100",
"\tlearning_rate \t\t\t\t\t= 0.7",
"\tnum_output \t\t\t\t\t\t= 1",
"\... |
#!/usr/bin/env python
# encoding: utf-8
import sys
import os
import time
from pyfann import libfann
def main():
learning_rate = 0.7
num_output = 1
max_iterations = 5000
iterations_between_reports = 100
parameters = [{"title": "Abalone",
"train_file": "abalone_train.data",
"t... | [
[
1,
0,
0.0421,
0.0105,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0526,
0.0105,
0,
0.66,
0.2,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0632,
0.0105,
0,
0.6... | [
"import sys",
"import os",
"import time",
"from pyfann import libfann",
"def main():\n\tlearning_rate \t\t\t\t\t= 0.7\n\t\n\tnum_output \t\t\t\t\t\t= 1\n\t\n\tmax_iterations \t\t\t\t\t= 5000\n\titerations_between_reports \t\t= 100",
"\tlearning_rate \t\t\t\t\t= 0.7",
"\tnum_output \t\t\t\t\t\t= 1",
"\... |
#!/usr/bin/env python
# encoding: utf-8
import sys
import os
import time
from pyfann import libfann
def main():
connection_rate = 1
learning_rate = 0.7
num_output = 1
max_iterations = 5000
iterations_between_reports = 100
parameters = [{"title": "Abalone", "train_file": "abalone_trai... | [
[
1,
0,
0.0513,
0.0128,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0641,
0.0128,
0,
0.66,
0.2,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0769,
0.0128,
0,
0.6... | [
"import sys",
"import os",
"import time",
"from pyfann import libfann",
"def main():\n\tconnection_rate \t\t\t\t= 1\n\tlearning_rate \t\t\t\t\t= 0.7\n\t\n\tnum_output \t\t\t\t\t\t= 1\n\t\n\tmax_iterations \t\t\t\t\t= 5000\n\titerations_between_reports \t\t= 100",
"\tconnection_rate \t\t\t\t= 1",
"\tlear... |
#!/usr/bin/python
import sys, hashlib
def write_file(fn, buf):
fp = open(fn, "wb")
fp.write(buf)
fp.close()
def usage():
print ("Usage: " + sys.argv[0] + " infile outfile label")
def main():
if( len(sys.argv) != 4):
usage()
sys.exit()
fp = open( sys.argv[1] , "rb")
hash_str = has... | [
[
1,
0,
0.0714,
0.0238,
0,
0.66,
0,
509,
0,
2,
0,
0,
509,
0,
0
],
[
2,
0,
0.1548,
0.0952,
0,
0.66,
0.25,
725,
0,
2,
0,
0,
0,
0,
3
],
[
14,
1,
0.1429,
0.0238,
1,
0.9... | [
"import sys, hashlib",
"def write_file(fn, buf):\n\tfp = open(fn, \"wb\")\n\tfp.write(buf)\n\tfp.close()",
"\tfp = open(fn, \"wb\")",
"\tfp.write(buf)",
"\tfp.close()",
"def usage():\n\tprint (\"Usage: \" + sys.argv[0] + \" infile outfile label\")",
"\tprint (\"Usage: \" + sys.argv[0] + \" infile outfi... |
#!/usr/bin/python
import sys, re, os
def write_file(fn, buf):
fp = open(fn, "wb")
fp.write(buf)
fp.close()
def usage():
print ("Usage: " + os.path.split(__file__)[1] + " version outfile")
def crete_version_str(ver):
base = list("0.00")
version = str(ver)
ret = []
base[0] = version[0]
base... | [
[
1,
0,
0.0577,
0.0192,
0,
0.66,
0,
509,
0,
3,
0,
0,
509,
0,
0
],
[
2,
0,
0.125,
0.0769,
0,
0.66,
0.2,
725,
0,
2,
0,
0,
0,
0,
3
],
[
14,
1,
0.1154,
0.0192,
1,
0.35,... | [
"import sys, re, os",
"def write_file(fn, buf):\n\tfp = open(fn, \"wb\")\n\tfp.write(buf)\n\tfp.close()",
"\tfp = open(fn, \"wb\")",
"\tfp.write(buf)",
"\tfp.close()",
"def usage():\n\tprint (\"Usage: \" + os.path.split(__file__)[1] + \" version outfile\")",
"\tprint (\"Usage: \" + os.path.split(__file... |
#!/usr/bin/python
class FakeTime:
def time(self):
return 1225856967.109
import sys, os, struct, gzip, hashlib, StringIO
gzip.time = FakeTime()
def binary_replace(data, newdata, offset):
return data[0:offset] + newdata + data[offset+len(newdata):]
def prx_compress(output, hdr, input, mod_name="", mod_a... | [
[
3,
0,
0.0488,
0.0366,
0,
0.66,
0,
425,
0,
1,
0,
0,
0,
0,
0
],
[
2,
1,
0.0549,
0.0244,
1,
0.81,
0,
654,
0,
1,
1,
0,
0,
0,
0
],
[
13,
2,
0.061,
0.0122,
2,
0.82,
... | [
"class FakeTime:\n def time(self):\n return 1225856967.109",
" def time(self):\n return 1225856967.109",
" return 1225856967.109",
"import sys, os, struct, gzip, hashlib, StringIO",
"gzip.time = FakeTime()",
"def binary_replace(data, newdata, offset):\n\treturn data[0:offset] + ... |
#!/usr/bin/python
import sys, hashlib
def toNID(name):
hashstr = hashlib.sha1(name.encode()).hexdigest().upper()
return "0x" + hashstr[6:8] + hashstr[4:6] + hashstr[2:4] + hashstr[0:2]
if __name__ == "__main__":
assert(toNID("sceKernelCpuSuspendIntr") == "0x092968F4")
for name in sys.argv[1:]:
print ("%s: %s"... | [
[
1,
0,
0.2308,
0.0769,
0,
0.66,
0,
509,
0,
2,
0,
0,
509,
0,
0
],
[
2,
0,
0.4615,
0.2308,
0,
0.66,
0.5,
259,
0,
1,
1,
0,
0,
0,
4
],
[
14,
1,
0.4615,
0.0769,
1,
0.29... | [
"import sys, hashlib",
"def toNID(name):\n\thashstr = hashlib.sha1(name.encode()).hexdigest().upper()\n\treturn \"0x\" + hashstr[6:8] + hashstr[4:6] + hashstr[2:4] + hashstr[0:2]",
"\thashstr = hashlib.sha1(name.encode()).hexdigest().upper()",
"\treturn \"0x\" + hashstr[6:8] + hashstr[4:6] + hashstr[2:4] + ha... |
#!/usr/bin/python
from hashlib import *
import sys, struct
def sha512(psid):
if len(psid) != 16:
return "".encode()
for i in range(512):
psid = sha1(psid).digest()
return psid
def get_psid(str):
if len(str) != 32:
return "".encode()
b = "".encode()
for i in range(0, len(str), 2):
b += struct.pack('B... | [
[
1,
0,
0.0652,
0.0217,
0,
0.66,
0,
154,
0,
1,
0,
0,
154,
0,
0
],
[
1,
0,
0.087,
0.0217,
0,
0.66,
0.2,
509,
0,
2,
0,
0,
509,
0,
0
],
[
2,
0,
0.2065,
0.1739,
0,
0.66... | [
"from hashlib import *",
"import sys, struct",
"def sha512(psid):\n\tif len(psid) != 16:\n\t\treturn \"\".encode()\n\n\tfor i in range(512):\n\t\tpsid = sha1(psid).digest()\n\n\treturn psid",
"\tif len(psid) != 16:\n\t\treturn \"\".encode()",
"\t\treturn \"\".encode()",
"\tfor i in range(512):\n\t\tpsid =... |
#!/usr/bin/python
"""
pspbtcnf_editor: An script that add modules from pspbtcnf
"""
import sys, os, re
from getopt import *
from struct import *
BTCNF_MAGIC=0x0F803001
verbose = False
def print_usage():
print ("%s: pspbtcnf.bin [-o output.bin] [-a add_module_name:before_module_name:flag]" %(os.path... | [
[
8,
0,
0.022,
0.0165,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0385,
0.0055,
0,
0.66,
0.0769,
509,
0,
3,
0,
0,
509,
0,
0
],
[
1,
0,
0.044,
0.0055,
0,
0.66,
... | [
"\"\"\"\npspbtcnf_editor: An script that add modules from pspbtcnf\n\"\"\"",
"import sys, os, re",
"from getopt import *",
"from struct import *",
"BTCNF_MAGIC=0x0F803001",
"verbose = False",
"def print_usage():\n\tprint (\"%s: pspbtcnf.bin [-o output.bin] [-a add_module_name:before_module_name:flag]\" ... |
#!/usr/bin/python
import os
def main():
lists = [
"ISODrivers/Galaxy/galaxy.prx",
"ISODrivers/March33/march33.prx",
"ISODrivers/March33/march33_620.prx",
"ISODrivers/Inferno/inferno.prx",
"Popcorn/popcorn.prx",
"Satelite/satelite.prx",
"Stargate/stargate.prx",
"SystemControl/systemctrl.prx",
... | [
[
1,
0,
0.1071,
0.0357,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
2,
0,
0.5357,
0.75,
0,
0.66,
0.5,
624,
0,
0,
0,
0,
0,
0,
3
],
[
14,
1,
0.4286,
0.4643,
1,
0.93,
... | [
"import os",
"def main():\n\tlists = [\n\t\t\t\"ISODrivers/Galaxy/galaxy.prx\",\n\t\t\t\"ISODrivers/March33/march33.prx\",\n\t\t\t\"ISODrivers/March33/march33_620.prx\",\n\t\t\t\"ISODrivers/Inferno/inferno.prx\",\n\t\t\t\"Popcorn/popcorn.prx\",\n\t\t\t\"Satelite/satelite.prx\",",
"\tlists = [\n\t\t\t\"ISODriver... |
#!/usr/bin/python
class FakeTime:
def time(self):
return 1225856967.109
import os, gzip, StringIO
gzip.time = FakeTime()
def create_gzip(input, output):
f_in=open(input, 'rb')
temp=StringIO.StringIO()
f=gzip.GzipFile(fileobj=temp, mode='wb')
f.writelines(f_in)
f.close()
f_in.close()
fout=open(out... | [
[
3,
0,
0.0909,
0.0682,
0,
0.66,
0,
425,
0,
1,
0,
0,
0,
0,
0
],
[
2,
1,
0.1023,
0.0455,
1,
0,
0,
654,
0,
1,
1,
0,
0,
0,
0
],
[
13,
2,
0.1136,
0.0227,
2,
0.77,
0... | [
"class FakeTime:\n def time(self):\n return 1225856967.109",
" def time(self):\n return 1225856967.109",
" return 1225856967.109",
"import os, gzip, StringIO",
"gzip.time = FakeTime()",
"def create_gzip(input, output):\n\tf_in=open(input, 'rb')\n\ttemp=StringIO.StringIO()\n\tf=g... |
#!/usr/bin/python
import os, sys, getopt
def usage():
print ("Usage: %s [-l size ] basefile input output" % (sys.argv[0]))
def write_file(fn, buf):
fp = open(fn, "wb")
fp.write(buf)
fp.close()
def main():
inputsize = 0
try:
optlist, args = getopt.getopt(sys.argv[1:], 'l:h')
except getopt.GetoptError:
us... | [
[
1,
0,
0.0536,
0.0179,
0,
0.66,
0,
688,
0,
3,
0,
0,
688,
0,
0
],
[
2,
0,
0.0982,
0.0357,
0,
0.66,
0.25,
129,
0,
0,
0,
0,
0,
0,
1
],
[
8,
1,
0.1071,
0.0179,
1,
0.53... | [
"import os, sys, getopt",
"def usage():\n\tprint (\"Usage: %s [-l size ] basefile input output\" % (sys.argv[0]))",
"\tprint (\"Usage: %s [-l size ] basefile input output\" % (sys.argv[0]))",
"def write_file(fn, buf):\n\tfp = open(fn, \"wb\")\n\tfp.write(buf)\n\tfp.close()",
"\tfp = open(fn, \"wb\")",
"\t... |
#!/usr/bin/env python
from distutils.core import setup
import os
def get_build():
path = "./.build"
if os.path.exists(path):
fp = open(path, "r")
build = eval(fp.read())
if os.path.exists("./.increase_build"):
build += 1
fp.close()
else:
build = 1
fp = open(path, "w")
fp.write(str(build))
fp.cl... | [
[
1,
0,
0.0938,
0.0312,
0,
0.66,
0,
152,
0,
1,
0,
0,
152,
0,
0
],
[
1,
0,
0.1562,
0.0312,
0,
0.66,
0.3333,
688,
0,
1,
0,
0,
688,
0,
0
],
[
2,
0,
0.4375,
0.5312,
0,
... | [
"from distutils.core import setup",
"import os",
"def get_build():\n\tpath = \"./.build\"\n\t\n\tif os.path.exists(path):\n\t\tfp = open(path, \"r\")\n\t\tbuild = eval(fp.read())\n\t\tif os.path.exists(\"./.increase_build\"):\n\t\t\tbuild += 1",
"\tpath = \"./.build\"",
"\tif os.path.exists(path):\n\t\tfp =... |
# -*- coding: utf-8 -*-
#
# pylast - A Python interface to Last.fm (and other API compatible social networks)
#
# Copyright 2008-2010 Amr Hassan
#
# 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 a... | [
[
14,
0,
0.0055,
0.0003,
0,
0.66,
0,
162,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.0057,
0.0003,
0,
0.66,
0.0079,
777,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.006,
0.0003,
0,
0.... | [
"__version__ = '0.5'",
"__author__ = 'Amr Hassan'",
"__copyright__ = \"Copyright (C) 2008-2010 Amr Hassan\"",
"__license__ = \"apache2\"",
"__email__ = 'amr.hassan@gmail.com'",
"import hashlib",
"from xml.dom import minidom",
"import xml.dom",
"import time",
"import shelve",
"import tempfile",
... |
# 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 law or agreed to in writing, ... | [
[
1,
0,
0.2586,
0.0172,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.2759,
0.0172,
0,
0.66,
0.1429,
971,
0,
1,
0,
0,
971,
0,
0
],
[
14,
0,
0.3103,
0.0172,
0,
... | [
"import os",
"import Options",
"srcdir = '.'",
"blddir = 'build'",
"VERSION = '0.1'",
"def set_options(opt):\n opt.tool_options('compiler_cxx')",
" opt.tool_options('compiler_cxx')",
"def configure(conf):\n conf.check_tool('compiler_cxx')\n conf.check_tool('node_addon')\n\n conf.env.append_value(... |
import os, sys
import Tkinter as tk
import tkFileDialog
import bootloader
class bootloadergui:
def __init__(self):
self.flash = []
self.importingfile=None
for i in range(0x6000):
self.flash.append(0xFF)
self.eeprom = []
for i in range(0x100):
... | [
[
1,
0,
0.0039,
0.0019,
0,
0.66,
0,
688,
0,
2,
0,
0,
688,
0,
0
],
[
1,
0,
0.0058,
0.0019,
0,
0.66,
0.2,
368,
0,
1,
0,
0,
368,
0,
0
],
[
1,
0,
0.0077,
0.0019,
0,
0.6... | [
"import os, sys",
"import Tkinter as tk",
"import tkFileDialog",
"import bootloader",
"class bootloadergui:\n\n def __init__(self):\n self.flash = []\n self.importingfile=None\n for i in range(0x6000):\n self.flash.append(0xFF)",
" def __init__(self):\n self.fl... |
import ctypes
import sys
if len(sys.argv) != 2:
print "Usage: %s <duty>\n" % sys.argv[0]
sys.exit(-1)
duty = int(sys.argv[1])
if (duty < 0) or (duty > 255):
print "Illegal duty cycle (%d) specified.\n" % duty
sys.exit(-1)
SET_RA1 = 1
CLR_RA1 = 2
GET_RA2 = 3
SET_DUTY = 4
usb = ctypes... | [
[
1,
0,
0.0667,
0.0333,
0,
0.66,
0,
182,
0,
1,
0,
0,
182,
0,
0
],
[
1,
0,
0.1,
0.0333,
0,
0.66,
0.0769,
509,
0,
1,
0,
0,
509,
0,
0
],
[
4,
0,
0.2,
0.1,
0,
0.66,
... | [
"import ctypes",
"import sys",
"if len(sys.argv) != 2:\n print(\"Usage: %s <duty>\\n\" % sys.argv[0])\n sys.exit(-1)",
" print(\"Usage: %s <duty>\\n\" % sys.argv[0])",
" sys.exit(-1)",
"duty = int(sys.argv[1])",
"if (duty < 0) or (duty > 255):\n print(\"Illegal duty cycle (%d) specified.\... |
import ctypes
SET_RA1 = 1
CLR_RA1 = 2
GET_RA2 = 3
SET_DUTY = 4
usb = ctypes.cdll.LoadLibrary('usb.dll')
usb.initialize()
buffer = ctypes.c_buffer(8)
dev = usb.open_device(0x6666, 0x0003, 0)
if dev<0:
print "No matching device found...\n"
else:
ret = usb.control_transfer(dev, 0x40, CLR_RA1,... | [
[
1,
0,
0.0952,
0.0476,
0,
0.66,
0,
182,
0,
1,
0,
0,
182,
0,
0
],
[
14,
0,
0.1905,
0.0476,
0,
0.66,
0.1111,
109,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.2381,
0.0476,
0,
... | [
"import ctypes",
"SET_RA1 = 1",
"CLR_RA1 = 2",
"GET_RA2 = 3",
"SET_DUTY = 4",
"usb = ctypes.cdll.LoadLibrary('usb.dll')",
"usb.initialize()",
"buffer = ctypes.c_buffer(8)",
"dev = usb.open_device(0x6666, 0x0003, 0)",
"if dev<0:\n print(\"No matching device found...\\n\")\nelse:\n ret = usb.c... |
"""Wrapper classes for use with tkinter.
This module provides the following classes:
Gui: a sublass of Tk that provides wrappers for most
of the widget-creating methods from Tk. The advantages of
these wrappers is that they use Python's optional argument capability
to provide appropriate default values, and that the... | [
[
8,
0,
0.0433,
0.0852,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0907,
0.0014,
0,
0.66,
0.037,
526,
0,
1,
0,
0,
526,
0,
0
],
[
1,
0,
0.092,
0.0014,
0,
0.66,
... | [
"\"\"\"Wrapper classes for use with tkinter.\n\nThis module provides the following classes:\n\nGui: a sublass of Tk that provides wrappers for most\nof the widget-creating methods from Tk. The advantages of\nthese wrappers is that they use Python's optional argument capability\nto provide appropriate default value... |
from Tkinter import *
import math
import ctypes
SET_SERVO = 1
KILL_CREEPA = 2
TOWERTIMEARRAY = 3
KILL_CREEPB = 4
GET_RA0 = 5
FIRING = 6
GET_TOWERTYPE = 7
GET_TOWERPOS = 8
GET_TICK = 9
#[(32, 16, math.pi/4),(29, 24, 13*math.pi/12),(29, 33, math.pi/24),(9, 34, 23*math.pi/24),(17, 21.5, 13*math.pi/12),(9... | [
[
1,
0,
0.0126,
0.0063,
0,
0.66,
0,
368,
0,
1,
0,
0,
368,
0,
0
],
[
1,
0,
0.0189,
0.0063,
0,
0.66,
0.0182,
526,
0,
1,
0,
0,
526,
0,
0
],
[
1,
0,
0.0252,
0.0063,
0,
... | [
"from Tkinter import *",
"import math",
"import ctypes",
"SET_SERVO = 1",
"KILL_CREEPA = 2",
"TOWERTIMEARRAY = 3",
"KILL_CREEPB = 4",
"GET_RA0 = 5",
"FIRING = 6",
"GET_TOWERTYPE = 7",
"GET_TOWERPOS = 8",
"GET_TICK = 9",
"usb = ctypes.cdll.LoadLibrary('usb.dll')",
"usb.initialize()",
"buf... |
from Tkinter import *
import ctypes
SET_SERVO = 1
KILL_CREEPA = 2
KILL_CREEPB = 3
SET_DUTY = 4
global servospot
servospot=0
print "set servospot"
opponentpin = []
playerpin = []
usb = ctypes.cdll.LoadLibrary('usb.dll')
usb.initialize()
print "hey o"
buffer = ctypes.c_buffer(8)
player=True
de... | [
[
1,
0,
0.0155,
0.0078,
0,
0.66,
0,
368,
0,
1,
0,
0,
368,
0,
0
],
[
1,
0,
0.0233,
0.0078,
0,
0.66,
0.0323,
182,
0,
1,
0,
0,
182,
0,
0
],
[
14,
0,
0.0388,
0.0078,
0,
... | [
"from Tkinter import *",
"import ctypes",
"SET_SERVO = 1",
"KILL_CREEPA = 2",
"KILL_CREEPB = 3",
"SET_DUTY = 4",
"servospot=0",
"print(\"set servospot\")",
"opponentpin = []",
"playerpin = []",
"usb = ctypes.cdll.LoadLibrary('usb.dll')",
"usb.initialize()",
"print(\"hey o\")",
"buffer = ct... |
import ctypes
SET_RA1 = 1
CLR_RA1 = 2
GET_RA2 = 3
SET_DUTY = 4
usb = ctypes.cdll.LoadLibrary('usb.dll')
usb.initialize()
buffer = ctypes.c_buffer(8)
dev = usb.open_device(0x6666, 0x0003, 0)
if dev<0:
print "No matching device found...\n"
else:
ret = usb.control_transfer(dev, 0xC0, GET_RA2,... | [
[
1,
0,
0.087,
0.0435,
0,
0.66,
0,
182,
0,
1,
0,
0,
182,
0,
0
],
[
14,
0,
0.1739,
0.0435,
0,
0.66,
0.1111,
109,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.2174,
0.0435,
0,
0... | [
"import ctypes",
"SET_RA1 = 1",
"CLR_RA1 = 2",
"GET_RA2 = 3",
"SET_DUTY = 4",
"usb = ctypes.cdll.LoadLibrary('usb.dll')",
"usb.initialize()",
"buffer = ctypes.c_buffer(8)",
"dev = usb.open_device(0x6666, 0x0003, 0)",
"if dev<0:\n print(\"No matching device found...\\n\")\nelse:\n ret = usb.c... |
import ctypes
SET_RA1 = 1
CLR_RA1 = 2
GET_RA2 = 3
SET_DUTY = 4
usb = ctypes.cdll.LoadLibrary('usb.dll')
usb.initialize()
buffer = ctypes.c_buffer(8)
dev = usb.open_device(0x6666, 0x0003, 0)
if dev<0:
print "No matching device found...\n"
else:
ret = usb.control_transfer(dev, 0x00, 0x09, 1,... | [
[
1,
0,
0.0952,
0.0476,
0,
0.66,
0,
182,
0,
1,
0,
0,
182,
0,
0
],
[
14,
0,
0.1905,
0.0476,
0,
0.66,
0.1111,
109,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.2381,
0.0476,
0,
... | [
"import ctypes",
"SET_RA1 = 1",
"CLR_RA1 = 2",
"GET_RA2 = 3",
"SET_DUTY = 4",
"usb = ctypes.cdll.LoadLibrary('usb.dll')",
"usb.initialize()",
"buffer = ctypes.c_buffer(8)",
"dev = usb.open_device(0x6666, 0x0003, 0)",
"if dev<0:\n print(\"No matching device found...\\n\")\nelse:\n ret = usb.c... |
import ctypes
SET_RA1 = 1
CLR_RA1 = 2
GET_RA2 = 3
SET_DUTY = 4
usb = ctypes.cdll.LoadLibrary('usb.dll')
usb.initialize()
buffer = ctypes.c_buffer(8)
dev = usb.open_device(0x6666, 0x0003, 0)
if dev<0:
print "No matching device found...\n"
else:
ret = usb.control_transfer(dev, 0x40, SET_RA1,... | [
[
1,
0,
0.0952,
0.0476,
0,
0.66,
0,
182,
0,
1,
0,
0,
182,
0,
0
],
[
14,
0,
0.1905,
0.0476,
0,
0.66,
0.1111,
109,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.2381,
0.0476,
0,
... | [
"import ctypes",
"SET_RA1 = 1",
"CLR_RA1 = 2",
"GET_RA2 = 3",
"SET_DUTY = 4",
"usb = ctypes.cdll.LoadLibrary('usb.dll')",
"usb.initialize()",
"buffer = ctypes.c_buffer(8)",
"dev = usb.open_device(0x6666, 0x0003, 0)",
"if dev<0:\n print(\"No matching device found...\\n\")\nelse:\n ret = usb.c... |
#!/usr/bin/python
from decimal import Decimal, getcontext
getcontext.prec = 10
from copy import copy
import os
import random
import time
import tkFileDialog
import tkMessageBox
import tkSimpleDialog
import pickle
import math
import generate
import graphmath
from copy import deepcopy
from math import ... | [
[
1,
0,
0.0014,
0.0005,
0,
0.66,
0,
349,
0,
2,
0,
0,
349,
0,
0
],
[
14,
0,
0.0019,
0.0005,
0,
0.66,
0.0323,
365,
1,
0,
0,
0,
0,
1,
0
],
[
1,
0,
0.0028,
0.0005,
0,
0... | [
"from decimal import Decimal, getcontext",
"getcontext.prec = 10",
"from copy import copy",
"import os",
"import random",
"import time",
"import tkFileDialog",
"import tkMessageBox",
"import tkSimpleDialog",
"import pickle",
"import math",
"import generate",
"import graphmath",
"from copy ... |
#!/usr/bin/python
from decimal import Decimal, getcontext
getcontext.prec = 10
from copy import copy
import os
import random
import time
import tkFileDialog
import tkMessageBox
import tkSimpleDialog
import pickle
import math
import generate
import graphmath
from copy import deepcopy
from math import ... | [
[
1,
0,
0.0014,
0.0005,
0,
0.66,
0,
349,
0,
2,
0,
0,
349,
0,
0
],
[
14,
0,
0.0019,
0.0005,
0,
0.66,
0.0323,
365,
1,
0,
0,
0,
0,
1,
0
],
[
1,
0,
0.0028,
0.0005,
0,
0... | [
"from decimal import Decimal, getcontext",
"getcontext.prec = 10",
"from copy import copy",
"import os",
"import random",
"import time",
"import tkFileDialog",
"import tkMessageBox",
"import tkSimpleDialog",
"import pickle",
"import math",
"import generate",
"import graphmath",
"from copy ... |
"""Wrapper classes for use with tkinter.
This module provides the following classes:
Gui: a sublass of Tk that provides wrappers for most
of the widget-creating methods from Tk. The advantages of
these wrappers is that they use Python's optional argument capability
to provide appropriate default values, and that the... | [
[
8,
0,
0.0433,
0.0852,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0907,
0.0014,
0,
0.66,
0.037,
526,
0,
1,
0,
0,
526,
0,
0
],
[
1,
0,
0.092,
0.0014,
0,
0.66,
... | [
"\"\"\"Wrapper classes for use with tkinter.\n\nThis module provides the following classes:\n\nGui: a sublass of Tk that provides wrappers for most\nof the widget-creating methods from Tk. The advantages of\nthese wrappers is that they use Python's optional argument capability\nto provide appropriate default value... |
import math
def delimeters(gear_pos):
g1 = gear_pos[-1]
g2 = gear_pos[0]
dist = 0
d = []
for i in range(len(gear_pos)):
gear = gear_pos[i-1]
to_gear = gear_pos[i]
from_gear = gear_pos[i-2]
(t1,t2) = cctangent(from_gear, gear)
(t3, t4)... | [
[
1,
0,
0.0125,
0.0125,
0,
0.66,
0,
526,
0,
1,
0,
0,
526,
0,
0
],
[
2,
0,
0.275,
0.4875,
0,
0.66,
0.25,
288,
0,
1,
1,
0,
0,
0,
17
],
[
14,
1,
0.05,
0.0125,
1,
0.7,
... | [
"import math",
"def delimeters(gear_pos):\n g1 = gear_pos[-1]\n g2 = gear_pos[0]\n \n dist = 0\n d = []\n \n for i in range(len(gear_pos)):",
" g1 = gear_pos[-1]",
" g2 = gear_pos[0]",
" dist = 0",
" d = []",
" for i in range(len(gear_pos)):\n gear = gear_pos[i... |
from Tkinter import *
import ctypes
SET_SERVO = 1
##CLR_RA1 = 2
##GET_RA2 = 3
##SET_DUTY = 4
global servospot
servospot=0
print "set servospot"
usb = ctypes.cdll.LoadLibrary('usb.dll')
usb.initialize()
print "hey o"
buffer = ctypes.c_buffer(8)
##def set_ra1_callback():
## usb.control_transf... | [
[
1,
0,
0.018,
0.009,
0,
0.66,
0,
368,
0,
1,
0,
0,
368,
0,
0
],
[
1,
0,
0.027,
0.009,
0,
0.66,
0.0526,
182,
0,
1,
0,
0,
182,
0,
0
],
[
14,
0,
0.045,
0.009,
0,
0.66,... | [
"from Tkinter import *",
"import ctypes",
"SET_SERVO = 1",
"servospot=0",
"print(\"set servospot\")",
"usb = ctypes.cdll.LoadLibrary('usb.dll')",
"usb.initialize()",
"print(\"hey o\")",
"buffer = ctypes.c_buffer(8)",
"def set_servo_callback(value):\n global servospot\n servospot=int(value)\n... |
# explore the mouse wheel with the Tkinter GUI toolkit
# Windows and Linux generate different events
# tested with Python25
import Tkinter as tk
def mouse_wheel(event):
global count
# respond to Linux or Windows wheel event
if event.num == 5 or event.delta == -120:
count -= 1
if e... | [
[
1,
0,
0.1515,
0.0303,
0,
0.66,
0,
368,
0,
1,
0,
0,
368,
0,
0
],
[
2,
0,
0.3182,
0.2424,
0,
0.66,
0.0909,
419,
0,
1,
0,
0,
0,
0,
0
],
[
4,
1,
0.3182,
0.0606,
1,
0.... | [
"import Tkinter as tk",
"def mouse_wheel(event):\n global count\n # respond to Linux or Windows wheel event\n if event.num == 5 or event.delta == -120:\n count -= 1\n if event.num == 4 or event.delta == 120:\n count += 1\n label['text'] = count",
" if event.num == 5 or event.delt... |
from visual import *
from Blokus import *
from PieceTest import *
def draw_piece(piece,n):
color_index = [color.red,color.blue,color.green,color.yellow]
for (x,y) in piece.geometry:
box (pos = (-100 + x+n,y,0),size = (2,2,1), color = color_index[piece.color])
selected = display(title = ... | [
[
1,
0,
0.0303,
0.0303,
0,
0.66,
0,
548,
0,
1,
0,
0,
548,
0,
0
],
[
1,
0,
0.0606,
0.0303,
0,
0.66,
0.0833,
535,
0,
1,
0,
0,
535,
0,
0
],
[
1,
0,
0.0909,
0.0303,
0,
... | [
"from visual import *",
"from Blokus import *",
"from PieceTest import *",
"def draw_piece(piece,n):\n color_index = [color.red,color.blue,color.green,color.yellow]\n for (x,y) in piece.geometry:\n box (pos = (-100 + x+n,y,0),size = (2,2,1), color = color_index[piece.color])",
" color_index ... |
from Gui import *
import ctypes
import threading
import math
import time
##usb = ctypes.cdll.LoadLibrary('usb.dll')
##usb.initialize()
##buffer = ctypes.c_buffer(8)
##def set_ra1_callback():
## usb.control_transfer(dev, 0x40, SET_RA1, 0, 0, 0, buffer)
##
##def clr_ra1_callback():
## usb.control_transf... | [
[
1,
0,
0.0023,
0.0023,
0,
0.66,
0,
55,
0,
1,
0,
0,
55,
0,
0
],
[
1,
0,
0.0047,
0.0023,
0,
0.66,
0.0909,
182,
0,
1,
0,
0,
182,
0,
0
],
[
1,
0,
0.007,
0.0023,
0,
0.6... | [
"from Gui import *",
"import ctypes",
"import threading",
"import math",
"import time",
"class TowerGUI(Gui):\n def __init__(self):\n Gui.__init__(self)\n self.title('Creep Path GUI')\n self.ca_width = 1000\n self.ca_height = 800\n self.fr(LEFT, expand = 1)\n s... |
# -*- coding: utf-8 -*-
#
# jQuery File Upload Plugin GAE Python Example 2.1.0
# https://github.com/blueimp/jQuery-File-Upload
#
# Copyright 2011, Sebastian Tschan
# https://blueimp.net
#
# Licensed under the MIT license:
# http://www.opensource.org/licenses/MIT
#
from __future__ import with_statement
from google.appe... | [
[
1,
0,
0.0788,
0.0061,
0,
0.66,
0,
777,
0,
1,
0,
0,
777,
0,
0
],
[
1,
0,
0.0848,
0.0061,
0,
0.66,
0.0556,
279,
0,
2,
0,
0,
279,
0,
0
],
[
1,
0,
0.0909,
0.0061,
0,
... | [
"from __future__ import with_statement",
"from google.appengine.api import files, images",
"from google.appengine.ext import blobstore, deferred",
"from google.appengine.ext.webapp import blobstore_handlers",
"import json",
"import re",
"import urllib",
"import webapp2",
"WEBSITE = 'http://blueimp.g... |
# -*- coding: utf-8 -*-
#
# jQuery File Upload Plugin GAE Python Example 2.1.0
# https://github.com/blueimp/jQuery-File-Upload
#
# Copyright 2011, Sebastian Tschan
# https://blueimp.net
#
# Licensed under the MIT license:
# http://www.opensource.org/licenses/MIT
#
from __future__ import with_statement
from google.appe... | [
[
1,
0,
0.0788,
0.0061,
0,
0.66,
0,
777,
0,
1,
0,
0,
777,
0,
0
],
[
1,
0,
0.0848,
0.0061,
0,
0.66,
0.0556,
279,
0,
2,
0,
0,
279,
0,
0
],
[
1,
0,
0.0909,
0.0061,
0,
... | [
"from __future__ import with_statement",
"from google.appengine.api import files, images",
"from google.appengine.ext import blobstore, deferred",
"from google.appengine.ext.webapp import blobstore_handlers",
"import json",
"import re",
"import urllib",
"import webapp2",
"WEBSITE = 'http://blueimp.g... |
from sys import stdin
a, b, c = map(int, stdin.readline().strip().split())
print "%.3lf" % ((a+b+c)/3.0)
| [
[
1,
0,
0.3333,
0.3333,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
14,
0,
0.6667,
0.3333,
0,
0.66,
0.5,
256,
3,
2,
0,
0,
53,
10,
4
],
[
8,
0,
1,
0.3333,
0,
0.66,
... | [
"from sys import stdin",
"a, b, c = map(int, stdin.readline().strip().split())",
"print(\"%.3lf\" % ((a+b+c)/3.0))"
] |
from sys import stdin
from math import *
r, h = map(float, stdin.readline().strip().split())
print "Area = %.3lf" % (pi*r*r*2 + 2*pi*r*h)
| [
[
1,
0,
0.25,
0.25,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.5,
0.25,
0,
0.66,
0.3333,
526,
0,
1,
0,
0,
526,
0,
0
],
[
14,
0,
0.75,
0.25,
0,
0.66,
0.... | [
"from sys import stdin",
"from math import *",
"r, h = map(float, stdin.readline().strip().split())",
"print(\"Area = %.3lf\" % (pi*r*r*2 + 2*pi*r*h))"
] |
from sys import stdin
from math import *
n, = map(int, stdin.readline().strip().split())
rad = radians(n)
print "%.3lf %.3lf" % (sin(rad), cos(rad))
| [
[
1,
0,
0.2,
0.2,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.4,
0.2,
0,
0.66,
0.25,
526,
0,
1,
0,
0,
526,
0,
0
],
[
14,
0,
0.6,
0.2,
0,
0.66,
0.5,
... | [
"from sys import stdin",
"from math import *",
"n, = map(int, stdin.readline().strip().split())",
"rad = radians(n)",
"print(\"%.3lf %.3lf\" % (sin(rad), cos(rad)))"
] |
from sys import stdin
n, = map(int, stdin.readline().strip().split())
print n*(n+1)/2
| [
[
1,
0,
0.3333,
0.3333,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
14,
0,
0.6667,
0.3333,
0,
0.66,
0.5,
773,
3,
2,
0,
0,
53,
10,
4
],
[
8,
0,
1,
0.3333,
0,
0.66,
... | [
"from sys import stdin",
"n, = map(int, stdin.readline().strip().split())",
"print(n*(n+1)/2)"
] |
from sys import stdin
a, b = map(int, stdin.readline().strip().split())
print b, a
| [
[
1,
0,
0.25,
0.25,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
14,
0,
0.5,
0.25,
0,
0.66,
0.5,
127,
3,
2,
0,
0,
53,
10,
4
],
[
8,
0,
0.75,
0.25,
0,
0.66,
1,
... | [
"from sys import stdin",
"a, b = map(int, stdin.readline().strip().split())",
"print(b, a)"
] |
from sys import stdin
n, m = map(int, stdin.readline().strip().split())
a = (4*n-m)/2
b = n-a
if m % 2 == 1 or a < 0 or b < 0: print "No answer"
else: print a, b
| [
[
1,
0,
0.2,
0.2,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
14,
0,
0.4,
0.2,
0,
0.66,
0.3333,
51,
3,
2,
0,
0,
53,
10,
4
],
[
14,
0,
0.6,
0.2,
0,
0.66,
0.6667,... | [
"from sys import stdin",
"n, m = map(int, stdin.readline().strip().split())",
"a = (4*n-m)/2",
"b = n-a"
] |
from sys import stdin
n, = map(int, stdin.readline().strip().split())
money = n * 95
if money >= 300: money *= 0.85
print "%.2lf" % money
| [
[
1,
0,
0.2,
0.2,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
14,
0,
0.4,
0.2,
0,
0.66,
0.25,
773,
3,
2,
0,
0,
53,
10,
4
],
[
14,
0,
0.6,
0.2,
0,
0.66,
0.5,
... | [
"from sys import stdin",
"n, = map(int, stdin.readline().strip().split())",
"money = n * 95",
"if money >= 300: money *= 0.85",
"print(\"%.2lf\" % money)"
] |
from sys import stdin
n, = map(int, stdin.readline().strip().split())
print ["yes", "no"][n % 2]
| [
[
1,
0,
0.3333,
0.3333,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
14,
0,
0.6667,
0.3333,
0,
0.66,
0.5,
773,
3,
2,
0,
0,
53,
10,
4
],
[
8,
0,
1,
0.3333,
0,
0.66,
... | [
"from sys import stdin",
"n, = map(int, stdin.readline().strip().split())",
"print [\"yes\", \"no\"][n % 2]"
] |
from sys import stdin
from math import *
x1, y1, x2, y2 = map(float, stdin.readline().strip().split())
print "%.3lf" % hypot((x1-x2), (y1-y2))
| [
[
1,
0,
0.25,
0.25,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.5,
0.25,
0,
0.66,
0.3333,
526,
0,
1,
0,
0,
526,
0,
0
],
[
14,
0,
0.75,
0.25,
0,
0.66,
0.... | [
"from sys import stdin",
"from math import *",
"x1, y1, x2, y2 = map(float, stdin.readline().strip().split())",
"print(\"%.3lf\" % hypot((x1-x2), (y1-y2)))"
] |
from sys import stdin
n = stdin.readline().strip().split()[0]
print '%c%c%c' % (n[2], n[1], n[0])
| [
[
1,
0,
0.25,
0.25,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
14,
0,
0.5,
0.25,
0,
0.66,
0.5,
773,
6,
0,
0,
0,
0,
0,
3
],
[
8,
0,
0.75,
0.25,
0,
0.66,
1,
... | [
"from sys import stdin",
"n = stdin.readline().strip().split()[0]",
"print('%c%c%c' % (n[2], n[1], n[0]))"
] |
from sys import stdin
x, = map(float, stdin.readline().strip().split())
print abs(x)
| [
[
1,
0,
0.3333,
0.3333,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
14,
0,
0.6667,
0.3333,
0,
0.66,
0.5,
190,
3,
2,
0,
0,
53,
10,
4
],
[
8,
0,
1,
0.3333,
0,
0.66,
... | [
"from sys import stdin",
"x, = map(float, stdin.readline().strip().split())",
"print(abs(x))"
] |
from sys import stdin
from calendar import isleap
year, = map(int, stdin.readline().strip().split())
if isleap(year): print "yes"
else: print "no"
| [
[
1,
0,
0.3333,
0.3333,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.6667,
0.3333,
0,
0.66,
0.5,
917,
0,
1,
0,
0,
917,
0,
0
],
[
14,
0,
1,
0.3333,
0,
0.66,
... | [
"from sys import stdin",
"from calendar import isleap",
"year, = map(int, stdin.readline().strip().split())"
] |
from sys import stdin
f, = map(float, stdin.readline().strip().split())
print "%.3lf" % (5*(f-32)/9)
| [
[
1,
0,
0.3333,
0.3333,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
14,
0,
0.6667,
0.3333,
0,
0.66,
0.5,
899,
3,
2,
0,
0,
53,
10,
4
],
[
8,
0,
1,
0.3333,
0,
0.66,
... | [
"from sys import stdin",
"f, = map(float, stdin.readline().strip().split())",
"print(\"%.3lf\" % (5*(f-32)/9))"
] |
from sys import stdin
a, b, c = map(int, stdin.readline().strip().split())
if a*a + b*b == c*c or a*a + c*c == b*b or b*b + c*c == a*a: print "yes"
elif a + b <= c or a + c <= b or b + c <= a: print "not a triangle"
else: print "no"
| [
[
1,
0,
1,
1,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
]
] | [
"from sys import stdin"
] |
from sys import stdin
a = map(int, stdin.readline().strip().split())
a.sort()
print a[0], a[1], a[2]
| [
[
1,
0,
0.2,
0.2,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
14,
0,
0.4,
0.2,
0,
0.66,
0.3333,
475,
3,
2,
0,
0,
53,
10,
4
],
[
8,
0,
0.6,
0.2,
0,
0.66,
0.6667,... | [
"from sys import stdin",
"a = map(int, stdin.readline().strip().split())",
"a.sort()",
"print(a[0], a[1], a[2])"
] |
s = i = 0
while True:
term = 1.0 / (i*2+1)
s += term * ((-1)**i)
if term < 1e-6: break
i += 1
print "%.6lf" % s
| [
[
14,
0,
0.1429,
0.1429,
0,
0.66,
0,
553,
1,
0,
0,
0,
0,
1,
0
],
[
5,
0,
0.5714,
0.7143,
0,
0.66,
0.5,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
1,
0.4286,
0.1429,
1,
0.87,
... | [
"s = i = 0",
"while True:\n term = 1.0 / (i*2+1)\n s += term * ((-1)**i)\n if term < 1e-6: break\n i += 1",
" term = 1.0 / (i*2+1)",
" if term < 1e-6: break",
"print(\"%.6lf\" % s)"
] |
from sys import stdin
from decimal import *
a, b, c = map(int, stdin.readline().strip().split())
getcontext().prec = c
print Decimal(a) / Decimal(b)
| [
[
1,
0,
0.2,
0.2,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.4,
0.2,
0,
0.66,
0.25,
349,
0,
1,
0,
0,
349,
0,
0
],
[
14,
0,
0.6,
0.2,
0,
0.66,
0.5,
... | [
"from sys import stdin",
"from decimal import *",
"a, b, c = map(int, stdin.readline().strip().split())",
"getcontext().prec = c",
"print(Decimal(a) / Decimal(b))"
] |
from sys import stdin
n = int(stdin.readline().strip())
print "%.3lf" % sum([1.0/x for x in range(1,n+1)])
| [
[
1,
0,
0.3333,
0.3333,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
14,
0,
0.6667,
0.3333,
0,
0.66,
0.5,
773,
3,
1,
0,
0,
901,
10,
3
],
[
8,
0,
1,
0.3333,
0,
0.66,
... | [
"from sys import stdin",
"n = int(stdin.readline().strip())",
"print(\"%.3lf\" % sum([1.0/x for x in range(1,n+1)]))"
] |
from sys import stdin
print len(stdin.readline().strip())
| [
[
1,
0,
0.5,
0.5,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
8,
0,
1,
0.5,
0,
0.66,
1,
535,
3,
1,
0,
0,
0,
0,
4
]
] | [
"from sys import stdin",
"print(len(stdin.readline().strip()))"
] |
from itertools import product
from math import *
def issqrt(n):
s = int(floor(sqrt(n)))
return s*s == n
aabb = [a*1100+b*11 for a,b in product(range(1,10),range(10))]
print ' '.join(map(str, filter(issqrt, aabb)))
| [
[
1,
0,
0.1111,
0.1111,
0,
0.66,
0,
808,
0,
1,
0,
0,
808,
0,
0
],
[
1,
0,
0.2222,
0.1111,
0,
0.66,
0.25,
526,
0,
1,
0,
0,
526,
0,
0
],
[
2,
0,
0.5556,
0.3333,
0,
0.... | [
"from itertools import product",
"from math import *",
"def issqrt(n):\n s = int(floor(sqrt(n)))\n return s*s == n",
" s = int(floor(sqrt(n)))",
" return s*s == n",
"aabb = [a*1100+b*11 for a,b in product(range(1,10),range(10))]",
"print(' '.join(map(str, filter(issqrt, aabb))))"
] |
from sys import stdin
a = map(int, stdin.readline().strip().split())
print "%d %d %.3lf" % (min(a), max(a), float(sum(a)) / len(a))
| [
[
1,
0,
0.3333,
0.3333,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
14,
0,
0.6667,
0.3333,
0,
0.66,
0.5,
475,
3,
2,
0,
0,
53,
10,
4
],
[
8,
0,
1,
0.3333,
0,
0.66,
... | [
"from sys import stdin",
"a = map(int, stdin.readline().strip().split())",
"print(\"%d %d %.3lf\" % (min(a), max(a), float(sum(a)) / len(a)))"
] |
from sys import stdin
def cycle(n):
if n == 1: return 0
elif n % 2 == 1: return cycle(n*3+1) + 1
else: return cycle(n/2) + 1
n = int(stdin.readline().strip())
print cycle(n)
| [
[
1,
0,
0.1111,
0.1111,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
2,
0,
0.5,
0.4444,
0,
0.66,
0.3333,
276,
0,
1,
1,
0,
0,
0,
2
],
[
4,
1,
0.5556,
0.3333,
1,
0.93,... | [
"from sys import stdin",
"def cycle(n):\n if n == 1: return 0\n elif n % 2 == 1: return cycle(n*3+1) + 1\n else: return cycle(n/2) + 1",
" if n == 1: return 0\n elif n % 2 == 1: return cycle(n*3+1) + 1\n else: return cycle(n/2) + 1",
" if n == 1: return 0",
" elif n % 2 == 1: return cycle(n*3+1) + 1... |
from sys import stdin
n = int(stdin.readline().strip())
count = n*2-1
for i in range(n):
print ' '*i + '#'*count
count -= 2
| [
[
1,
0,
0.1667,
0.1667,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
14,
0,
0.3333,
0.1667,
0,
0.66,
0.3333,
773,
3,
1,
0,
0,
901,
10,
3
],
[
14,
0,
0.5,
0.1667,
0,
... | [
"from sys import stdin",
"n = int(stdin.readline().strip())",
"count = n*2-1",
"for i in range(n):\n print(' '*i + '#'*count)\n count -= 2",
" print(' '*i + '#'*count)"
] |
for abc in range(123, 329):
big = str(abc) + str(abc*2) + str(abc*3)
if(''.join(sorted(big)) == '123456789'): print abc, abc*2, abc*3
| [
[
6,
0,
0.75,
1,
0,
0.66,
0,
38,
3,
0,
0,
0,
0,
0,
4
],
[
14,
1,
1,
0.5,
1,
0.36,
0,
235,
4,
0,
0,
0,
0,
0,
3
]
] | [
"for abc in range(123, 329):\n big = str(abc) + str(abc*2) + str(abc*3)",
" big = str(abc) + str(abc*2) + str(abc*3)"
] |
from sys import stdin
n, m = map(int, stdin.readline().strip().split())
print "%.5lf" % sum([1.0/i/i for i in range(n,m+1)])
| [
[
1,
0,
0.3333,
0.3333,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
14,
0,
0.6667,
0.3333,
0,
0.66,
0.5,
51,
3,
2,
0,
0,
53,
10,
4
],
[
8,
0,
1,
0.3333,
0,
0.66,
... | [
"from sys import stdin",
"n, m = map(int, stdin.readline().strip().split())",
"print(\"%.5lf\" % sum([1.0/i/i for i in range(n,m+1)]))"
] |
from sys import stdin
data = map(int, stdin.readline().strip().split())
n, m = data[0], data[-1]
data = data[1:-1]
print len(filter(lambda x: x < m, data))
| [
[
1,
0,
0.2,
0.2,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
14,
0,
0.4,
0.2,
0,
0.66,
0.25,
929,
3,
2,
0,
0,
53,
10,
4
],
[
14,
0,
0.6,
0.2,
0,
0.66,
0.5,
... | [
"from sys import stdin",
"data = map(int, stdin.readline().strip().split())",
"n, m = data[0], data[-1]",
"data = data[1:-1]",
"print(len(filter(lambda x: x < m, data)))"
] |
from sys import stdin
def solve(a, b, c):
for i in range(10, 101):
if i % 3 == a and i % 5 == b and i % 7 == c:
print i
return
print 'No answer'
a, b, c = map(int, stdin.readline().strip().split())
solve(a, b, c)
| [
[
1,
0,
0.0909,
0.0909,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
2,
0,
0.5,
0.5455,
0,
0.66,
0.3333,
599,
0,
3,
0,
0,
0,
0,
3
],
[
6,
1,
0.5,
0.3636,
1,
0.59,
... | [
"from sys import stdin",
"def solve(a, b, c):\n for i in range(10, 101):\n if i % 3 == a and i % 5 == b and i % 7 == c:\n print(i)\n return\n print('No answer')",
" for i in range(10, 101):\n if i % 3 == a and i % 5 == b and i % 7 == c:\n print(i)\n return",
" if i % 3 == a and... |
from itertools import product
sol = [a*100+b*10+c for a,b,c in product(range(1,10), range(10), range(10)) if a**3+b**3+c**3 == a*100+b*10+c]
print '\n'.join(map(str, sol))
| [
[
1,
0,
0.3333,
0.3333,
0,
0.66,
0,
808,
0,
1,
0,
0,
808,
0,
0
],
[
14,
0,
0.6667,
0.3333,
0,
0.66,
0.5,
723,
5,
0,
0,
0,
0,
0,
4
],
[
8,
0,
1,
0.3333,
0,
0.66,
... | [
"from itertools import product",
"sol = [a*100+b*10+c for a,b,c in product(range(1,10), range(10), range(10)) if a**3+b**3+c**3 == a*100+b*10+c]",
"print('\\n'.join(map(str, sol)))"
] |
from sys import stdin
from math import *
n = int(stdin.readline().strip())
print sum(map(factorial, range(1,n+1))) % (10**6)
| [
[
1,
0,
0.2,
0.2,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.4,
0.2,
0,
0.66,
0.3333,
526,
0,
1,
0,
0,
526,
0,
0
],
[
14,
0,
0.6,
0.2,
0,
0.66,
0.6667,... | [
"from sys import stdin",
"from math import *",
"n = int(stdin.readline().strip())",
"print(sum(map(factorial, range(1,n+1))) % (10**6))"
] |
#!/usr/bin/python2.6
#
# Simple http server to emulate api.playfoursquare.com
import logging
import shutil
import sys
import urlparse
import SimpleHTTPServer
import BaseHTTPServer
class RequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
"""Handle playfoursquare.com requests, for testing."""
def do_GET(self... | [
[
1,
0,
0.0588,
0.0118,
0,
0.66,
0,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.0706,
0.0118,
0,
0.66,
0.125,
614,
0,
1,
0,
0,
614,
0,
0
],
[
1,
0,
0.0824,
0.0118,
0,
0... | [
"import logging",
"import shutil",
"import sys",
"import urlparse",
"import SimpleHTTPServer",
"import BaseHTTPServer",
"class RequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):\n \"\"\"Handle playfoursquare.com requests, for testing.\"\"\"\n\n def do_GET(self):\n logging.warn('do_GET: %s, %s',... |
#!/usr/bin/python
import datetime
import sys
import textwrap
import common
from xml.dom import pulldom
PARSER = """\
/**
* Copyright 2009 Joe LaPenna
*/
package com.joelapenna.foursquare.parsers;
import com.joelapenna.foursquare.Foursquare;
import com.joelapenna.foursquare.error.FoursquareError;
import com.joel... | [
[
1,
0,
0.0201,
0.0067,
0,
0.66,
0,
426,
0,
1,
0,
0,
426,
0,
0
],
[
1,
0,
0.0268,
0.0067,
0,
0.66,
0.0769,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0336,
0.0067,
0,
... | [
"import datetime",
"import sys",
"import textwrap",
"import common",
"from xml.dom import pulldom",
"PARSER = \"\"\"\\\n/**\n * Copyright 2009 Joe LaPenna\n */\n\npackage com.joelapenna.foursquare.parsers;\n\nimport com.joelapenna.foursquare.Foursquare;",
"BOOLEAN_STANZA = \"\"\"\\\n } else i... |
#!/usr/bin/python
"""
Pull a oAuth protected page from foursquare.
Expects ~/.oget to contain (one on each line):
CONSUMER_KEY
CONSUMER_KEY_SECRET
USERNAME
PASSWORD
Don't forget to chmod 600 the file!
"""
import httplib
import os
import re
import sys
import urllib
import urllib2
import urlparse
import user
from xml.... | [
[
8,
0,
0.0631,
0.0991,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1261,
0.009,
0,
0.66,
0.05,
2,
0,
1,
0,
0,
2,
0,
0
],
[
1,
0,
0.1351,
0.009,
0,
0.66,
0.... | [
"\"\"\"\nPull a oAuth protected page from foursquare.\n\nExpects ~/.oget to contain (one on each line):\nCONSUMER_KEY\nCONSUMER_KEY_SECRET\nUSERNAME\nPASSWORD",
"import httplib",
"import os",
"import re",
"import sys",
"import urllib",
"import urllib2",
"import urlparse",
"import user",
"from xml.... |
#!/usr/bin/python
import os
import subprocess
import sys
BASEDIR = '../main/src/com/joelapenna/foursquare'
TYPESDIR = '../captures/types/v1'
captures = sys.argv[1:]
if not captures:
captures = os.listdir(TYPESDIR)
for f in captures:
basename = f.split('.')[0]
javaname = ''.join([c.capitalize() for c in basena... | [
[
1,
0,
0.1111,
0.037,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.1481,
0.037,
0,
0.66,
0.1429,
394,
0,
1,
0,
0,
394,
0,
0
],
[
1,
0,
0.1852,
0.037,
0,
0.6... | [
"import os",
"import subprocess",
"import sys",
"BASEDIR = '../main/src/com/joelapenna/foursquare'",
"TYPESDIR = '../captures/types/v1'",
"captures = sys.argv[1:]",
"if not captures:\n captures = os.listdir(TYPESDIR)",
" captures = os.listdir(TYPESDIR)",
"for f in captures:\n basename = f.split('... |
#!/usr/bin/python
import logging
from xml.dom import minidom
from xml.dom import pulldom
BOOLEAN = "boolean"
STRING = "String"
GROUP = "Group"
# Interfaces that all FoursquareTypes implement.
DEFAULT_INTERFACES = ['FoursquareType']
# Interfaces that specific FoursqureTypes implement.
INTERFACES = {
}
DEFAULT_CLA... | [
[
1,
0,
0.0263,
0.0088,
0,
0.66,
0,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.0439,
0.0088,
0,
0.66,
0.0833,
290,
0,
1,
0,
0,
290,
0,
0
],
[
1,
0,
0.0526,
0.0088,
0,
... | [
"import logging",
"from xml.dom import minidom",
"from xml.dom import pulldom",
"BOOLEAN = \"boolean\"",
"STRING = \"String\"",
"GROUP = \"Group\"",
"DEFAULT_INTERFACES = ['FoursquareType']",
"INTERFACES = {\n}",
"DEFAULT_CLASS_IMPORTS = [\n]",
"CLASS_IMPORTS = {\n# 'Checkin': DEFAULT_CLASS_IMP... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2011 by Alessandro Presta
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the... | [
[
8,
0,
0.1149,
0.1255,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1809,
0.0021,
0,
0.66,
0.1,
777,
0,
1,
0,
0,
777,
0,
0
],
[
1,
0,
0.1851,
0.0021,
0,
0.66,
... | [
"'''\n======\ntagger\n======\n\nModule for extracting tags from text documents.\n \nCopyright (C) 2011 by Alessandro Presta",
"from __future__ import division",
"import collections",
"import re",
"class Tag:\n '''\n General class for tags (small units of text)\n '''\n \n def... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2011 by Alessandro Presta
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the... | [
[
8,
0,
0.1149,
0.1255,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1809,
0.0021,
0,
0.66,
0.1,
777,
0,
1,
0,
0,
777,
0,
0
],
[
1,
0,
0.1851,
0.0021,
0,
0.66,
... | [
"'''\n======\ntagger\n======\n\nModule for extracting tags from text documents.\n \nCopyright (C) 2011 by Alessandro Presta",
"from __future__ import division",
"import collections",
"import re",
"class Tag:\n '''\n General class for tags (small units of text)\n '''\n \n def... |
# -*- coding: utf8 -*-
from fuzzywuzzy import fuzz
from fuzzywuzzy import process
from fuzzywuzzy import utils
import itertools
import unittest
class UtilsTest(unittest.TestCase):
def setUp(self):
self.s1 = "new york mets"
self.s1a = "new york mets"
self.s2 = "new YORK mets"
self.... | [
[
1,
0,
0.0105,
0.0035,
0,
0.66,
0,
720,
0,
1,
0,
0,
720,
0,
0
],
[
1,
0,
0.014,
0.0035,
0,
0.66,
0.125,
720,
0,
1,
0,
0,
720,
0,
0
],
[
1,
0,
0.0175,
0.0035,
0,
0.... | [
"from fuzzywuzzy import fuzz",
"from fuzzywuzzy import process",
"from fuzzywuzzy import utils",
"import itertools",
"import unittest",
"class UtilsTest(unittest.TestCase):\n def setUp(self):\n self.s1 = \"new york mets\"\n self.s1a = \"new york mets\"\n self.s2 = \"new YORK mets\"... |
import string
bad_chars=''
for i in range(128,256):
bad_chars+=chr(i)
table_from=string.punctuation+string.ascii_uppercase
table_to=' '*len(string.punctuation)+string.ascii_lowercase
trans_table=string.maketrans(table_from, table_to)
def asciionly(s):
return s.translate(None, bad_chars)
# remove non-ASCII c... | [
[
1,
0,
0.025,
0.025,
0,
0.66,
0,
890,
0,
1,
0,
0,
890,
0,
0
],
[
14,
0,
0.075,
0.025,
0,
0.66,
0.1,
74,
1,
0,
0,
0,
0,
3,
0
],
[
6,
0,
0.1125,
0.05,
0,
0.66,
0... | [
"import string",
"bad_chars=''",
"for i in range(128,256):\n bad_chars+=chr(i)",
"table_from=string.punctuation+string.ascii_uppercase",
"table_to=' '*len(string.punctuation)+string.ascii_lowercase",
"trans_table=string.maketrans(table_from, table_to)",
"def asciionly(s):\n return s.translate(None... |
#!/usr/bin/env python
# encoding: utf-8
"""
process.py
Copyright (c) 2011 Adam Cohen
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights t... | [
[
8,
0,
0.1667,
0.2759,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.3103,
0.0115,
0,
0.66,
0.2,
390,
0,
1,
0,
0,
390,
0,
0
],
[
1,
0,
0.3333,
0.0115,
0,
0.66,
... | [
"\"\"\"\nprocess.py\n\nCopyright (c) 2011 Adam Cohen\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including",
"from fuzz import *",
"import sys, os",
"impor... |
#!/usr/bin/env python
# encoding: utf-8
"""
score.py
Copyright (c) 2011 Adam Cohen
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to ... | [
[
8,
0,
0.0659,
0.1091,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1273,
0.0045,
0,
0.66,
0.0625,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.1318,
0.0045,
0,
0.66... | [
"\"\"\"\nscore.py\n\nCopyright (c) 2011 Adam Cohen\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including",
"import sys",
"import os",
"import re",
"from ... |
#!/usr/bin/env python
# encoding: utf-8
"""
StringMatcher.py
ported from python-Levenshtein
[https://github.com/miohtama/python-Levenshtein]
"""
from Levenshtein import *
from warnings import warn
class StringMatcher:
"""A SequenceMatcher-like class built on the top of Levenshtein"""
def _reset_cache(self):... | [
[
8,
0,
0.0705,
0.0769,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1282,
0.0128,
0,
0.66,
0.3333,
920,
0,
1,
0,
0,
920,
0,
0
],
[
1,
0,
0.141,
0.0128,
0,
0.66,... | [
"\"\"\"\nStringMatcher.py\n\nported from python-Levenshtein\n[https://github.com/miohtama/python-Levenshtein]\n\"\"\"",
"from Levenshtein import *",
"from warnings import warn",
"class StringMatcher:\n \"\"\"A SequenceMatcher-like class built on the top of Levenshtein\"\"\"\n\n def _reset_cache(self):\n... |
#!/usr/bin/env python
# encoding: utf-8
"""
process.py
Copyright (c) 2011 Adam Cohen
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights t... | [
[
8,
0,
0.1667,
0.2759,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.3103,
0.0115,
0,
0.66,
0.2,
390,
0,
1,
0,
0,
390,
0,
0
],
[
1,
0,
0.3333,
0.0115,
0,
0.66,
... | [
"\"\"\"\nprocess.py\n\nCopyright (c) 2011 Adam Cohen\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including",
"from fuzz import *",
"import sys, os",
"impor... |
#!/usr/bin/env python
# encoding: utf-8
"""
StringMatcher.py
ported from python-Levenshtein
[https://github.com/miohtama/python-Levenshtein]
"""
from Levenshtein import *
from warnings import warn
class StringMatcher:
"""A SequenceMatcher-like class built on the top of Levenshtein"""
def _reset_cache(self):... | [
[
8,
0,
0.0705,
0.0769,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1282,
0.0128,
0,
0.66,
0.3333,
920,
0,
1,
0,
0,
920,
0,
0
],
[
1,
0,
0.141,
0.0128,
0,
0.66,... | [
"\"\"\"\nStringMatcher.py\n\nported from python-Levenshtein\n[https://github.com/miohtama/python-Levenshtein]\n\"\"\"",
"from Levenshtein import *",
"from warnings import warn",
"class StringMatcher:\n \"\"\"A SequenceMatcher-like class built on the top of Levenshtein\"\"\"\n\n def _reset_cache(self):\n... |
#!/usr/bin/env python
# encoding: utf-8
"""
score.py
Copyright (c) 2011 Adam Cohen
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to ... | [
[
8,
0,
0.0659,
0.1091,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1273,
0.0045,
0,
0.66,
0.0625,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.1318,
0.0045,
0,
0.66... | [
"\"\"\"\nscore.py\n\nCopyright (c) 2011 Adam Cohen\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including",
"import sys",
"import os",
"import re",
"from ... |
from distutils.core import setup
setup(name='fuzzywuzzy',
version='0.1',
description='Fuzzy string matching in python',
author='Adam Cohen',
author_email='adam@seatgeek.com',
url='https://github.com/seatgeek/fuzzywuzzy/',
packages=['fuzzywuzzy']) | [
[
1,
0,
0.1111,
0.1111,
0,
0.66,
0,
152,
0,
1,
0,
0,
152,
0,
0
],
[
8,
0,
0.6667,
0.7778,
0,
0.66,
1,
234,
3,
7,
0,
0,
0,
0,
1
]
] | [
"from distutils.core import setup",
"setup(name='fuzzywuzzy',\n version='0.1',\n description='Fuzzy string matching in python',\n author='Adam Cohen',\n author_email='adam@seatgeek.com',\n url='https://github.com/seatgeek/fuzzywuzzy/',\n packages=['fuzzywuzzy'])"
] |
# -*- coding: utf8 -*-
from timeit import timeit
from fuzzywuzzy import utils
iterations=100000
cirque_strings = [
"cirque du soleil - zarkana - las vegas",
"cirque du soleil ",
"cirque du soleil las vegas",
"zarkana las vegas",
"las vegas cirque du soleil at the bellagio",
"zarakana - cirque... | [
[
1,
0,
0.3333,
0.3333,
0,
0.66,
0,
200,
0,
1,
0,
0,
200,
0,
0
],
[
1,
0,
0.6667,
0.3333,
0,
0.66,
1,
720,
0,
1,
0,
0,
720,
0,
0
]
] | [
"from timeit import timeit",
"from fuzzywuzzy import utils"
] |
#!/opt/ActivePython-2.7/bin/python
#####################################################################################################
# Nicholas Harner
# CSE411
# Homework 7
# 11/19/2012
# This program is an exact mimic of Coelacanth: a simple password generator. It is a very simple
# application for ... | [
[
1,
0,
0.1094,
0.0039,
0,
0.66,
0,
688,
0,
2,
0,
0,
688,
0,
0
],
[
1,
0,
0.1133,
0.0039,
0,
0.66,
0.1,
526,
0,
1,
0,
0,
526,
0,
0
],
[
1,
0,
0.1172,
0.0039,
0,
0.6... | [
"import os,sys",
"import math",
"import random #need this to create random password",
"from Tkinter import *",
"def fatal():\n sys.exit()",
" sys.exit()",
"class Application(Frame):\n \"\"\" GUI application that creates a new random password based on user specs \"\"\"\n def __init__(self, m... |
#!/usr/bin/python
# Sean Hill
# Fall 2012
# CSE 411
# Homework 7
#
# Description: Translates the image segmentation code from the following website from C++ to Python:
# http://www.cs.brown.edu/~pff/segment/
#
# Instructions: The command-line usage is as follows, where "sigma" and "k" and "min" are
# algori... | [
[
1,
0,
0.0556,
0.0026,
0,
0.66,
0,
509,
0,
4,
0,
0,
509,
0,
0
],
[
14,
0,
0.0608,
0.0026,
0,
0.66,
0.0345,
943,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.0635,
0.0026,
0,
... | [
"import sys, math, random, struct",
"MAXVAL = 255 # maximum allowed third value in P6 ppm file",
"WIDTH = 4.0 # used in filter calculations",
"def error(message):\n \"\"\" Report pnm_error and exit. \"\"\"\n sys.stderr.write(\"ERROR: \" + message + \" Exiting.\\n\")\n sys.exit()",
" \"\"\" Repor... |
#! /usr/bin/python
from optparse import OptionParser
import os.path
import sys
parser = OptionParser()
parser.add_option("-L", "--line", dest="stripLine",
action="store_true", default=False,
help="strip single-line comments //...\\n")
parser.add_option("-C", "--cstyle", dest="s... | [
[
1,
0,
0.0231,
0.0077,
0,
0.66,
0,
323,
0,
1,
0,
0,
323,
0,
0
],
[
1,
0,
0.0308,
0.0077,
0,
0.66,
0.0526,
79,
0,
1,
0,
0,
79,
0,
0
],
[
1,
0,
0.0385,
0.0077,
0,
0.... | [
"from optparse import OptionParser",
"import os.path",
"import sys",
"parser = OptionParser()",
"parser.add_option(\"-L\", \"--line\", dest=\"stripLine\",\n action=\"store_true\", default=False,\n help=\"strip single-line comments //...\\\\n\")",
"parser.add_option(\"-C... |
#!/opt/ActivePython-2.7/bin/python
#####################################################################################################
# Nicholas Harner
# CSE411
# Homework 7
# 11/19/2012
# This program is an exact mimic of Coelacanth: a simple password generator. It is a very simple
# application for ... | [
[
1,
0,
0.1094,
0.0039,
0,
0.66,
0,
688,
0,
2,
0,
0,
688,
0,
0
],
[
1,
0,
0.1133,
0.0039,
0,
0.66,
0.1,
526,
0,
1,
0,
0,
526,
0,
0
],
[
1,
0,
0.1172,
0.0039,
0,
0.6... | [
"import os,sys",
"import math",
"import random #need this to create random password",
"from Tkinter import *",
"def fatal():\n sys.exit()",
" sys.exit()",
"class Application(Frame):\n \"\"\" GUI application that creates a new random password based on user specs \"\"\"\n def __init__(self, m... |
#!/usr/bin/python
# Sean Hill
# Fall 2012
# CSE 411
# Homework 7
#
# Description: Translates the image segmentation code from the following website from C++ to Python:
# http://www.cs.brown.edu/~pff/segment/
#
# Instructions: The command-line usage is as follows, where "sigma" and "k" and "min" are
# algori... | [
[
1,
0,
0.0556,
0.0026,
0,
0.66,
0,
509,
0,
4,
0,
0,
509,
0,
0
],
[
14,
0,
0.0608,
0.0026,
0,
0.66,
0.0345,
943,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.0635,
0.0026,
0,
... | [
"import sys, math, random, struct",
"MAXVAL = 255 # maximum allowed third value in P6 ppm file",
"WIDTH = 4.0 # used in filter calculations",
"def error(message):\n \"\"\" Report pnm_error and exit. \"\"\"\n sys.stderr.write(\"ERROR: \" + message + \" Exiting.\\n\")\n sys.exit()",
" \"\"\" Repor... |
#! /usr/bin/python
from optparse import OptionParser
import os.path
import sys
parser = OptionParser()
parser.add_option("-L", "--line", dest="stripLine",
action="store_true", default=False,
help="strip single-line comments //...\\n")
parser.add_option("-C", "--cstyle", dest="s... | [
[
1,
0,
0.0231,
0.0077,
0,
0.66,
0,
323,
0,
1,
0,
0,
323,
0,
0
],
[
1,
0,
0.0308,
0.0077,
0,
0.66,
0.0526,
79,
0,
1,
0,
0,
79,
0,
0
],
[
1,
0,
0.0385,
0.0077,
0,
0.... | [
"from optparse import OptionParser",
"import os.path",
"import sys",
"parser = OptionParser()",
"parser.add_option(\"-L\", \"--line\", dest=\"stripLine\",\n action=\"store_true\", default=False,\n help=\"strip single-line comments //...\\\\n\")",
"parser.add_option(\"-C... |
#!/opt/ActivePython-2.7/bin/python
# Mad Lib
# Create a story based on user input
from Tkinter import *
class Application(Frame):
""" GUI application that creates a story based on user input. """
def __init__(self, master):
Frame.__init__(self, master)
self.grid()
self.create_widgets(... | [
[
1,
0,
0.0414,
0.0069,
0,
0.66,
0,
368,
0,
1,
0,
0,
368,
0,
0
],
[
3,
0,
0.5034,
0.9034,
0,
0.66,
0.2,
979,
0,
3,
0,
0,
342,
0,
48
],
[
8,
1,
0.0621,
0.0069,
1,
0.... | [
"from Tkinter import *",
"class Application(Frame):\n \"\"\" GUI application that creates a story based on user input. \"\"\"\n def __init__(self, master):\n Frame.__init__(self, master)\n self.grid()\n self.create_widgets()\n\n def create_widgets(self):",
" \"\"\" GUI applicati... |
#!/opt/ActivePython-2.7/bin/python
# labeler.py
from Tkinter import *
root = Tk()
root.title("Labeler")
# root.geometry("200x100")
app = Frame(root)
app.grid()
lbl = Label(app, text = "I'm a label!")
lbl.grid()
root.mainloop()
| [
[
1,
0,
0.2941,
0.0588,
0,
0.66,
0,
368,
0,
1,
0,
0,
368,
0,
0
],
[
14,
0,
0.4118,
0.0588,
0,
0.66,
0.1429,
696,
3,
0,
0,
0,
309,
10,
1
],
[
8,
0,
0.4706,
0.0588,
0,
... | [
"from Tkinter import *",
"root = Tk()",
"root.title(\"Labeler\")",
"app = Frame(root)",
"app.grid()",
"lbl = Label(app, text = \"I'm a label!\")",
"lbl.grid()",
"root.mainloop()"
] |
#!/opt/ActivePython-2.7/bin/python
# Mad Lib
# Create a story based on user input
from Tkinter import *
class Application(Frame):
""" GUI application that creates a story based on user input. """
def __init__(self, master):
Frame.__init__(self, master)
self.grid()
self.create_widgets(... | [
[
1,
0,
0.0414,
0.0069,
0,
0.66,
0,
368,
0,
1,
0,
0,
368,
0,
0
],
[
3,
0,
0.5034,
0.9034,
0,
0.66,
0.2,
979,
0,
3,
0,
0,
342,
0,
48
],
[
8,
1,
0.0621,
0.0069,
1,
0.... | [
"from Tkinter import *",
"class Application(Frame):\n \"\"\" GUI application that creates a story based on user input. \"\"\"\n def __init__(self, master):\n Frame.__init__(self, master)\n self.grid()\n self.create_widgets()\n\n def create_widgets(self):",
" \"\"\" GUI applicati... |
#!/opt/ActivePython-2.7/bin/python
# lazy_buttons.py
from Tkinter import *
root = Tk()
root.title("Lazy Buttons")
root.geometry("200x100")
app = Frame(root)
app.grid()
bttn1 = Button(app, text = "I do nothing!")
bttn1.grid()
bttn2 = Button(app)
bttn2.grid()
bttn2.configure(text = "Me too!")
bttn3 = Button(app)
b... | [
[
1,
0,
0.2,
0.04,
0,
0.66,
0,
368,
0,
1,
0,
0,
368,
0,
0
],
[
14,
0,
0.28,
0.04,
0,
0.66,
0.0714,
696,
3,
0,
0,
0,
309,
10,
1
],
[
8,
0,
0.32,
0.04,
0,
0.66,
0... | [
"from Tkinter import *",
"root = Tk()",
"root.title(\"Lazy Buttons\")",
"root.geometry(\"200x100\")",
"app = Frame(root)",
"app.grid()",
"bttn1 = Button(app, text = \"I do nothing!\")",
"bttn1.grid()",
"bttn2 = Button(app)",
"bttn2.grid()",
"bttn2.configure(text = \"Me too!\")",
"bttn3 = Butto... |
#!/opt/ActivePython-2.7/bin/python
# click_counter.py
from Tkinter import *
class Application(Frame):
def __init__(self, master):
Frame.__init__(self, master)
self.grid()
self.bttn_clicks = 0 # number clicks
self.create_widget()
def create_widget(self):
self.bttn =... | [
[
1,
0,
0.1724,
0.0345,
0,
0.66,
0,
368,
0,
1,
0,
0,
368,
0,
0
],
[
3,
0,
0.5,
0.5517,
0,
0.66,
0.1667,
979,
0,
3,
0,
0,
342,
0,
6
],
[
2,
1,
0.3448,
0.1724,
1,
0.7... | [
"from Tkinter import *",
"class Application(Frame):\n def __init__(self, master):\n Frame.__init__(self, master)\n self.grid()\n self.bttn_clicks = 0 # number clicks\n self.create_widget()\n\n def create_widget(self):",
" def __init__(self, master):\n Frame.__init_... |
#!/opt/ActivePython-2.7/bin/python
# simple_gui.py
from Tkinter import *
root = Tk()
root.title("Simple GUI")
root.geometry("200x100")
root.mainloop()
| [
[
1,
0,
0.4545,
0.0909,
0,
0.66,
0,
368,
0,
1,
0,
0,
368,
0,
0
],
[
14,
0,
0.6364,
0.0909,
0,
0.66,
0.25,
696,
3,
0,
0,
0,
309,
10,
1
],
[
8,
0,
0.7273,
0.0909,
0,
... | [
"from Tkinter import *",
"root = Tk()",
"root.title(\"Simple GUI\")",
"root.geometry(\"200x100\")",
"root.mainloop()"
] |
#!/opt/ActivePython-2.7/bin/python
# labeler.py
from Tkinter import *
root = Tk()
root.title("Labeler")
# root.geometry("200x100")
app = Frame(root)
app.grid()
lbl = Label(app, text = "I'm a label!")
lbl.grid()
root.mainloop()
| [
[
1,
0,
0.2941,
0.0588,
0,
0.66,
0,
368,
0,
1,
0,
0,
368,
0,
0
],
[
14,
0,
0.4118,
0.0588,
0,
0.66,
0.1429,
696,
3,
0,
0,
0,
309,
10,
1
],
[
8,
0,
0.4706,
0.0588,
0,
... | [
"from Tkinter import *",
"root = Tk()",
"root.title(\"Labeler\")",
"app = Frame(root)",
"app.grid()",
"lbl = Label(app, text = \"I'm a label!\")",
"lbl.grid()",
"root.mainloop()"
] |
#!/opt/ActivePython-2.7/bin/python
# simple_gui.py
from Tkinter import *
root = Tk()
root.title("Simple GUI")
root.geometry("200x100")
root.mainloop()
| [
[
1,
0,
0.4545,
0.0909,
0,
0.66,
0,
368,
0,
1,
0,
0,
368,
0,
0
],
[
14,
0,
0.6364,
0.0909,
0,
0.66,
0.25,
696,
3,
0,
0,
0,
309,
10,
1
],
[
8,
0,
0.7273,
0.0909,
0,
... | [
"from Tkinter import *",
"root = Tk()",
"root.title(\"Simple GUI\")",
"root.geometry(\"200x100\")",
"root.mainloop()"
] |
#!/opt/ActivePython-2.7/bin/python
# lazy_buttons.py
from Tkinter import *
root = Tk()
root.title("Lazy Buttons")
root.geometry("200x100")
app = Frame(root)
app.grid()
bttn1 = Button(app, text = "I do nothing!")
bttn1.grid()
bttn2 = Button(app)
bttn2.grid()
bttn2.configure(text = "Me too!")
bttn3 = Button(app)
b... | [
[
1,
0,
0.2,
0.04,
0,
0.66,
0,
368,
0,
1,
0,
0,
368,
0,
0
],
[
14,
0,
0.28,
0.04,
0,
0.66,
0.0714,
696,
3,
0,
0,
0,
309,
10,
1
],
[
8,
0,
0.32,
0.04,
0,
0.66,
0... | [
"from Tkinter import *",
"root = Tk()",
"root.title(\"Lazy Buttons\")",
"root.geometry(\"200x100\")",
"app = Frame(root)",
"app.grid()",
"bttn1 = Button(app, text = \"I do nothing!\")",
"bttn1.grid()",
"bttn2 = Button(app)",
"bttn2.grid()",
"bttn2.configure(text = \"Me too!\")",
"bttn3 = Butto... |
#!/opt/ActivePython-2.7/bin/python
# click_counter.py
from Tkinter import *
class Application(Frame):
def __init__(self, master):
Frame.__init__(self, master)
self.grid()
self.bttn_clicks = 0 # number clicks
self.create_widget()
def create_widget(self):
self.bttn =... | [
[
1,
0,
0.1724,
0.0345,
0,
0.66,
0,
368,
0,
1,
0,
0,
368,
0,
0
],
[
3,
0,
0.5,
0.5517,
0,
0.66,
0.1667,
979,
0,
3,
0,
0,
342,
0,
6
],
[
2,
1,
0.3448,
0.1724,
1,
0.5... | [
"from Tkinter import *",
"class Application(Frame):\n def __init__(self, master):\n Frame.__init__(self, master)\n self.grid()\n self.bttn_clicks = 0 # number clicks\n self.create_widget()\n\n def create_widget(self):",
" def __init__(self, master):\n Frame.__init_... |
# graphics.py
"""Simple object oriented graphics library
The library is designed to make it very easy for novice programmers to
experiment with computer graphics in an object oriented fashion. It is
written by John Zelle for use with the book "Python Programming: An
Introduction to Computer Science" (Franklin, Beedl... | [
[
8,
0,
0.0354,
0.0675,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1665,
0.0011,
0,
0.66,
0.037,
654,
0,
3,
0,
0,
654,
0,
0
],
[
7,
0,
0.1704,
0.0045,
0,
0.66,... | [
"\"\"\"Simple object oriented graphics library \n\nThe library is designed to make it very easy for novice programmers to\nexperiment with computer graphics in an object oriented fashion. It is\nwritten by John Zelle for use with the book \"Python Programming: An\nIntroduction to Computer Science\" (Franklin, Beed... |
'''
Created on 2012-10-15
@author: wangxin
'''
import sys
import os
import re
import time
import md5
import random
import thread
from sets import Set
import socket
import traceback
from Tkinter import *
#record the path
#action:
# DELETE=0
# INSERT=1
# SUBSTITUTION=2
#... | [
[
8,
0,
0.008,
0.0134,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0187,
0.0027,
0,
0.66,
0.0667,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0214,
0.0027,
0,
0.66,... | [
"'''\nCreated on 2012-10-15\n\n@author: wangxin\n'''",
"import sys",
"import os",
"import re",
"import time",
"import md5",
"import random",
"import thread",
"from sets import Set",
"import socket",
"import traceback",
"from Tkinter import *",
"class Path:\n def __init__(self, i, j, actio... |
import sys
import os
import re
import time
import md5
import random
import thread
from sets import Set
import socket
import traceback
from Tkinter import *
#record the path
#action:
# DELETE=0
# INSERT=1
# SUBSTITUTION=2
# SAMEVALUE=3
class Path:
def __init__(self,... | [
[
1,
0,
0.0027,
0.0027,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0054,
0.0027,
0,
0.66,
0.0714,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0082,
0.0027,
0,
... | [
"import sys",
"import os",
"import re",
"import time",
"import md5",
"import random",
"import thread",
"from sets import Set",
"import socket",
"import traceback",
"from Tkinter import *",
"class Path:\n def __init__(self, i, j, action):\n self.i=i\n self.j=j\n self.act... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.