code
stringlengths
1
1.49M
vector
listlengths
0
7.38k
snippet
listlengths
0
7.38k
#! /usr/bin/python from random import randint from random import choice INSTANCIAS = 70 MAX_CLAUS = 300 MAX_VARS = 40 MAX_VARS_POR_CLAUS = 10 f = open("hard_big.in",'w') clausulas=open("hard_big_tamanios",'w') for i in xrange(INSTANCIAS): c = randint(1,MAX_CLAUS) clausulas.write(str(c)+"\n") v = randint(1,MAX_VA...
[ [ 1, 0, 0.0667, 0.0333, 0, 0.66, 0, 715, 0, 1, 0, 0, 715, 0, 0 ], [ 1, 0, 0.1, 0.0333, 0, 0.66, 0.1, 715, 0, 1, 0, 0, 715, 0, 0 ], [ 14, 0, 0.1667, 0.0333, 0, 0.66,...
[ "from random import randint", "from random import choice", "INSTANCIAS = 70", "MAX_CLAUS = 300", "MAX_VARS = 40", "MAX_VARS_POR_CLAUS = 10", "f = open(\"hard_big.in\",'w')", "clausulas=open(\"hard_big_tamanios\",'w')", "for i in xrange(INSTANCIAS):\n\tc = randint(1,MAX_CLAUS)\n\tclausulas.write(str(...
#! /usr/bin/python files=["exacto.out","constructiva.out","busq_local.out","tabu.out"] f=open("data.dat",'w').write("\n".join([" ".join(map(str,z)) for z in zip(*[open(f).read().split("\n")[::3] for f in files])]))
[ [ 14, 0, 0.75, 0.25, 0, 0.66, 0, 598, 0, 0, 0, 0, 0, 5, 0 ], [ 14, 0, 1, 0.25, 0, 0.66, 1, 899, 3, 1, 0, 0, 837, 10, 9 ] ]
[ "files=[\"exacto.out\",\"constructiva.out\",\"busq_local.out\",\"tabu.out\"]", "f=open(\"data.dat\",'w').write(\"\\n\".join([\" \".join(map(str,z)) for z in zip(*[open(f).read().split(\"\\n\")[::3] for f in files])]))" ]
#! /usr/bin/python from random import randint from random import choice INSTANCIAS = 1 MAX_CLAUS = 300 MAX_VARS = 300 MAX_VARS_POR_CLAUS = 3 f = open("hard.in",'w') for i in xrange(INSTANCIAS): c = randint(1,MAX_CLAUS) v = randint(1,MAX_VARS) f.write("%d %d\r\n"%(c,v)) for j in xrange(c): l = randint(1,randin...
[ [ 1, 0, 0.0741, 0.037, 0, 0.66, 0, 715, 0, 1, 0, 0, 715, 0, 0 ], [ 1, 0, 0.1111, 0.037, 0, 0.66, 0.1111, 715, 0, 1, 0, 0, 715, 0, 0 ], [ 14, 0, 0.1852, 0.037, 0, 0....
[ "from random import randint", "from random import choice", "INSTANCIAS = 1", "MAX_CLAUS = 300", "MAX_VARS = 300", "MAX_VARS_POR_CLAUS = 3", "f = open(\"hard.in\",'w')", "for i in xrange(INSTANCIAS):\n\tc = randint(1,MAX_CLAUS)\n\tv = randint(1,MAX_VARS)\n\tf.write(\"%d %d\\r\\n\"%(c,v))\n\tfor j in xr...
#!/usr/bin/env python from matplotlib.pyplot import * fin=open('instance80_24/data.dat') todo=fin.read().strip().split('\n') xs=[int(x.split()[0]) for x in todo if x] exacto=[int(x.split()[0]) for x in todo if x] constru=[int(x.split()[1]) for x in todo if x] local=[int(x.split()[2]) for x in todo if x] tabu=[int(x.sp...
[ [ 1, 0, 0.0909, 0.0455, 0, 0.66, 0, 596, 0, 1, 0, 0, 596, 0, 0 ], [ 14, 0, 0.1818, 0.0455, 0, 0.66, 0.0667, 225, 3, 1, 0, 0, 693, 10, 1 ], [ 14, 0, 0.2273, 0.0455, 0, ...
[ "from matplotlib.pyplot import *", "fin=open('instance80_24/data.dat')", "todo=fin.read().strip().split('\\n')", "xs=[int(x.split()[0]) for x in todo if x]", "exacto=[int(x.split()[0]) for x in todo if x]", "constru=[int(x.split()[1]) for x in todo if x]", "local=[int(x.split()[2]) for x in todo if x]",...
#! /usr/bin/python files=["constructiva_big.out","busq_local_big.out","tabu_big.out"] f=open("data_big.dat",'w').write("\n".join([" ".join(map(str,z)) for z in zip(*[open(f).read().split("\n")[::3] for f in files])]))
[ [ 14, 0, 0.75, 0.25, 0, 0.66, 0, 598, 0, 0, 0, 0, 0, 5, 0 ], [ 14, 0, 1, 0.25, 0, 0.66, 1, 899, 3, 1, 0, 0, 837, 10, 9 ] ]
[ "files=[\"constructiva_big.out\",\"busq_local_big.out\",\"tabu_big.out\"]", "f=open(\"data_big.dat\",'w').write(\"\\n\".join([\" \".join(map(str,z)) for z in zip(*[open(f).read().split(\"\\n\")[::3] for f in files])]))" ]
#!/usr/bin/env python from matplotlib.pyplot import * fin=open('data_big.dat') tam=open('hard_big_tamanios') todo=fin.read().strip().split('\n') #xs=tam.read().split() constru=[int(x.split()[0]) for x in todo if x] local=[int(x.split()[1]) for x in todo if x] xs=tabu=[int(x.split()[2]) for x in todo if x] title("Comp...
[ [ 1, 0, 0.087, 0.0435, 0, 0.66, 0, 596, 0, 1, 0, 0, 596, 0, 0 ], [ 14, 0, 0.1739, 0.0435, 0, 0.66, 0.0625, 225, 3, 1, 0, 0, 693, 10, 1 ], [ 14, 0, 0.2174, 0.0435, 0, ...
[ "from matplotlib.pyplot import *", "fin=open('data_big.dat')", "tam=open('hard_big_tamanios')", "todo=fin.read().strip().split('\\n')", "constru=[int(x.split()[0]) for x in todo if x]", "local=[int(x.split()[1]) for x in todo if x]", "xs=tabu=[int(x.split()[2]) for x in todo if x]", "title(\"Comparaci...
#!/usr/bin/env python from matplotlib.pyplot import * files=["exacto.out","constructiva.out","busq_local.out","tabu.out"] data = "\n".join([" ".join(map(str,z)) for z in zip(*[open(f).read().split("\n")[::3] for f in files])]) todo=data.strip().split('\n') xs=[int(x.split()[0]) for x in todo if x] exacto=[int(x.split(...
[ [ 1, 0, 0.087, 0.0435, 0, 0.66, 0, 596, 0, 1, 0, 0, 596, 0, 0 ], [ 14, 0, 0.1739, 0.0435, 0, 0.66, 0.0556, 598, 0, 0, 0, 0, 0, 5, 0 ], [ 14, 0, 0.2174, 0.0435, 0, 0...
[ "from matplotlib.pyplot import *", "files=[\"exacto.out\",\"constructiva.out\",\"busq_local.out\",\"tabu.out\"]", "data = \"\\n\".join([\" \".join(map(str,z)) for z in zip(*[open(f).read().split(\"\\n\")[::3] for f in files])])", "todo=data.strip().split('\\n')", "xs=[int(x.split()[0]) for x in todo if x]",...
#! /usr/bin/python files=["exacto.out","constructiva.out","busq_local.out","tabu.out"] f=open("data.dat",'w').write("\n".join([" ".join(map(str,z)) for z in zip(*[open(f).read().split("\n")[::3] for f in files])]))
[ [ 14, 0, 0.75, 0.25, 0, 0.66, 0, 598, 0, 0, 0, 0, 0, 5, 0 ], [ 14, 0, 1, 0.25, 0, 0.66, 1, 899, 3, 1, 0, 0, 837, 10, 9 ] ]
[ "files=[\"exacto.out\",\"constructiva.out\",\"busq_local.out\",\"tabu.out\"]", "f=open(\"data.dat\",'w').write(\"\\n\".join([\" \".join(map(str,z)) for z in zip(*[open(f).read().split(\"\\n\")[::3] for f in files])]))" ]
#!/usr/bin/env python from matplotlib.pyplot import * files=["exacto.out","constructiva.out","busq_local.out","tabu.out"] data = "\n".join([" ".join(map(str,z)) for z in zip(*[open(f).read().split("\n")[::3] for f in files])]) todo=data.strip().split('\n') xs=[int(x.split()[0]) for x in todo if x] exacto=[int(x.split(...
[ [ 1, 0, 0.087, 0.0435, 0, 0.66, 0, 596, 0, 1, 0, 0, 596, 0, 0 ], [ 14, 0, 0.1739, 0.0435, 0, 0.66, 0.0556, 598, 0, 0, 0, 0, 0, 5, 0 ], [ 14, 0, 0.2174, 0.0435, 0, 0...
[ "from matplotlib.pyplot import *", "files=[\"exacto.out\",\"constructiva.out\",\"busq_local.out\",\"tabu.out\"]", "data = \"\\n\".join([\" \".join(map(str,z)) for z in zip(*[open(f).read().split(\"\\n\")[::3] for f in files])])", "todo=data.strip().split('\\n')", "xs=[int(x.split()[0]) for x in todo if x]",...
#! /usr/bin/python files=["exacto.out","constructiva.out","busq_local.out","tabu.out"] f=open("data.dat",'w').write("\n".join([" ".join(map(str,z)) for z in zip(*[open(f).read().split("\n")[::3] for f in files])]))
[ [ 14, 0, 0.75, 0.25, 0, 0.66, 0, 598, 0, 0, 0, 0, 0, 5, 0 ], [ 14, 0, 1, 0.25, 0, 0.66, 1, 899, 3, 1, 0, 0, 837, 10, 9 ] ]
[ "files=[\"exacto.out\",\"constructiva.out\",\"busq_local.out\",\"tabu.out\"]", "f=open(\"data.dat\",'w').write(\"\\n\".join([\" \".join(map(str,z)) for z in zip(*[open(f).read().split(\"\\n\")[::3] for f in files])]))" ]
#!/usr/bin/env python from matplotlib.pyplot import * #fin=open('instance80_24/data.dat') fin=open('p_iter1.dat') todo=fin.read().strip().split('\n') xs=[int(x.split()[0]) for x in todo if x] ys=[int(x.split()[1]) for x in todo if x] #title("Cantidad de operaciones de $matching$") xlabel("MAX_ITER") ylabel("clausulas ...
[ [ 1, 0, 0.1111, 0.0556, 0, 0.66, 0, 596, 0, 1, 0, 0, 596, 0, 0 ], [ 14, 0, 0.2778, 0.0556, 0, 0.66, 0.1, 225, 3, 1, 0, 0, 693, 10, 1 ], [ 14, 0, 0.3333, 0.0556, 0, ...
[ "from matplotlib.pyplot import *", "fin=open('p_iter1.dat')", "todo=fin.read().strip().split('\\n')", "xs=[int(x.split()[0]) for x in todo if x]", "ys=[int(x.split()[1]) for x in todo if x]", "xlabel(\"MAX_ITER\")", "ylabel(\"clausulas satisfechas\")", "plot(xs,ys,'ro',label=\"tabu\")", "legend(loc=...
#!/usr/bin/env python from matplotlib.pyplot import * #fin=open('instance80_24/data.dat') fin=open('p_iter1.dat') todo=fin.read().strip().split('\n') xs=[int(x.split()[0]) for x in todo if x] ys=[int(x.split()[1]) for x in todo if x] #title("Cantidad de operaciones de $matching$") xlabel("MAX_ITER") ylabel("clausulas ...
[ [ 1, 0, 0.1111, 0.0556, 0, 0.66, 0, 596, 0, 1, 0, 0, 596, 0, 0 ], [ 14, 0, 0.2778, 0.0556, 0, 0.66, 0.1, 225, 3, 1, 0, 0, 693, 10, 1 ], [ 14, 0, 0.3333, 0.0556, 0, ...
[ "from matplotlib.pyplot import *", "fin=open('p_iter1.dat')", "todo=fin.read().strip().split('\\n')", "xs=[int(x.split()[0]) for x in todo if x]", "ys=[int(x.split()[1]) for x in todo if x]", "xlabel(\"MAX_ITER\")", "ylabel(\"clausulas satisfechas\")", "plot(xs,ys,'ro',label=\"tabu\")", "legend(loc=...
#! /usr/bin/python from random import randint from random import choice INSTANCIAS = 1 MAX_CLAUS = 300 MAX_VARS = 300 MAX_VARS_POR_CLAUS = 3 f = open("hard.in",'w') for i in xrange(INSTANCIAS): c = randint(1,MAX_CLAUS) v = randint(1,MAX_VARS) f.write("%d %d\r\n"%(c,v)) for j in xrange(c): l = randint(1,randin...
[ [ 1, 0, 0.0741, 0.037, 0, 0.66, 0, 715, 0, 1, 0, 0, 715, 0, 0 ], [ 1, 0, 0.1111, 0.037, 0, 0.66, 0.1111, 715, 0, 1, 0, 0, 715, 0, 0 ], [ 14, 0, 0.1852, 0.037, 0, 0....
[ "from random import randint", "from random import choice", "INSTANCIAS = 1", "MAX_CLAUS = 300", "MAX_VARS = 300", "MAX_VARS_POR_CLAUS = 3", "f = open(\"hard.in\",'w')", "for i in xrange(INSTANCIAS):\n\tc = randint(1,MAX_CLAUS)\n\tv = randint(1,MAX_VARS)\n\tf.write(\"%d %d\\r\\n\"%(c,v))\n\tfor j in xr...
#!/usr/bin/env python from matplotlib.pyplot import * #fin=open('instance80_24/data.dat') fin=open('data_tiempos.dat') todo=fin.read().strip().split('\n') xs=[int(x.split()[0]) for x in todo if x] exacto=[int(x.split()[0]) for x in todo if x] constru=[int(x.split()[1]) for x in todo if x] local=[int(x.split()[2]) for ...
[ [ 1, 0, 0.087, 0.0435, 0, 0.66, 0, 596, 0, 1, 0, 0, 596, 0, 0 ], [ 14, 0, 0.2174, 0.0435, 0, 0.66, 0.0667, 225, 3, 1, 0, 0, 693, 10, 1 ], [ 14, 0, 0.2609, 0.0435, 0, ...
[ "from matplotlib.pyplot import *", "fin=open('data_tiempos.dat')", "todo=fin.read().strip().split('\\n')", "xs=[int(x.split()[0]) for x in todo if x]", "exacto=[int(x.split()[0]) for x in todo if x]", "constru=[int(x.split()[1]) for x in todo if x]", "local=[int(x.split()[2]) for x in todo if x]", "ta...
#! /usr/bin/python #files=["exacto.out","constructiva.out","busq_local.out","tabu.out"] #f=open("data.dat",'w').write("\n".join([" ".join(map(str,z)) for z in zip(*[open(f).read().split("\n")[::3] for f in files])])) files=["exacto.log","constructiva.log","busq_local.log","tabu.log"] f=open("data_tiempos.dat",'w').wr...
[ [ 14, 0, 0.8571, 0.1429, 0, 0.66, 0, 598, 0, 0, 0, 0, 0, 5, 0 ], [ 14, 0, 1, 0.1429, 0, 0.66, 1, 899, 3, 1, 0, 0, 837, 10, 9 ] ]
[ "files=[\"exacto.log\",\"constructiva.log\",\"busq_local.log\",\"tabu.log\"]", "f=open(\"data_tiempos.dat\",'w').write(\"\\n\".join([\" \".join(map(str,z)) for z in zip(*[open(f).read().split(\"\\n\") for f in files])]))" ]
#!/usr/bin/env python from matplotlib.pyplot import * #fin=open('instance80_24/data.dat') fin=open('data_tiempos.dat') todo=fin.read().strip().split('\n') xs=[int(x.split()[0]) for x in todo if x] exacto=[int(x.split()[0]) for x in todo if x] constru=[int(x.split()[1]) for x in todo if x] local=[int(x.split()[2]) for ...
[ [ 1, 0, 0.087, 0.0435, 0, 0.66, 0, 596, 0, 1, 0, 0, 596, 0, 0 ], [ 14, 0, 0.2174, 0.0435, 0, 0.66, 0.0667, 225, 3, 1, 0, 0, 693, 10, 1 ], [ 14, 0, 0.2609, 0.0435, 0, ...
[ "from matplotlib.pyplot import *", "fin=open('data_tiempos.dat')", "todo=fin.read().strip().split('\\n')", "xs=[int(x.split()[0]) for x in todo if x]", "exacto=[int(x.split()[0]) for x in todo if x]", "constru=[int(x.split()[1]) for x in todo if x]", "local=[int(x.split()[2]) for x in todo if x]", "ta...
#! /usr/bin/python #files=["exacto.out","constructiva.out","busq_local.out","tabu.out"] #f=open("data.dat",'w').write("\n".join([" ".join(map(str,z)) for z in zip(*[open(f).read().split("\n")[::3] for f in files])])) files=["exacto.log","constructiva.log","busq_local.log","tabu.log"] f=open("data_tiempos.dat",'w').wr...
[ [ 14, 0, 0.8571, 0.1429, 0, 0.66, 0, 598, 0, 0, 0, 0, 0, 5, 0 ], [ 14, 0, 1, 0.1429, 0, 0.66, 1, 899, 3, 1, 0, 0, 837, 10, 9 ] ]
[ "files=[\"exacto.log\",\"constructiva.log\",\"busq_local.log\",\"tabu.log\"]", "f=open(\"data_tiempos.dat\",'w').write(\"\\n\".join([\" \".join(map(str,z)) for z in zip(*[open(f).read().split(\"\\n\") for f in files])]))" ]
#! /usr/bin/python files=["exacto.out","constructiva.out","busq_local.out","tabu.out"] f=open("data.dat",'w').write("\n".join([" ".join(map(str,z)) for z in zip(*[open(f).read().split("\n")[::3] for f in files])]))
[ [ 14, 0, 0.75, 0.25, 0, 0.66, 0, 598, 0, 0, 0, 0, 0, 5, 0 ], [ 14, 0, 1, 0.25, 0, 0.66, 1, 899, 3, 1, 0, 0, 837, 10, 9 ] ]
[ "files=[\"exacto.out\",\"constructiva.out\",\"busq_local.out\",\"tabu.out\"]", "f=open(\"data.dat\",'w').write(\"\\n\".join([\" \".join(map(str,z)) for z in zip(*[open(f).read().split(\"\\n\")[::3] for f in files])]))" ]
#! /usr/bin/python files=["constructiva_big.out","busq_local_big.out","tabu_big.out"] f=open("data_big.dat",'w').write("\n".join([" ".join(map(str,z)) for z in zip(*[open(f).read().split("\n")[::3] for f in files])]))
[ [ 14, 0, 0.75, 0.25, 0, 0.66, 0, 598, 0, 0, 0, 0, 0, 5, 0 ], [ 14, 0, 1, 0.25, 0, 0.66, 1, 899, 3, 1, 0, 0, 837, 10, 9 ] ]
[ "files=[\"constructiva_big.out\",\"busq_local_big.out\",\"tabu_big.out\"]", "f=open(\"data_big.dat\",'w').write(\"\\n\".join([\" \".join(map(str,z)) for z in zip(*[open(f).read().split(\"\\n\")[::3] for f in files])]))" ]
#!/usr/bin/env python from matplotlib.pyplot import * fin=open('data_big.dat') tam=open('hard_big_tamanios') todo=fin.read().strip().split('\n') #xs=tam.read().split() constru=[int(x.split()[0]) for x in todo if x] local=[int(x.split()[1]) for x in todo if x] xs=tabu=[int(x.split()[2]) for x in todo if x] title("Comp...
[ [ 1, 0, 0.087, 0.0435, 0, 0.66, 0, 596, 0, 1, 0, 0, 596, 0, 0 ], [ 14, 0, 0.1739, 0.0435, 0, 0.66, 0.0625, 225, 3, 1, 0, 0, 693, 10, 1 ], [ 14, 0, 0.2174, 0.0435, 0, ...
[ "from matplotlib.pyplot import *", "fin=open('data_big.dat')", "tam=open('hard_big_tamanios')", "todo=fin.read().strip().split('\\n')", "constru=[int(x.split()[0]) for x in todo if x]", "local=[int(x.split()[1]) for x in todo if x]", "xs=tabu=[int(x.split()[2]) for x in todo if x]", "title(\"Comparaci...
from random import randint def mprint(m): return '\n'.join(map(lambda x:''.join([el and '#' or '_' for el in x]),m)) fout=open('test_sanos.in','w') for n in range(6,40): for caso in range(10): M=[[0]*n for el in range(n)] ks=[] for cuad in range(randint(5,2*n)): ki=randint(2,n/4+1) if ki%2==1: ki+=rand...
[ [ 1, 0, 0.0333, 0.0333, 0, 0.66, 0, 715, 0, 1, 0, 0, 715, 0, 0 ], [ 2, 0, 0.1167, 0.0667, 0, 0.66, 0.25, 184, 0, 1, 1, 0, 0, 0, 3 ], [ 13, 1, 0.1333, 0.0333, 1, 0.9...
[ "from random import randint", "def mprint(m):\n\treturn '\\n'.join(map(lambda x:''.join([el and '#' or '_' for el in x]),m))", "\treturn '\\n'.join(map(lambda x:''.join([el and '#' or '_' for el in x]),m))", "fout=open('test_sanos.in','w')", "for n in range(6,40):\n\tfor caso in range(10):\n\t\tM=[[0]*n for...
#!/usr/bin/env python import getopt,sys import subprocess from random import random,randint,seed from math import sqrt seed(123) # defino el seed para hacer el experimento reproducible def runtest(li,args): # abro ./domino con parametros args fp=subprocess.Popen(['./domino']+args, shell=False, stdin=subprocess.PIP...
[ [ 1, 0, 0.0179, 0.0179, 0, 0.66, 0, 588, 0, 2, 0, 0, 588, 0, 0 ], [ 1, 0, 0.0357, 0.0179, 0, 0.66, 0.125, 394, 0, 1, 0, 0, 394, 0, 0 ], [ 1, 0, 0.0536, 0.0179, 0, 0...
[ "import getopt,sys", "import subprocess", "from random import random,randint,seed", "from math import sqrt", "def runtest(li,args):\n\t# abro ./domino con parametros args\n\tfp=subprocess.Popen(['./domino']+args, shell=False, stdin=subprocess.PIPE,stdout=subprocess.PIPE)\n\tfor caso,p in li:\n\t\tfp.stdin.w...
#!/usr/bin/env python import getopt,sys import subprocess from random import random,randint,seed from math import sqrt def runtest(li,args): # abro ./domino con parametros args fp=subprocess.Popen(['./domino']+args, shell=False, stdin=subprocess.PIPE,stdout=subprocess.PIPE) for caso,p in li: fp.stdin.write(str(l...
[ [ 1, 0, 0.0244, 0.0244, 0, 0.66, 0, 588, 0, 2, 0, 0, 588, 0, 0 ], [ 1, 0, 0.0488, 0.0244, 0, 0.66, 0.1429, 394, 0, 1, 0, 0, 394, 0, 0 ], [ 1, 0, 0.0732, 0.0244, 0, ...
[ "import getopt,sys", "import subprocess", "from random import random,randint,seed", "from math import sqrt", "def runtest(li,args):\n\t# abro ./domino con parametros args\n\tfp=subprocess.Popen(['./domino']+args, shell=False, stdin=subprocess.PIPE,stdout=subprocess.PIPE)\n\tfor caso,p in li:\n\t\tfp.stdin.w...
from math import cos,pi,sqrt def pretty(m): #funcion que imprime una matriz print '\n'.join([' '.join(map(str,line)) for line in m]) def productoria(li): return reduce(lambda x,y:x*y, li, 1) def sano(n): #algoritmo magico :D return int(round(productoria([sqrt(sqrt(4*cos(pi*j/(n+1))**2+4*cos(pi*k/(n+1))**2)) for...
[ [ 1, 0, 0.0139, 0.0139, 0, 0.66, 0, 526, 0, 3, 0, 0, 526, 0, 0 ], [ 2, 0, 0.0556, 0.0417, 0, 0.66, 0.2, 369, 0, 1, 0, 0, 0, 0, 4 ], [ 8, 1, 0.0694, 0.0139, 1, 0.28,...
[ "from math import cos,pi,sqrt", "def pretty(m):\n\t#funcion que imprime una matriz\n\tprint('\\n'.join([' '.join(map(str,line)) for line in m]))", "\tprint('\\n'.join([' '.join(map(str,line)) for line in m]))", "def productoria(li):\n\treturn reduce(lambda x,y:x*y, li, 1)", "\treturn reduce(lambda x,y:x*y, ...
#!/usr/bin/env python import getopt,sys import subprocess from random import random,randint,seed from math import sqrt def runtest(li,args): # abro ./domino con parametros args fp=subprocess.Popen(['./domino']+args, shell=False, stdin=subprocess.PIPE,stdout=subprocess.PIPE) for caso,p in li: fp.stdin.write(str(l...
[ [ 1, 0, 0.0244, 0.0244, 0, 0.66, 0, 588, 0, 2, 0, 0, 588, 0, 0 ], [ 1, 0, 0.0488, 0.0244, 0, 0.66, 0.1429, 394, 0, 1, 0, 0, 394, 0, 0 ], [ 1, 0, 0.0732, 0.0244, 0, ...
[ "import getopt,sys", "import subprocess", "from random import random,randint,seed", "from math import sqrt", "def runtest(li,args):\n\t# abro ./domino con parametros args\n\tfp=subprocess.Popen(['./domino']+args, shell=False, stdin=subprocess.PIPE,stdout=subprocess.PIPE)\n\tfor caso,p in li:\n\t\tfp.stdin.w...
#!/usr/bin/env python import getopt,sys import subprocess from random import randint,seed from math import sqrt def runtest(li,args): # abro ./amigos con parametros: time 0.1 3 fp=subprocess.Popen(['./intervalos']+args, shell=False, stdin=subprocess.PIPE,stdout=subprocess.PIPE) for i in li: fp.stdin.write(str(le...
[ [ 1, 0, 0.0476, 0.0476, 0, 0.66, 0, 588, 0, 2, 0, 0, 588, 0, 0 ], [ 1, 0, 0.0952, 0.0476, 0, 0.66, 0.2, 394, 0, 1, 0, 0, 394, 0, 0 ], [ 1, 0, 0.1429, 0.0476, 0, 0.6...
[ "import getopt,sys", "import subprocess", "from random import randint,seed", "from math import sqrt", "def runtest(li,args):\n\t# abro ./amigos con parametros: time 0.1 3\n\tfp=subprocess.Popen(['./intervalos']+args, shell=False, stdin=subprocess.PIPE,stdout=subprocess.PIPE)\n\tfor i in li:\n\t\tfp.stdin.wr...
f=open('Tp1Ej1.in') while True: li=map(float,f.readline().rsplit()) if li[0]<0: break li.pop(0) li.sort() mi,count=li.pop(0)+1,1 for x in li: if x>mi: count+=1 mi=x+1 print count
[ [ 14, 0, 0.0833, 0.0833, 0, 0.66, 0, 899, 3, 1, 0, 0, 693, 10, 1 ], [ 5, 0, 0.5833, 0.9167, 0, 0.66, 1, 0, 1, 0, 0, 0, 0, 0, 7 ], [ 14, 1, 0.25, 0.0833, 1, 0.09, ...
[ "f=open('Tp1Ej1.in')", "while True:\n\tli=map(float,f.readline().rsplit())\n\tif li[0]<0: break\n\tli.pop(0)\n\tli.sort()\n\tmi,count=li.pop(0)+1,1\n\tfor x in li:\n\t\tif x>mi:", "\tli=map(float,f.readline().rsplit())", "\tif li[0]<0: break", "\tli.pop(0)", "\tli.sort()", "\tmi,count=li.pop(0)+1,1", ...
#!/usr/bin/env python import getopt,sys import subprocess from random import randint,seed from math import sqrt def runtest(li,args): # abro ./amigos con parametros: time 0.1 3 fp=subprocess.Popen(['./intervalos']+args, shell=False, stdin=subprocess.PIPE,stdout=subprocess.PIPE) for i in li: fp.stdin.write(str(le...
[ [ 1, 0, 0.0476, 0.0476, 0, 0.66, 0, 588, 0, 2, 0, 0, 588, 0, 0 ], [ 1, 0, 0.0952, 0.0476, 0, 0.66, 0.2, 394, 0, 1, 0, 0, 394, 0, 0 ], [ 1, 0, 0.1429, 0.0476, 0, 0.6...
[ "import getopt,sys", "import subprocess", "from random import randint,seed", "from math import sqrt", "def runtest(li,args):\n\t# abro ./amigos con parametros: time 0.1 3\n\tfp=subprocess.Popen(['./intervalos']+args, shell=False, stdin=subprocess.PIPE,stdout=subprocess.PIPE)\n\tfor i in li:\n\t\tfp.stdin.wr...
#!/usr/bin/python import random import sys for i in range(1): tanda = random.randint(15,30) for i in range(tanda): if i == 0 : sys.stdout.write('%d' % tanda) sys.stdout.write(' %d' % random.randint(-20,10)) sys.stdout.write("\n")
[ [ 1, 0, 0.2308, 0.0769, 0, 0.66, 0, 715, 0, 1, 0, 0, 715, 0, 0 ], [ 1, 0, 0.3077, 0.0769, 0, 0.66, 0.5, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 6, 0, 0.7692, 0.5385, 0, 0.6...
[ "import random", "import sys", "for i in range(1):\n\ttanda = random.randint(15,30)\n\tfor i in range(tanda):\n\t\tif i == 0 :\n\t\t\tsys.stdout.write('%d' % tanda)\n\t\tsys.stdout.write(' %d' % random.randint(-20,10))\n\tsys.stdout.write(\"\\n\")", "\ttanda = random.randint(15,30)", "\tfor i in range(tanda...
#!/usr/bin/python import random import sys for i in range(1): tanda = random.randint(15,30) for i in range(tanda): if i == 0 : sys.stdout.write('%d' % tanda) sys.stdout.write(' %d' % random.randint(-20,10)) sys.stdout.write("\n")
[ [ 1, 0, 0.2308, 0.0769, 0, 0.66, 0, 715, 0, 1, 0, 0, 715, 0, 0 ], [ 1, 0, 0.3077, 0.0769, 0, 0.66, 0.5, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 6, 0, 0.7692, 0.5385, 0, 0.6...
[ "import random", "import sys", "for i in range(1):\n\ttanda = random.randint(15,30)\n\tfor i in range(tanda):\n\t\tif i == 0 :\n\t\t\tsys.stdout.write('%d' % tanda)\n\t\tsys.stdout.write(' %d' % random.randint(-20,10))\n\tsys.stdout.write(\"\\n\")", "\ttanda = random.randint(15,30)", "\tfor i in range(tanda...
#!/usr/bin/python #este es el grafo de ejemplo que me genera la matris # 0 -> 3 # 1 -> 3 # 2 -> 3 # 4 -> 3 # 2 - > 5 adjacencyMatix = [ [0,0,0,1,0,0] , \ [0,0,0,1,0,0] , \ [0,0,0,1,0,0] , \ [1,1,1,0,1,0] , \ [0,0,0,1,0,0] , \ [0,0,1,0,0,0] ] stations = [0] def nodeIsConnected(node,parent...
[ [ 2, 0, 0.5, 0.9375, 0, 0.66, 0, 292, 0, 2, 1, 0, 0, 0, 3 ], [ 4, 1, 0.2812, 0.125, 1, 0.23, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], [ 13, 2, 0.3125, 0.0625, 2, 0.96, 0, ...
[ "def nodeIsConnected(node,parent=None):\n\tglobal adjacencyMatix\n\t\n\tif node in stations:\n\t\treturn True\n\n\tfor i in range(len(adjacencyMatix)):\n\t\tif i == node or i == parent:", "\tif node in stations:\n\t\treturn True", "\t\treturn True", "\tfor i in range(len(adjacencyMatix)):\n\t\tif i == node or...
#! /usr/bin/env python import math def distancia(a,b): return math.sqrt((int(b[0])-int(a[0]))**2 + (int(b[1])-int(a[1]))**2 ) fo = open("testej2.in", "r") primeraLinea = fo.readline().split() #Trato la entrada n = int(primeraLinea[0]) k = int(primeraLinea[1]) puntos = [] # este es mi arreglo de puntos no se to...
[ [ 1, 0, 0.0238, 0.0119, 0, 0.66, 0, 526, 0, 1, 0, 0, 526, 0, 0 ], [ 2, 0, 0.0536, 0.0238, 0, 0.66, 0.0435, 476, 0, 2, 1, 0, 0, 0, 5 ], [ 13, 1, 0.0595, 0.0119, 1, 0...
[ "import math", "def distancia(a,b):\n\treturn math.sqrt((int(b[0])-int(a[0]))**2 + (int(b[1])-int(a[1]))**2 )", "\treturn math.sqrt((int(b[0])-int(a[0]))**2 + (int(b[1])-int(a[1]))**2 )", "fo = open(\"testej2.in\", \"r\")", "primeraLinea = fo.readline().split()", "n = int(primeraLinea[0])", "k = int(pri...
#!/usr/bin/python #este es el grafo de ejemplo que me genera la matris # 0 -> 3 # 1 -> 3 # 2 -> 3 # 4 -> 3 # 2 - > 5 adjacencyMatix = [ [0,0,0,1,0,0] , \ [0,0,0,1,0,0] , \ [0,0,0,1,0,0] , \ [1,1,1,0,1,0] , \ [0,0,0,1,0,0] , \ [0,0,1,0,0,0] ] stations = [0] def nodeIsConnected(node,parent...
[ [ 2, 0, 0.5, 0.9375, 0, 0.66, 0, 292, 0, 2, 1, 0, 0, 0, 3 ], [ 4, 1, 0.2812, 0.125, 1, 0.41, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], [ 13, 2, 0.3125, 0.0625, 2, 0.36, 0, ...
[ "def nodeIsConnected(node,parent=None):\n\tglobal adjacencyMatix\n\t\n\tif node in stations:\n\t\treturn True\n\n\tfor i in range(len(adjacencyMatix)):\n\t\tif i == node or i == parent:", "\tif node in stations:\n\t\treturn True", "\t\treturn True", "\tfor i in range(len(adjacencyMatix)):\n\t\tif i == node or...
#! /usr/bin/env python import math def distancia(a,b): return math.sqrt((int(b[0])-int(a[0]))**2 + (int(b[1])-int(a[1]))**2 ) fo = open("testej2.in", "r") primeraLinea = fo.readline().split() #Trato la entrada n = int(primeraLinea[0]) k = int(primeraLinea[1]) puntos = [] # este es mi arreglo de puntos no se to...
[ [ 1, 0, 0.0238, 0.0119, 0, 0.66, 0, 526, 0, 1, 0, 0, 526, 0, 0 ], [ 2, 0, 0.0536, 0.0238, 0, 0.66, 0.0435, 476, 0, 2, 1, 0, 0, 0, 5 ], [ 13, 1, 0.0595, 0.0119, 1, 0...
[ "import math", "def distancia(a,b):\n\treturn math.sqrt((int(b[0])-int(a[0]))**2 + (int(b[1])-int(a[1]))**2 )", "\treturn math.sqrt((int(b[0])-int(a[0]))**2 + (int(b[1])-int(a[1]))**2 )", "fo = open(\"testej2.in\", \"r\")", "primeraLinea = fo.readline().split()", "n = int(primeraLinea[0])", "k = int(pri...
#! /usr/bin/env python from random import randint #defino el nombre de cada archivo fo = open("testej2.in", "wb") n = randint(100,3000) #cantidad de pueblos k = randint(50,1000) #cantidad de entradas #primer linea la cantidad de pueblos y centrales fo.write( str(n) + " " + str(k) +"\n") #para cada pueblo genero su c...
[ [ 1, 0, 0.1429, 0.0476, 0, 0.66, 0, 715, 0, 1, 0, 0, 715, 0, 0 ], [ 14, 0, 0.3333, 0.0476, 0, 0.66, 0.1429, 542, 3, 2, 0, 0, 693, 10, 1 ], [ 14, 0, 0.381, 0.0476, 0, ...
[ "from random import randint", "fo = open(\"testej2.in\", \"wb\")", "n = randint(100,3000) #cantidad de pueblos", "k = randint(50,1000) #cantidad de entradas", "fo.write( str(n) + \" \" + str(k) +\"\\n\")", "for i in range(n):\n\tx = randint(1,1000)\n\ty = randint(1,1000)\n\tfo.write( str(x) + \" \" + str(...
#! /usr/bin/env python from random import randint #defino el nombre de cada archivo fo = open("testej2.in", "wb") n = randint(100,3000) #cantidad de pueblos k = randint(50,1000) #cantidad de entradas #primer linea la cantidad de pueblos y centrales fo.write( str(n) + " " + str(k) +"\n") #para cada pueblo genero su c...
[ [ 1, 0, 0.1429, 0.0476, 0, 0.66, 0, 715, 0, 1, 0, 0, 715, 0, 0 ], [ 14, 0, 0.3333, 0.0476, 0, 0.66, 0.1429, 542, 3, 2, 0, 0, 693, 10, 1 ], [ 14, 0, 0.381, 0.0476, 0, ...
[ "from random import randint", "fo = open(\"testej2.in\", \"wb\")", "n = randint(100,3000) #cantidad de pueblos", "k = randint(50,1000) #cantidad de entradas", "fo.write( str(n) + \" \" + str(k) +\"\\n\")", "for i in range(n):\n\tx = randint(1,1000)\n\ty = randint(1,1000)\n\tfo.write( str(x) + \" \" + str(...
#!/usr/bin/python import random import sys import string import os import time print sys.getrecursionlimit() sys.setrecursionlimit(5000) print sys.getrecursionlimit() #sys.exit() #filas n = 10 #columnas m = 10 DEBUG=0 def debug(s): if DEBUG : print s # las fichas se numeran asi en sus coordenadas # 2 # 1 3 ...
[ [ 1, 0, 0.0115, 0.0038, 0, 0.66, 0, 715, 0, 1, 0, 0, 715, 0, 0 ], [ 1, 0, 0.0153, 0.0038, 0, 0.66, 0.0286, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.0192, 0.0038, 0, ...
[ "import random", "import sys", "import string", "import os", "import time", "print(sys.getrecursionlimit())", "sys.setrecursionlimit(5000)", "print(sys.getrecursionlimit())", "n = 10", "m = 10", "DEBUG=0", "def debug(s):\n\tif DEBUG :\n\t\tprint(s)", "\tif DEBUG :\n\t\tprint(s)", "\t\tprin...
#!/usr/bin/python import random import sys import string import os import time print sys.getrecursionlimit() sys.setrecursionlimit(5000) print sys.getrecursionlimit() #sys.exit() #filas n = 10 #columnas m = 10 DEBUG=0 def debug(s): if DEBUG : print s # las fichas se numeran asi en sus coordenadas # 2 # 1 3 ...
[ [ 1, 0, 0.0115, 0.0038, 0, 0.66, 0, 715, 0, 1, 0, 0, 715, 0, 0 ], [ 1, 0, 0.0153, 0.0038, 0, 0.66, 0.0286, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.0192, 0.0038, 0, ...
[ "import random", "import sys", "import string", "import os", "import time", "print(sys.getrecursionlimit())", "sys.setrecursionlimit(5000)", "print(sys.getrecursionlimit())", "n = 10", "m = 10", "DEBUG=0", "def debug(s):\n\tif DEBUG :\n\t\tprint(s)", "\tif DEBUG :\n\t\tprint(s)", "\t\tprin...
#! /usr/bin/env python from random import randint #defino el nombre del unico archivo con varias instancias fo = open("ej1/1.in", "wb") #genero m instancias del problema for j in range(randint(1,100)): #obtengo un random para la cantidad de camiones n = randint(1,200) D = randint(1,200) # formato D n d1....dn ...
[ [ 1, 0, 0.087, 0.0435, 0, 0.66, 0, 715, 0, 1, 0, 0, 715, 0, 0 ], [ 14, 0, 0.2174, 0.0435, 0, 0.66, 0.25, 542, 3, 2, 0, 0, 693, 10, 1 ], [ 6, 0, 0.587, 0.6087, 0, 0....
[ "from random import randint", "fo = open(\"ej1/1.in\", \"wb\")", "for j in range(randint(1,100)):\n\t#obtengo un random para la cantidad de camiones\n\tn = randint(1,200) \n\tD = randint(1,200)\n\t# formato D n d1....dn \n\n\tfo.write(str(D) + \" \" + str(n))", "\tn = randint(1,200)", "\tD = randint(1,2...
#! /usr/bin/env python from random import randint #defino el nombre de cada archivo fo = open("ej2/" + "testej2.txt", "wb") for j in range(200): #obtengo un random para la cantidad de joyas n = randint(1,100000) #primer linea la cantidad de joyas n fo.write( str(n) + "\n") #para cada joya genero un di ti rando...
[ [ 1, 0, 0.15, 0.05, 0, 0.66, 0, 715, 0, 1, 0, 0, 715, 0, 0 ], [ 14, 0, 0.35, 0.05, 0, 0.66, 0.25, 542, 3, 2, 0, 0, 693, 10, 1 ], [ 6, 0, 0.625, 0.5, 0, 0.66, 0....
[ "from random import randint", "fo = open(\"ej2/\" + \"testej2.txt\", \"wb\")", "for j in range(200):\n\t#obtengo un random para la cantidad de joyas\n\tn = randint(1,100000)\n\t#primer linea la cantidad de joyas n\n\tfo.write( str(n) + \"\\n\")\n\t#para cada joya genero un di ti random y lo escribo\n\tfor i in...
#! /usr/bin/env python from random import randint #defino el nombre de cada archivo fo = open("ej3/1.in", "wb") #obtengo cantidad de filas, columnas y colores n = randint(2,6) m = randint(2,6) c = randint(1,8) #primer linea filas,columnas y colores fo.write( str(n) + " " + str(m) + " " + str(c) + "\n") #para cad...
[ [ 1, 0, 0.1304, 0.0435, 0, 0.66, 0, 715, 0, 1, 0, 0, 715, 0, 0 ], [ 14, 0, 0.3043, 0.0435, 0, 0.66, 0.1429, 542, 3, 2, 0, 0, 693, 10, 1 ], [ 14, 0, 0.3913, 0.0435, 0, ...
[ "from random import randint", "fo = open(\"ej3/1.in\", \"wb\")", "n = randint(2,6)", "m = randint(2,6)", "c = randint(1,8)", "fo.write( str(n) + \" \" + str(m) + \" \" + str(c) + \"\\n\")", "for i in range(n*m):\n\tsup = str(randint(1,c))\n\tizq = str(randint(1,c))\n\tder = str(randint(1,c))\n\tinf =...
#! /usr/bin/env python from random import randint #defino el nombre de cada archivo fo = open("ej2/" + "testej2.txt", "wb") for j in range(200): #obtengo un random para la cantidad de joyas n = randint(1,100000) #primer linea la cantidad de joyas n fo.write( str(n) + "\n") #para cada joya genero un di ti rando...
[ [ 1, 0, 0.15, 0.05, 0, 0.66, 0, 715, 0, 1, 0, 0, 715, 0, 0 ], [ 14, 0, 0.35, 0.05, 0, 0.66, 0.25, 542, 3, 2, 0, 0, 693, 10, 1 ], [ 6, 0, 0.625, 0.5, 0, 0.66, 0....
[ "from random import randint", "fo = open(\"ej2/\" + \"testej2.txt\", \"wb\")", "for j in range(200):\n\t#obtengo un random para la cantidad de joyas\n\tn = randint(1,100000)\n\t#primer linea la cantidad de joyas n\n\tfo.write( str(n) + \"\\n\")\n\t#para cada joya genero un di ti random y lo escribo\n\tfor i in...
#! /usr/bin/env python from random import randint #defino el nombre del unico archivo con varias instancias fo = open("ej1/1.in", "wb") #genero m instancias del problema for j in range(randint(1,100)): #obtengo un random para la cantidad de camiones n = randint(1,200) D = randint(1,200) # formato D n d1....dn ...
[ [ 1, 0, 0.087, 0.0435, 0, 0.66, 0, 715, 0, 1, 0, 0, 715, 0, 0 ], [ 14, 0, 0.2174, 0.0435, 0, 0.66, 0.25, 542, 3, 2, 0, 0, 693, 10, 1 ], [ 6, 0, 0.587, 0.6087, 0, 0....
[ "from random import randint", "fo = open(\"ej1/1.in\", \"wb\")", "for j in range(randint(1,100)):\n\t#obtengo un random para la cantidad de camiones\n\tn = randint(1,200) \n\tD = randint(1,200)\n\t# formato D n d1....dn \n\n\tfo.write(str(D) + \" \" + str(n))", "\tn = randint(1,200)", "\tD = randint(1,2...
#! /usr/bin/env python from random import randint #defino el nombre de cada archivo fo = open("ej3/1.in", "wb") #obtengo cantidad de filas, columnas y colores n = randint(2,6) m = randint(2,6) c = randint(1,8) #primer linea filas,columnas y colores fo.write( str(n) + " " + str(m) + " " + str(c) + "\n") #para cad...
[ [ 1, 0, 0.1304, 0.0435, 0, 0.66, 0, 715, 0, 1, 0, 0, 715, 0, 0 ], [ 14, 0, 0.3043, 0.0435, 0, 0.66, 0.1429, 542, 3, 2, 0, 0, 693, 10, 1 ], [ 14, 0, 0.3913, 0.0435, 0, ...
[ "from random import randint", "fo = open(\"ej3/1.in\", \"wb\")", "n = randint(2,6)", "m = randint(2,6)", "c = randint(1,8)", "fo.write( str(n) + \" \" + str(m) + \" \" + str(c) + \"\\n\")", "for i in range(n*m):\n\tsup = str(randint(1,c))\n\tizq = str(randint(1,c))\n\tder = str(randint(1,c))\n\tinf =...
#! /usr/bin/env python import numpy as np; import re; # regexp import matplotlib.pyplot as mp; ################################################################ # Airfoil : load profile of a wing # # Reads a file whose lines contain coordinates of points, # separated by an empty line. # Every line not containing a cou...
[ [ 1, 0, 0.024, 0.008, 0, 0.66, 0, 954, 0, 1, 0, 0, 954, 0, 0 ], [ 1, 0, 0.032, 0.008, 0, 0.66, 0.0667, 540, 0, 1, 0, 0, 540, 0, 0 ], [ 1, 0, 0.04, 0.008, 0, 0.66, ...
[ "import numpy as np;", "import re; # regexp", "import matplotlib.pyplot as mp;", "def load_foil(file):\n f = open(file, 'r')\n matchline = lambda line: re.match(r\"\\s*([\\d\\.-]+)\\s*([\\d\\.-]+)\", line)\n extra = []; intra = []\n rextra = False; rintra = False\n for line in f:\n m...
#! /usr/bin/env python import numpy as np; import re; # regexp import matplotlib.pyplot as mp; ################################################################ # Airfoil : load profile of a wing # # Reads a file whose lines contain coordinates of points, # separated by an empty line. # Every line not containing a cou...
[ [ 1, 0, 0.024, 0.008, 0, 0.66, 0, 954, 0, 1, 0, 0, 954, 0, 0 ], [ 1, 0, 0.032, 0.008, 0, 0.66, 0.0667, 540, 0, 1, 0, 0, 540, 0, 0 ], [ 1, 0, 0.04, 0.008, 0, 0.66, ...
[ "import numpy as np;", "import re; # regexp", "import matplotlib.pyplot as mp;", "def load_foil(file):\n f = open(file, 'r')\n matchline = lambda line: re.match(r\"\\s*([\\d\\.-]+)\\s*([\\d\\.-]+)\", line)\n extra = []; intra = []\n rextra = False; rintra = False\n for line in f:\n m...
import numpy as np import matplotlib.pyplot as mp import load_foil as lf #------------------------------------------------------------------------# # INTEGRAL METHODS # #------------------------------------------------------------------------# def rectangle_metho...
[ [ 1, 0, 0.0082, 0.0082, 0, 0.66, 0, 954, 0, 1, 0, 0, 954, 0, 0 ], [ 1, 0, 0.0164, 0.0082, 0, 0.66, 0.0526, 596, 0, 1, 0, 0, 596, 0, 0 ], [ 1, 0, 0.0246, 0.0082, 0, ...
[ "import numpy as np", "import matplotlib.pyplot as mp", "import load_foil as lf", "def rectangle_method(x,y,n,f):\n \"\"\"Computes the integral of the function f between x and y with the rectangle method (n subdivisions)\"\"\"\n alpha = (y-x)/n\n s = 0.\n for k in np.arange(0,n):\n s = s + ...
#!/usr/bin/env python from sys import platform requires = {} try: from setuptools import setup if not platform.startswith('java'): requires = { 'install_requires': ['robotframework', 'paramiko >= 1.8.0'], } except ImportError: from distutils.core import setup from os.path i...
[ [ 1, 0, 0.0638, 0.0213, 0, 0.66, 0, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 14, 0, 0.1064, 0.0213, 0, 0.66, 0.1429, 151, 0, 0, 0, 0, 0, 6, 0 ], [ 7, 0, 0.234, 0.1915, 0, 0....
[ "from sys import platform", "requires = {}", "try:\n from setuptools import setup\n\n if not platform.startswith('java'):\n requires = {\n 'install_requires': ['robotframework', 'paramiko >= 1.8.0'],\n }\nexcept ImportError:", " from setuptools import setup", " if not pl...
# Copyright 2008-2013 Nokia Siemens Networks Oyj # # 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...
[ [ 7, 0, 0.1039, 0.0449, 0, 0.66, 0, 0, 0, 1, 0, 0, 0, 0, 1 ], [ 1, 1, 0.0927, 0.0112, 1, 0.65, 0, 514, 0, 5, 0, 0, 514, 0, 0 ], [ 1, 0, 0.1292, 0.0056, 0, 0.66, ...
[ "try:\n from com.trilead.ssh2 import (Connection, SFTPException, SFTPv3Client,\n SFTPv3DirectoryEntry, StreamGobbler)\nexcept ImportError:\n raise ImportError(\n 'Importing Trilead SSH library failed. '\n 'Make sure you have the Trilead JAR distribution in your C...
# Copyright 2008-2013 Nokia Siemens Networks Oyj # # 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...
[ [ 1, 0, 0.75, 0.05, 0, 0.66, 0, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 4, 0, 0.925, 0.2, 0, 0.66, 1, 0, 3, 0, 0, 0, 0, 0, 1 ], [ 1, 1, 0.9, 0.05, 1, 0.05, 0, 209, ...
[ "import sys", "if sys.platform.startswith('java'):\n from javaclient import JavaSSHClient as SSHClient\nelse:\n from pythonclient import PythonSSHClient as SSHClient", " from javaclient import JavaSSHClient as SSHClient", " from pythonclient import PythonSSHClient as SSHClient" ]
# Copyright 2008-2013 Nokia Siemens Networks Oyj # # 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...
[ [ 1, 0, 0.0714, 0.0051, 0, 0.66, 0, 654, 0, 1, 0, 0, 654, 0, 0 ], [ 7, 0, 0.0969, 0.0357, 0, 0.66, 0.0833, 0, 0, 1, 0, 0, 0, 0, 1 ], [ 1, 1, 0.0867, 0.0051, 1, 0.62...
[ "import time", "try:\n import paramiko\nexcept ImportError:\n raise ImportError(\n 'Importing Paramiko library failed. '\n 'Make sure you have Paramiko installed.'\n )", " import paramiko", "from .abstractclient import (AbstractShell, AbstractSFTPClient,\n ...
from robot import utils class ConfigurationException(Exception): """Raised when creating, updating or accessing a Configuration entry fails. """ pass class Configuration(object): """A simple configuration class. Configuration is defined with keyword arguments, in which the value must be an ...
[ [ 1, 0, 0.0075, 0.0075, 0, 0.66, 0, 735, 0, 1, 0, 0, 735, 0, 0 ], [ 3, 0, 0.0414, 0.0301, 0, 0.66, 0.125, 151, 0, 0, 0, 0, 645, 0, 0 ], [ 8, 1, 0.0414, 0.015, 1, 0....
[ "from robot import utils", "class ConfigurationException(Exception):\n \"\"\"Raised when creating, updating or accessing a Configuration entry fails.\n \"\"\"\n pass", " \"\"\"Raised when creating, updating or accessing a Configuration entry fails.\n \"\"\"", "class Configuration(object):\n ...
VERSION = '2.0.2'
[ [ 14, 0, 1, 1, 0, 0.66, 0, 557, 1, 0, 0, 0, 0, 3, 0 ] ]
[ "VERSION = '2.0.2'" ]
# Copyright 2008-2013 Nokia Siemens Networks Oyj # # 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...
[ [ 1, 0, 0.9375, 0.0625, 0, 0.66, 0, 860, 0, 1, 0, 0, 860, 0, 0 ], [ 1, 0, 1, 0.0625, 0, 0.66, 1, 608, 0, 1, 0, 0, 608, 0, 0 ] ]
[ "from .library import SSHLibrary", "from .client import SSHClient" ]
#!/usr/bin/env python import sys import os from robot.libdoc import libdoc ROOT = os.path.normpath(os.path.join(os.path.abspath(__file__), '..', '..')) sys.path.insert(0, os.path.join(ROOT, 'src')) if __name__ == '__main__': ipath = os.path.join(ROOT, 'src', 'SSHLibrary') opath = os.path.join(ROOT, 'doc', '...
[ [ 1, 0, 0.1667, 0.0556, 0, 0.66, 0, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.2222, 0.0556, 0, 0.66, 0.2, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.3333, 0.0556, 0, 0.6...
[ "import sys", "import os", "from robot.libdoc import libdoc", "ROOT = os.path.normpath(os.path.join(os.path.abspath(__file__), '..', '..'))", "sys.path.insert(0, os.path.join(ROOT, 'src'))", "if __name__ == '__main__':\n ipath = os.path.join(ROOT, 'src', 'SSHLibrary')\n opath = os.path.join(ROOT, 'd...
import math class LineGeometry: def abscurve(self, p1, p2, p3): (x1,y1), (x2,y2), (x3,y3) = p1, p2, p3 a, b, c = self.line2d_in_general_form(p1, p3) if a == b == 0: return 0 return abs((a*x2+b*y2+c)/math.sqrt(a**2+b**2)) def line2d_in_general_form(self, p1, p2): """Ax...
[ [ 1, 0, 0.0323, 0.0323, 0, 0.66, 0, 526, 0, 1, 0, 0, 526, 0, 0 ], [ 3, 0, 0.5484, 0.871, 0, 0.66, 1, 843, 0, 2, 0, 0, 0, 0, 3 ], [ 2, 1, 0.2581, 0.1613, 1, 0.95, ...
[ "import math", "class LineGeometry:\n\n def abscurve(self, p1, p2, p3):\n (x1,y1), (x2,y2), (x3,y3) = p1, p2, p3\n a, b, c = self.line2d_in_general_form(p1, p3)\n if a == b == 0: return 0\n return abs((a*x2+b*y2+c)/math.sqrt(a**2+b**2))", " def abscurve(self, p1, p2, p3):\n ...
import thread import weakref import time import gobject class Timer: def alarmIn(self, delay, instance, action, *args): gobject.timeout_add(int(delay*1000), self.delayed_response, delay, weakref.ref(instance), action, args) #thread.start_new(self.delayed_response, ...
[ [ 1, 0, 0.037, 0.037, 0, 0.66, 0, 260, 0, 1, 0, 0, 260, 0, 0 ], [ 1, 0, 0.0741, 0.037, 0, 0.66, 0.2, 708, 0, 1, 0, 0, 708, 0, 0 ], [ 1, 0, 0.1111, 0.037, 0, 0.66, ...
[ "import thread", "import weakref", "import time", "import gobject", "class Timer:\n\n def alarmIn(self, delay, instance, action, *args):\n gobject.timeout_add(int(delay*1000), self.delayed_response, delay,\n weakref.ref(instance), action, args)\n #thread.start_new...
import weakref class Control(object): def isOutlet(self, connectionpoint, outlet): if hasattr(connectionpoint, 'attachment'): if repr(connectionpoint.attachment) == outlet: return True if hasattr(connectionpoint, 'tag'): if connectionpoint.tag == outlet: ...
[ [ 1, 0, 0.0075, 0.0075, 0, 0.66, 0, 708, 0, 1, 0, 0, 708, 0, 0 ], [ 3, 0, 0.1791, 0.306, 0, 0.66, 0.1667, 834, 0, 6, 0, 0, 186, 0, 21 ], [ 2, 1, 0.0858, 0.0896, 1, ...
[ "import weakref", "class Control(object):\n\n def isOutlet(self, connectionpoint, outlet):\n if hasattr(connectionpoint, 'attachment'):\n if repr(connectionpoint.attachment) == outlet:\n return True\n if hasattr(connectionpoint, 'tag'):\n if connectionpoint.tag ...
import pickle import new import StringIO import pattern.crossref def code(*args, **kwargs): return new.code(*args, **kwargs) def function(*args, **kwargs): return new.function(*args, **kwargs) class PluggablePickler(pickle.Pickler): def __init__(self, *args): pickle.Pickler.__init__(self, *arg...
[ [ 1, 0, 0.0118, 0.0118, 0, 0.66, 0, 848, 0, 1, 0, 0, 848, 0, 0 ], [ 1, 0, 0.0235, 0.0118, 0, 0.66, 0.1111, 145, 0, 1, 0, 0, 145, 0, 0 ], [ 1, 0, 0.0353, 0.0118, 0, ...
[ "import pickle", "import new", "import StringIO", "import pattern.crossref", "def code(*args, **kwargs):\n return new.code(*args, **kwargs)", " return new.code(*args, **kwargs)", "def function(*args, **kwargs):\n return new.function(*args, **kwargs)", " return new.function(*args, **kwargs)...
"""A package of useful stuff."""
[ [ 8, 0, 1, 1, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ] ]
[ "\"\"\"A package of useful stuff.\"\"\"" ]
"""Allows easy run-time tracing of references to objects. Each 'sink' deploys an 'xref' dictionary attribute which is updated whenever CrossReferences to the object are created and destroyed. By reading the current value of 'xref', one can tell which objects are referring the given object via the cross- reference mecha...
[ [ 8, 0, 0.0526, 0.0877, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.1228, 0.0175, 0, 0.66, 0.3333, 708, 0, 1, 0, 0, 708, 0, 0 ], [ 3, 0, 0.4123, 0.5263, 0, 0.66...
[ "\"\"\"Allows easy run-time tracing of references to objects. Each 'sink' deploys\nan 'xref' dictionary attribute which is updated whenever CrossReferences to\nthe object are created and destroyed. By reading the current value of 'xref',\none can tell which objects are referring the given object via the cross-\nref...
import os, imp import plugins.foolish import gobject class CodeBase(object): EDITOR = plugins.foolish.FoolishEditor() EDITOR_ARGS = [] ROOT = os.getcwd() TMPDIR = os.path.join(ROOT, "tmp") components = { } class NullComponent(object): def selected(self, *args): pass class EditSes...
[ [ 1, 0, 0.0147, 0.0147, 0, 0.66, 0, 688, 0, 2, 0, 0, 688, 0, 0 ], [ 1, 0, 0.0294, 0.0147, 0, 0.66, 0.0769, 991, 0, 1, 0, 0, 991, 0, 0 ], [ 1, 0, 0.0441, 0.0147, 0, ...
[ "import os, imp", "import plugins.foolish", "import gobject", "class CodeBase(object):\n\n EDITOR = plugins.foolish.FoolishEditor()\n EDITOR_ARGS = []\n ROOT = os.getcwd()\n TMPDIR = os.path.join(ROOT, \"tmp\")\n\n components = { }", " EDITOR = plugins.foolish.FoolishEditor()", " EDIT...
from pattern.circuit import Control class entry(Control): def please(self, event): page = "" for c in ["1", "2", "3", "4", "5"]: bridge = self.acquireInterface(event, c) if bridge is not None: page += str(bridge.pull(*event.data)) return page
[ [ 1, 0, 0.0909, 0.0909, 0, 0.66, 0, 53, 0, 1, 0, 0, 53, 0, 0 ], [ 3, 0, 0.6364, 0.8182, 0, 0.66, 1, 812, 0, 1, 0, 0, 834, 0, 3 ], [ 2, 1, 0.7273, 0.6364, 1, 0.94, ...
[ "from pattern.circuit import Control", "class entry(Control):\n\n def please(self, event):\n page = \"\"\n for c in [\"1\", \"2\", \"3\", \"4\", \"5\"]:\n bridge = self.acquireInterface(event, c)\n if bridge is not None:\n page += str(bridge.pull(*event.data))...
from pattern.circuit import Control class entry(Control): def incoming(self, event): temporal, node = event.data if temporal == "post": bridge = self.acquireInterface(event, "output") if bridge is not None: bridge.push(event.trail.operands.pop())
[ [ 1, 0, 0.1, 0.1, 0, 0.66, 0, 53, 0, 1, 0, 0, 53, 0, 0 ], [ 3, 0, 0.7, 0.7, 0, 0.66, 1, 812, 0, 1, 0, 0, 834, 0, 3 ], [ 2, 1, 0.75, 0.6, 1, 0.05, 0, 787, ...
[ "from pattern.circuit import Control", "class entry(Control):\n def incoming(self, event):\n temporal, node = event.data\n if temporal == \"post\":\n bridge = self.acquireInterface(event, \"output\")\n if bridge is not None:\n bridge.push(event.trail.operands....
from pattern.circuit import Control class entry(Control): def incoming(self, event): destination, message = event.data bridge = self.acquireInterface(event, "users") if bridge is not None: users = bridge.pull() for username in self.getUserList(event, destination): connection = users.get(username, N...
[ [ 1, 0, 0.0476, 0.0476, 0, 0.66, 0, 53, 0, 1, 0, 0, 53, 0, 0 ], [ 3, 0, 0.5952, 0.8571, 0, 0.66, 1, 812, 0, 2, 0, 0, 834, 0, 9 ], [ 2, 1, 0.5, 0.4762, 1, 0.98, ...
[ "from pattern.circuit import Control", "class entry(Control):\n\t\n\tdef incoming(self, event):\n\t\tdestination, message = event.data\n\t\tbridge = self.acquireInterface(event, \"users\")\n\t\tif bridge is not None:\n\t\t\tusers = bridge.pull()\n\t\t\tfor username in self.getUserList(event, destination):", "\t...
from pattern.circuit import Control class entry(Control): def please(self, event): bridge = self.acquireInterface(event, "contents") if bridge is not None: bridge.trail.key = event.shape.key return bridge.pull()
[ [ 1, 0, 0.1111, 0.1111, 0, 0.66, 0, 53, 0, 1, 0, 0, 53, 0, 0 ], [ 3, 0, 0.6667, 0.7778, 0, 0.66, 1, 812, 0, 1, 0, 0, 834, 0, 2 ], [ 2, 1, 0.7778, 0.5556, 1, 0.58, ...
[ "from pattern.circuit import Control", "class entry(Control):\n \n def please(self, event):\n bridge = self.acquireInterface(event, \"contents\")\n if bridge is not None:\n bridge.trail.key = event.shape.key\n return bridge.pull()", " def please(self, event):\n ...
from pattern.circuit import Control class entry(Control): def incoming(self, event): username, = event.data bridge = self.acquireInterface(event, "left:20%") if bridge is not None: bridge.push("leave", username) bridge = self.acquireInterface(event, "left:80%") if bridge is not None: bridge.push("p...
[ [ 1, 0, 0.0769, 0.0769, 0, 0.66, 0, 53, 0, 1, 0, 0, 53, 0, 0 ], [ 3, 0, 0.6538, 0.7692, 0, 0.66, 1, 812, 0, 1, 0, 0, 834, 0, 4 ], [ 2, 1, 0.7308, 0.6154, 1, 0.73, ...
[ "from pattern.circuit import Control", "class entry(Control):\n\t\n\tdef incoming(self, event):\n\t\tusername, = event.data\n\t\tbridge = self.acquireInterface(event, \"left:20%\")\n\t\tif bridge is not None:\n\t\t\tbridge.push(\"leave\", username)\n\t\tbridge = self.acquireInterface(event, \"left:80%\")", "\td...
class entry: def incoming(self, event): for item in event.data: print item
[ [ 3, 0, 0.625, 1, 0, 0.66, 0, 812, 0, 1, 0, 0, 0, 0, 1 ], [ 2, 1, 0.75, 0.75, 1, 0.33, 0, 787, 0, 2, 0, 0, 0, 0, 1 ], [ 6, 2, 0.875, 0.5, 2, 0.87, 0, 434, ...
[ "class entry:\n def incoming(self, event):\n for item in event.data:\n print(item)", " def incoming(self, event):\n for item in event.data:\n print(item)", " for item in event.data:\n print(item)", " print(item)" ]
from pattern.circuit import Control class entry(Control): def please(self, event): bridge = self.acquireInterface(event, "from") if bridge is not None: return bridge.pull(event.trail.key)
[ [ 1, 0, 0.125, 0.125, 0, 0.66, 0, 53, 0, 1, 0, 0, 53, 0, 0 ], [ 3, 0, 0.6875, 0.75, 0, 0.66, 1, 812, 0, 1, 0, 0, 834, 0, 2 ], [ 2, 1, 0.8125, 0.5, 1, 0.55, 0, ...
[ "from pattern.circuit import Control", "class entry(Control):\n \n def please(self, event):\n bridge = self.acquireInterface(event, \"from\")\n if bridge is not None:\n return bridge.pull(event.trail.key)", " def please(self, event):\n bridge = self.acquireInterface(even...
class entry(object): VERBS = ["Edit Content"] PAGE = "<html><body>Hi There</body></html>" def __init__(self): self.page = self.PAGE def realize(self, event): self.realized = event if hasattr(event.shape, 'page'): self.page = event.shape.page d...
[ [ 3, 0, 0.5102, 0.9592, 0, 0.66, 0, 812, 0, 5, 0, 0, 186, 0, 27 ], [ 14, 1, 0.0816, 0.0204, 1, 0.72, 0, 295, 0, 0, 0, 0, 0, 5, 0 ], [ 14, 1, 0.102, 0.0204, 1, 0.72,...
[ "class entry(object):\n \n VERBS = [\"Edit Content\"]\n PAGE = \"<html><body>Hi There</body></html>\"\n \n def __init__(self):\n self.page = self.PAGE", " VERBS = [\"Edit Content\"]", " PAGE = \"<html><body>Hi There</body></html>\"", " def __init__(self):\n self.page = se...
class entry: class rvalue: def __init__(self, v): self._v = v def get(self): return self._v def incoming(self, event): temporal, node = event.data if temporal == "post": event.trail.operands.append(self.rvalue(node.literal))
[ [ 3, 0, 0.5625, 1, 0, 0.66, 0, 812, 0, 3, 0, 0, 0, 0, 2 ], [ 3, 1, 0.375, 0.375, 1, 0, 0, 996, 0, 2, 0, 0, 0, 0, 0 ], [ 2, 2, 0.375, 0.125, 2, 0.66, 0, 555,...
[ "class entry:\n class rvalue:\n def __init__(self, v): self._v = v\n def get(self): return self._v\n def incoming(self, event):\n temporal, node = event.data\n if temporal == \"post\":\n event.trail.operands.append(self.rvalue(node.literal))", " class rvalue:\n ...
from pattern.circuit import Control import re class entry(Control): MULTIPART = re.compile('Content-Disposition: form-data; name="(.*)"\r\n([^\0]*)', re.MULTILINE) def incoming(self, event): ct = event.trail.headers["content-type"] cl = int(event.trail.headers["content-length"]) reque...
[ [ 1, 0, 0.0233, 0.0233, 0, 0.66, 0, 53, 0, 1, 0, 0, 53, 0, 0 ], [ 1, 0, 0.0465, 0.0233, 0, 0.66, 0.5, 540, 0, 1, 0, 0, 540, 0, 0 ], [ 3, 0, 0.5465, 0.9302, 0, 0.66,...
[ "from pattern.circuit import Control", "import re", "class entry(Control):\n\n MULTIPART = re.compile('Content-Disposition: form-data; name=\"(.*)\"\\r\\n([^\\0]*)', re.MULTILINE)\n\n def incoming(self, event):\n ct = event.trail.headers[\"content-type\"]\n cl = int(event.trail.headers[\"con...
from pattern.circuit import Control class entry(Control): class User(object): pass def __init__(self): self.users = { } def realize(self, event): self.updated(event) def incoming(self, event): action, user = event.data if action == "enter": self.enter(event, user) elif action == "leave": ...
[ [ 1, 0, 0.0222, 0.0222, 0, 0.66, 0, 53, 0, 1, 0, 0, 53, 0, 0 ], [ 3, 0, 0.5222, 0.8889, 0, 0.66, 1, 812, 0, 8, 0, 0, 834, 0, 10 ], [ 3, 1, 0.1444, 0.0444, 1, 0.98, ...
[ "from pattern.circuit import Control", "class entry(Control):\n\t\n\tclass User(object):\n\t\tpass\n\t\n\tdef __init__(self):\n\t\tself.users = { }", "\tclass User(object):\n\t\tpass", "\tdef __init__(self):\n\t\tself.users = { }", "\t\tself.users = { }", "\tdef realize(self, event):\n\t\tself.updated(eve...
from pattern.circuit import Control class entry(Control): def incoming(self, event): temporal, node = event.data bridge = self.acquireInterface(event, node.value()) if bridge is not None: bridge.push(temporal, node)
[ [ 1, 0, 0.1, 0.1, 0, 0.66, 0, 53, 0, 1, 0, 0, 53, 0, 0 ], [ 3, 0, 0.7, 0.7, 0, 0.66, 1, 812, 0, 1, 0, 0, 834, 0, 3 ], [ 2, 1, 0.8, 0.5, 1, 0.93, 0, 787, ...
[ "from pattern.circuit import Control", "class entry(Control):\n \n def incoming(self, event):\n temporal, node = event.data\n bridge = self.acquireInterface(event, node.value())\n if bridge is not None:\n bridge.push(temporal, node)", " def incoming(self, event):\n ...
from pattern.circuit import Control class entry(Control): def realize(self, event): if not hasattr(event.shape, "label"): event.shape.label = "Update" def please(self, event): key, = event.data label = event.shape.label return '<a class="wikilet_update" hre...
[ [ 1, 0, 0.0833, 0.0833, 0, 0.66, 0, 53, 0, 1, 0, 0, 53, 0, 0 ], [ 3, 0, 0.625, 0.8333, 0, 0.66, 1, 812, 0, 2, 0, 0, 834, 0, 1 ], [ 2, 1, 0.5, 0.25, 1, 0.99, 0, ...
[ "from pattern.circuit import Control", "class entry(Control):\n \n def realize(self, event):\n if not hasattr(event.shape, \"label\"):\n event.shape.label = \"Update\"\n \n def please(self, event):\n key, = event.data", " def realize(self, event):\n if not hasattr(...
class entry(object): VERBS = ["Clear"] def incoming(self, event): child = self.fetch(event) data = event.data if len(data) == 1: data = data[0] event.window.manipulate(child, lambda x: setattr(x, 'caption', str(data))) def realize(self, event): child = self.fetch(...
[ [ 3, 0, 0.5417, 0.9583, 0, 0.66, 0, 812, 0, 4, 0, 0, 186, 0, 12 ], [ 14, 1, 0.1667, 0.0417, 1, 0.29, 0, 295, 0, 0, 0, 0, 0, 5, 0 ], [ 2, 1, 0.3333, 0.2083, 1, 0.29,...
[ "class entry(object):\n\n VERBS = [\"Clear\"]\n\n def incoming(self, event):\n child = self.fetch(event)\n data = event.data\n if len(data) == 1: data = data[0]", " VERBS = [\"Clear\"]", " def incoming(self, event):\n child = self.fetch(event)\n data = event.data\n...
from pattern.circuit import Control class entry(Control): def incoming(self, event): cmd = event.data[0] elements = cmd.split() if elements: cmdname = elements[0].lower() bridge = self.acquireInterface(event, cmdname) if bridge is not None: ...
[ [ 1, 0, 0.0833, 0.0833, 0, 0.66, 0, 53, 0, 1, 0, 0, 53, 0, 0 ], [ 3, 0, 0.625, 0.8333, 0, 0.66, 1, 812, 0, 1, 0, 0, 834, 0, 4 ], [ 2, 1, 0.7083, 0.6667, 1, 0.08, ...
[ "from pattern.circuit import Control", "class entry(Control):\n\n def incoming(self, event):\n cmd = event.data[0]\n elements = cmd.split()\n if elements:\n cmdname = elements[0].lower()\n bridge = self.acquireInterface(event, cmdname)", " def incoming(self, even...
from pattern.circuit import Control class entry(Control): def incoming(self, event): print event.data bridge = self.acquireInterface(event, "left:50%") if bridge is not None: command = ":" + event.trail.username + \ "!localhost PRIVMSG " + \ " ".join(event.data[0]) destination = event.data[0]...
[ [ 1, 0, 0.0625, 0.0625, 0, 0.66, 0, 53, 0, 1, 0, 0, 53, 0, 0 ], [ 3, 0, 0.5625, 0.6875, 0, 0.66, 1, 812, 0, 1, 0, 0, 834, 0, 4 ], [ 2, 1, 0.625, 0.5625, 1, 0.56, ...
[ "from pattern.circuit import Control", "class entry(Control):\n\t\n\tdef incoming(self, event):\n\t\tprint(event.data)\n\t\tbridge = self.acquireInterface(event, \"left:50%\")\n\t\tif bridge is not None:\n\t\t\tcommand = \":\" + event.trail.username + \\\n\t\t\t\t\t\"!localhost PRIVMSG \" + \\", "\tdef incoming...
from pattern.circuit import Control class entry(Control): DEFAULT_REPLY = ":%(username)s!%(user)s PART :%(channel)s\r\n" def incoming(self, event): channel = event.data[0][0] username = event.trail.username self.onPart(event, channel.split(","), username) #event.trail.wfile.w...
[ [ 1, 0, 0.0476, 0.0476, 0, 0.66, 0, 53, 0, 1, 0, 0, 53, 0, 0 ], [ 3, 0, 0.5952, 0.8571, 0, 0.66, 1, 812, 0, 2, 0, 0, 834, 0, 4 ], [ 14, 1, 0.2857, 0.0476, 1, 0.11, ...
[ "from pattern.circuit import Control", "class entry(Control):\n\n DEFAULT_REPLY = \":%(username)s!%(user)s PART :%(channel)s\\r\\n\"\n\n def incoming(self, event):\n channel = event.data[0][0]\n username = event.trail.username\n self.onPart(event, channel.split(\",\"), username)", " ...
class entry: class lvalue: def __init__(self, scope, rname): self._scope = scope self._rname = rname def get(self): return self._scope.get(self._rname, None) def set(self, value): self._scope[self._rname] = value def incoming(self, ev...
[ [ 3, 0, 0.5333, 1, 0, 0.66, 0, 812, 0, 4, 0, 0, 0, 0, 3 ], [ 3, 1, 0.4333, 0.5333, 1, 0.5, 0, 502, 0, 3, 0, 0, 0, 0, 1 ], [ 2, 2, 0.3333, 0.2, 2, 0.29, 0, 5...
[ "class entry:\n \n class lvalue:\n def __init__(self, scope, rname):\n self._scope = scope\n self._rname = rname\n def get(self):\n return self._scope.get(self._rname, None)", " class lvalue:\n def __init__(self, scope, rname):\n self._scop...
class entry: class rvalue: def __init__(self, v): self._v = v def get(self): return self._v def __repr__(self): return "|%r|" % self._v def incoming(self, event): temporal, node = event.data if temporal == "post": p2 = event.trail.operands.pop() ...
[ [ 3, 0, 0.5417, 1, 0, 0.66, 0, 812, 0, 4, 0, 0, 0, 0, 6 ], [ 3, 1, 0.2917, 0.3333, 1, 0.08, 0, 996, 0, 3, 0, 0, 0, 0, 0 ], [ 2, 2, 0.25, 0.0833, 2, 0.86, 0, ...
[ "class entry:\n class rvalue:\n def __init__(self, v): self._v = v\n def get(self): return self._v\n def __repr__(self): return \"|%r|\" % self._v\n \n def incoming(self, event):\n temporal, node = event.data", " class rvalue:\n def __init__(self, v): self._v...
from pattern.circuit import Control class entry(Control): DEFAULT_REPLY = ":localhost guest2171 :- information. Thank you for using freenode!\r\n:localhost 376 guest2171 :End of /MOTD command.\r\n" def incoming(self, event): event.trail.wfile.write(self.DEFAULT_REPLY)
[ [ 1, 0, 0.1111, 0.1111, 0, 0.66, 0, 53, 0, 1, 0, 0, 53, 0, 0 ], [ 3, 0, 0.7222, 0.6667, 0, 0.66, 1, 812, 0, 1, 0, 0, 834, 0, 1 ], [ 14, 1, 0.6667, 0.1111, 1, 0.3, ...
[ "from pattern.circuit import Control", "class entry(Control):\n\n DEFAULT_REPLY = \":localhost guest2171 :- information. Thank you for using freenode!\\r\\n:localhost 376 guest2171 :End of /MOTD command.\\r\\n\"\n\n def incoming(self, event):\n event.trail.wfile.write(self.DEFAULT_REPLY)", " DE...
from pattern.circuit import Control class entry(Control): def incoming(self, event): temporal, node = event.data bridge = self.acquireInterface(event, "out") if temporal == event.shape.temporal: bridge.push(node)
[ [ 1, 0, 0.1111, 0.1111, 0, 0.66, 0, 53, 0, 1, 0, 0, 53, 0, 0 ], [ 3, 0, 0.7222, 0.6667, 0, 0.66, 1, 812, 0, 1, 0, 0, 834, 0, 2 ], [ 2, 1, 0.7778, 0.5556, 1, 0.23, ...
[ "from pattern.circuit import Control", "class entry(Control):\n def incoming(self, event):\n temporal, node = event.data\n bridge = self.acquireInterface(event, \"out\")\n if temporal == event.shape.temporal:\n bridge.push(node)", " def incoming(self, event):\n tempo...
from pattern.circuit import Control class entry(Control): def incoming(self, event): for out in ["1", "2"]: bridge = self.acquireInterface(event, out) if bridge is not None: bridge.push(*event.data)
[ [ 1, 0, 0.1, 0.1, 0, 0.66, 0, 53, 0, 1, 0, 0, 53, 0, 0 ], [ 3, 0, 0.6, 0.7, 0, 0.66, 1, 812, 0, 1, 0, 0, 834, 0, 2 ], [ 2, 1, 0.7, 0.5, 1, 0.82, 0, 787, ...
[ "from pattern.circuit import Control", "class entry(Control):\n\t\n def incoming(self, event):\n for out in [\"1\", \"2\"]:\n bridge = self.acquireInterface(event, out)\n if bridge is not None:\n bridge.push(*event.data)", " def incoming(self, event):\n f...
from pattern.circuit import Control class entry(Control): def incoming(self, event): root, = event.data bridge = self.acquireInterface(event, "out") if bridge is not None: bridge.push(self.walk(root)) def walk(self, root): return "(" + "\n".join([root.value()]...
[ [ 1, 0, 0.0769, 0.0769, 0, 0.66, 0, 53, 0, 1, 0, 0, 53, 0, 0 ], [ 3, 0, 0.6538, 0.7692, 0, 0.66, 1, 812, 0, 2, 0, 0, 834, 0, 7 ], [ 2, 1, 0.6154, 0.3846, 1, 0.46, ...
[ "from pattern.circuit import Control", "class entry(Control):\n \n def incoming(self, event):\n root, = event.data\n bridge = self.acquireInterface(event, \"out\")\n if bridge is not None:\n bridge.push(self.walk(root))", " def incoming(self, event):\n root, = eve...
from pattern.circuit import Control class entry(Control): VERBS = ["Push"] def verb(self, event): inbridge = self.acquireInterface(event, "in") outbridge = self.acquireInterface(event, "out") if inbridge is not None and outbridge is not None: outbridge.push(inbridge.pull())
[ [ 1, 0, 0.1111, 0.1111, 0, 0.66, 0, 53, 0, 1, 0, 0, 53, 0, 0 ], [ 3, 0, 0.6667, 0.7778, 0, 0.66, 1, 812, 0, 1, 0, 0, 834, 0, 4 ], [ 14, 1, 0.4444, 0.1111, 1, 0.39, ...
[ "from pattern.circuit import Control", "class entry(Control):\n VERBS = [\"Push\"]\n def verb(self, event):\n inbridge = self.acquireInterface(event, \"in\")\n outbridge = self.acquireInterface(event, \"out\")\n if inbridge is not None and outbridge is not None:\n outbridge.p...
from pattern.circuit import Control class entry(Control): def incoming(self, event): root, = event.data self.walk(event, root) def walk(self, event, root): self.visit(event, "pre", root) for child in root.childNodes(): self.walk(event, child) se...
[ [ 1, 0, 0.0556, 0.0556, 0, 0.66, 0, 53, 0, 1, 0, 0, 53, 0, 0 ], [ 3, 0, 0.5833, 0.8889, 0, 0.66, 1, 812, 0, 3, 0, 0, 834, 0, 7 ], [ 2, 1, 0.3333, 0.1667, 1, 0.24, ...
[ "from pattern.circuit import Control", "class entry(Control):\n \n def incoming(self, event):\n root, = event.data\n self.walk(event, root)\n \n def walk(self, event, root):\n self.visit(event, \"pre\", root)", " def incoming(self, event):\n root, = event.data\n ...
from pattern.circuit import Control class entry(Control): def incoming(self, event): bridge = self.acquireInterface(event, "out") if bridge is not None: bridge.push(event.data[0].value())
[ [ 1, 0, 0.1111, 0.1111, 0, 0.66, 0, 53, 0, 1, 0, 0, 53, 0, 0 ], [ 3, 0, 0.7222, 0.6667, 0, 0.66, 1, 812, 0, 1, 0, 0, 834, 0, 3 ], [ 2, 1, 0.8333, 0.4444, 1, 0.37, ...
[ "from pattern.circuit import Control", "class entry(Control):\n \n def incoming(self, event):\n bridge = self.acquireInterface(event, \"out\")\n if bridge is not None:\n bridge.push(event.data[0].value())", " def incoming(self, event):\n bridge = self.acquireInterface(ev...
class entry: def incoming(self, event): temporal, node = event.data if temporal == "post": r = event.trail.operands.pop() l = event.trail.operands.pop() l.set(r.get())
[ [ 3, 0, 0.5, 0.875, 0, 0.66, 0, 812, 0, 1, 0, 0, 0, 0, 4 ], [ 2, 1, 0.5625, 0.75, 1, 0.66, 0, 787, 0, 2, 0, 0, 0, 0, 4 ], [ 14, 2, 0.375, 0.125, 2, 0.68, 0, ...
[ "class entry:\n def incoming(self, event):\n temporal, node = event.data\n if temporal == \"post\":\n r = event.trail.operands.pop()\n l = event.trail.operands.pop()\n l.set(r.get())", " def incoming(self, event):\n temporal, node = event.data\n i...
from pattern.circuit import Control import weakref, gobject import os.path, posixpath, urllib import BaseHTTPServer, SimpleHTTPServer class SimpleHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): def get_root_path(self): s = self.server if s is not None and hasattr(s, 'getRootPath'):...
[ [ 1, 0, 0.0114, 0.0114, 0, 0.66, 0, 53, 0, 1, 0, 0, 53, 0, 0 ], [ 1, 0, 0.0227, 0.0114, 0, 0.66, 0.2, 708, 0, 2, 0, 0, 708, 0, 0 ], [ 1, 0, 0.0341, 0.0114, 0, 0.66,...
[ "from pattern.circuit import Control", "import weakref, gobject", "import os.path, posixpath, urllib", "import BaseHTTPServer, SimpleHTTPServer", "class SimpleHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):\n\n def get_root_path(self):\n s = self.server\n if s is not None and...
class entry: def incoming(self, event): event.trail.operands = [] event.trail.vars = { }
[ [ 3, 0, 0.625, 1, 0, 0.66, 0, 812, 0, 1, 0, 0, 0, 0, 0 ], [ 2, 1, 0.75, 0.75, 1, 0.69, 0, 787, 0, 2, 0, 0, 0, 0, 0 ], [ 14, 2, 0.75, 0.25, 2, 0.69, 0, 583, ...
[ "class entry:\n def incoming(self, event):\n event.trail.operands = []\n event.trail.vars = { }", " def incoming(self, event):\n event.trail.operands = []\n event.trail.vars = { }", " event.trail.operands = []", " event.trail.vars = { }" ]
from pattern.circuit import Control class entry(Control): VERBS = ["Go"] def verb(self, event): bridge = self.acquireInterface(event, "go") if bridge is not None: bridge.push()
[ [ 1, 0, 0.0833, 0.0833, 0, 0.66, 0, 53, 0, 1, 0, 0, 53, 0, 0 ], [ 3, 0, 0.6667, 0.75, 0, 0.66, 1, 812, 0, 1, 0, 0, 834, 0, 2 ], [ 14, 1, 0.5, 0.0833, 1, 0.15, 0...
[ "from pattern.circuit import Control", "class entry(Control):\n \n VERBS = [\"Go\"]\n \n def verb(self, event):\n \n bridge = self.acquireInterface(event, \"go\")\n if bridge is not None:", " VERBS = [\"Go\"]", " def verb(self, event):\n \n bridge = self.ac...
from pattern.circuit import Control class entry(Control): JOIN_MSG = ":%(username)s!%(user)s JOIN :%(channel)s" NAMES_RPL = ":%(servername)s 353 %(username)s = %(channel)s :%(userlist)s\r\n:%(servername)s 366 %(username)s %(channel)s :End of /NAMES list.\r\n" def incoming(self, event): channels ...
[ [ 1, 0, 0.0333, 0.0333, 0, 0.66, 0, 53, 0, 1, 0, 0, 53, 0, 0 ], [ 3, 0, 0.5667, 0.9, 0, 0.66, 1, 812, 0, 3, 0, 0, 834, 0, 10 ], [ 14, 1, 0.2, 0.0333, 1, 0.26, 0...
[ "from pattern.circuit import Control", "class entry(Control):\n\n JOIN_MSG = \":%(username)s!%(user)s JOIN :%(channel)s\"\n NAMES_RPL = \":%(servername)s 353 %(username)s = %(channel)s :%(userlist)s\\r\\n:%(servername)s 366 %(username)s %(channel)s :End of /NAMES list.\\r\\n\"\n\n def incoming(self, even...
from pattern.circuit import Control class entry(Control): def incoming(self, event): path, = event.data print path while path and path[0] == '/': path = path[1:] if path == "": path = "index.html" bridge = self.acquireInterface(event, path) if bridge is not None...
[ [ 1, 0, 0.0625, 0.0625, 0, 0.66, 0, 53, 0, 1, 0, 0, 53, 0, 0 ], [ 3, 0, 0.5938, 0.875, 0, 0.66, 1, 812, 0, 1, 0, 0, 834, 0, 5 ], [ 2, 1, 0.6562, 0.75, 1, 0.65, ...
[ "from pattern.circuit import Control", "class entry(Control):\n \n def incoming(self, event):\n path, = event.data\n print(path)\n while path and path[0] == '/': path = path[1:]\n if path == \"\": path = \"index.html\"\n bridge = self.acquireInterface(event, path)", " ...
import pattern.circuit import SocketServer import gobject import weakref, time, socket, select class entry(pattern.circuit.Control): class EchoRequest(SocketServer.StreamRequestHandler): def handle(self): self.server.notify("on", self) self.line = "" gobject.io_add_watch(self.rfile, gobject.IO_IN | gobje...
[ [ 1, 0, 0.0102, 0.0102, 0, 0.66, 0, 53, 0, 1, 0, 0, 53, 0, 0 ], [ 1, 0, 0.0204, 0.0102, 0, 0.66, 0.25, 646, 0, 1, 0, 0, 646, 0, 0 ], [ 1, 0, 0.0306, 0.0102, 0, 0.66...
[ "import pattern.circuit", "import SocketServer", "import gobject", "import weakref, time, socket, select", "class entry(pattern.circuit.Control):\n\t\n\tclass EchoRequest(SocketServer.StreamRequestHandler):\n\t\tdef handle(self):\n\t\t\tself.server.notify(\"on\", self)\n\t\t\tself.line = \"\"\n\t\t\tgobject...
from pattern.circuit import Control class entry(Control): DEFAULT_REPLY = ":%(servername)s 375 %(username)s\r\n:%(servername)s 372 %(username)s :- information. Thank you for using freenode!\r\n:%(servername)s 376 %(username)s :End of /MOTD command.\r\n" def incoming(self, event): event.trail.userna...
[ [ 1, 0, 0.0625, 0.0625, 0, 0.66, 0, 53, 0, 1, 0, 0, 53, 0, 0 ], [ 3, 0, 0.625, 0.8125, 0, 0.66, 1, 812, 0, 2, 0, 0, 834, 0, 3 ], [ 14, 1, 0.375, 0.0625, 1, 0.87, ...
[ "from pattern.circuit import Control", "class entry(Control):\n\n DEFAULT_REPLY = \":%(servername)s 375 %(username)s\\r\\n:%(servername)s 372 %(username)s :- information. Thank you for using freenode!\\r\\n:%(servername)s 376 %(username)s :End of /MOTD command.\\r\\n\"\n\n def incoming(self, event):\n ...
from pattern.circuit import Control class entry(Control): class Variable(object): def __init__(self): self.name = None def __init__(self): self.var = self.Variable() def please(self, event): outlet = self.acquireOutlet(event, "nam...
[ [ 1, 0, 0.0556, 0.0556, 0, 0.66, 0, 53, 0, 1, 0, 0, 53, 0, 0 ], [ 3, 0, 0.6111, 0.8333, 0, 0.66, 1, 812, 0, 3, 0, 0, 834, 0, 3 ], [ 3, 1, 0.3889, 0.1667, 1, 0.77, ...
[ "from pattern.circuit import Control", "class entry(Control):\n \n class Variable(object):\n def __init__(self):\n self.name = None\n \n \n def __init__(self):", " class Variable(object):\n def __init__(self):\n self.name = None", " ...
from pattern.circuit import Control class entry(Control): def incoming(self, event): username = event.trail.username self.onQuit(event, username) event.trail.release() def onQuit(self, event, username): bridge = self.acquireInterface(event, "onQuit") if bridge is not ...
[ [ 1, 0, 0.0714, 0.0714, 0, 0.66, 0, 53, 0, 1, 0, 0, 53, 0, 0 ], [ 3, 0, 0.6429, 0.7857, 0, 0.66, 1, 812, 0, 2, 0, 0, 834, 0, 4 ], [ 2, 1, 0.5357, 0.2857, 1, 0.97, ...
[ "from pattern.circuit import Control", "class entry(Control):\n\n def incoming(self, event):\n username = event.trail.username\n self.onQuit(event, username)\n event.trail.release()\n\n def onQuit(self, event, username):", " def incoming(self, event):\n username = event.trai...
from pattern.circuit import Control class entry(Control): def realize(self, event): if not hasattr(event.shape, "key"): event.shape.key = "default" def please(self, event): bridge = self.acquireInterface(event, "bottom:50%") if bridge is None: return "No st...
[ [ 1, 0, 0.0714, 0.0714, 0, 0.66, 0, 53, 0, 1, 0, 0, 53, 0, 0 ], [ 3, 0, 0.6071, 0.8571, 0, 0.66, 1, 812, 0, 2, 0, 0, 834, 0, 4 ], [ 2, 1, 0.4286, 0.2143, 1, 0.94, ...
[ "from pattern.circuit import Control", "class entry(Control):\n \n def realize(self, event):\n if not hasattr(event.shape, \"key\"):\n event.shape.key = \"default\"\n\n def please(self, event):\n bridge = self.acquireInterface(event, \"bottom:50%\")", " def realize(self, eve...
from pattern.circuit import Control class entry(Control): def please(self, event): key, = event.data bridge = self.acquireInterface(event, "storage") if bridge is None: return "No storage." else: return bridge.pull().get(key, "Key not found.")
[ [ 1, 0, 0.0909, 0.0909, 0, 0.66, 0, 53, 0, 1, 0, 0, 53, 0, 0 ], [ 3, 0, 0.6364, 0.8182, 0, 0.66, 1, 812, 0, 1, 0, 0, 834, 0, 3 ], [ 2, 1, 0.7273, 0.6364, 1, 0.12, ...
[ "from pattern.circuit import Control", "class entry(Control):\n \n def please(self, event):\n key, = event.data\n bridge = self.acquireInterface(event, \"storage\")\n if bridge is None:\n return \"No storage.\"\n else:", " def please(self, event):\n key, = ...