code stringlengths 1 1.49M | file_id stringlengths 42 46 | node_count int64 0 7.38k | total_lines int64 1 20.9k | vector_dim int64 15 15 | vector_labels stringclasses 1
value | nodes stringlengths 2 3.75M | connections stringlengths 2 964k |
|---|---|---|---|---|---|---|---|
def agPalindr(s):
n=len(s)
m=[[0 for x in range(n+1)] for y in range(n+1)]
for ini in range(2,n+1):
j,i=ini,0
while j<=n:
if s[i]==s[j-1]: m[i][j]=m[i+1][j-1]
else: m[i][j]=min(m[i][j-1],m[i+1][j])+1
j+=1
i+=1
print '\n'.join(map(lambda x:' '.join(map(str,x)),m))
return m[0][n]
f=open('palindromo.... | ajibawa-2023/Python-Code-Large/train/row_97479 | 14 | 16 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97479:FunctionDef_L1_C0", "label": "agPalindr", "type": "function", "loc": [1, 12], "level": 0, "parent": null, "vector": [2, 0, 0.4062, 0.75, 0, 0.66, 0.0, 553, 0, 1, 1, 0, 0, 0, 10], "semantic": {"name": "agPalindr", "arg_names": ["s"], "import_names": [], "rhs_call_n... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97479:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97479:Assign_L2_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97479:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97479:Assign_L3_C1"}, {"f": "ajibawa-2023/Python-Code-L... |
def pr(h):
print "-",' '.join(map(str,h[0]))
print "-",' '.join(map(str,h[1]))
print "-",' '.join(map(str,h[2]))
print
def solve(h,s,d,n):
if n==1:
h[d].append(h[s].pop())
#print "move el ",h[d][len(h[d])-1]," de ",s+1," a ",d+1
pr(h)
else:
solve(h,s,3-s-d,n-1)
h[d].append(h[s].pop())
#print "move el... | ajibawa-2023/Python-Code-Large/train/row_97480 | 14 | 19 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97480:FunctionDef_L1_C0", "label": "pr", "type": "function", "loc": [1, 14], "level": 0, "parent": null, "vector": [2, 0, 0.3947, 0.7368, 0, 0.66, 0.0, 37, 0, 1, 0, 0, 0, 0, 17], "semantic": {"name": "pr", "arg_names": ["h"], "import_names": [], "rhs_call_name": "", "an... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97480:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97480:Expr_L2_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97480:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97480:Expr_L3_C1"}, {"f": "ajibawa-2023/Python-Code-Large... |
def mochila(C,k):
M=[True]+[False]*k
for i in range(len(C)):
for j in reversed(range(k+1)):
M[j]=M[j] or M[j-C[i]]
print ''.join([x and '#' or '_' for x in M])
if M[k]: return True
return M[k]
print mochila([1,2,3,4,5,6],7)
| ajibawa-2023/Python-Code-Large/train/row_97481 | 10 | 10 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97481:FunctionDef_L1_C0", "label": "mochila", "type": "function", "loc": [1, 8], "level": 0, "parent": null, "vector": [2, 0, 0.45, 0.8, 0, 0.66, 0.0, 797, 0, 2, 1, 0, 0, 0, 6], "semantic": {"name": "mochila", "arg_names": ["C", "k"], "import_names": [], "rhs_call_name"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97481:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97481:Assign_L2_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97481:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97481:For_L3_C1"}, {"f": "ajibawa-2023/Python-Code-Larg... |
def pasos(u,v):
n,m=len(u),len(v)
M1=range(m+1)
M2=[1]*(m+1)
for i in range(1,n+1):
M2[0]=i
for j in range(1,m+1):
M2[j]=min(M2[j-1]+1, M1[j]+1, M1[j-1]+(u[i-1]!=v[j-1] and 1 or 0))
M1=M2[:]
print ''.join([str(x) for x in M1])
return M1[m]
print pasos('abc','abx')
| ajibawa-2023/Python-Code-Large/train/row_97482 | 12 | 13 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97482:FunctionDef_L1_C0", "label": "pasos", "type": "function", "loc": [1, 11], "level": 0, "parent": null, "vector": [2, 0, 0.4615, 0.8462, 0, 0.66, 0.0, 617, 0, 2, 1, 0, 0, 0, 9], "semantic": {"name": "pasos", "arg_names": ["u", "v"], "import_names": [], "rhs_call_nam... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97482:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97482:Assign_L2_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97482:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97482:Assign_L3_C1"}, {"f": "ajibawa-2023/Python-Code-L... |
from random import random,randint
from math import sqrt
def dist(a,b):
return sqrt((a[0]-b[0])**2 + (a[1]-b[1])**2)
def sumx(C):
return reduce(lambda x,y:x+y,C,0)
def mind(C):
if len(C)==2: return dist(C[0],C[1])
elif len(C)<2: return float("Inf")
C.sort(key=lambda x:x[0])
r=C[len(C)/2][0]
d1=mind(C[:len(C)/2... | ajibawa-2023/Python-Code-Large/train/row_97483 | 23 | 24 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97483:ImportFrom_L1_C0", "label": "from random import random, randint", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0417, 0.0417, 0, 0.66, 0.0, 715, 0, 2, 0, 0, 715, 0, 0], "semantic": {"name": "random", "arg_names": [], "import_names... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97483:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97483:Return_L5_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97483:FunctionDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97483:Return_L8_C1"}, {"f": "ajibawa-2023/Python-Code-L... |
#!/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... | ajibawa-2023/Python-Code-Large/train/row_97484 | 16 | 22 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97484:ImportFrom_L2_C0", "label": "from matplotlib.pyplot import *", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0909, 0.0455, 0, 0.66, 0.0, 596, 0, 1, 0, 0, 596, 0, 0], "semantic": {"name": "matplotlib.pyplot", "arg_names": [], "impo... | [] |
#!/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(... | ajibawa-2023/Python-Code-Large/train/row_97485 | 19 | 23 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97485:ImportFrom_L2_C0", "label": "from matplotlib.pyplot import *", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.087, 0.0435, 0, 0.66, 0.0, 596, 0, 1, 0, 0, 596, 0, 0], "semantic": {"name": "matplotlib.pyplot", "arg_names": [], "impor... | [] |
#! /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])]))
| ajibawa-2023/Python-Code-Large/train/row_97486 | 2 | 4 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97486:Assign_L3_C0", "label": "files =", "type": "assigned_variable", "loc": [3, 3], "level": 0, "parent": null, "vector": [14, 0, 0.75, 0.25, 0, 0.66, 0.0, 598, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "files", "arg_names": [], "import_names": [], "rhs_call_name": ""... | [] |
#!/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(... | ajibawa-2023/Python-Code-Large/train/row_97487 | 19 | 23 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97487:ImportFrom_L2_C0", "label": "from matplotlib.pyplot import *", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.087, 0.0435, 0, 0.66, 0.0, 596, 0, 1, 0, 0, 596, 0, 0], "semantic": {"name": "matplotlib.pyplot", "arg_names": [], "impor... | [] |
#! /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])]))
| ajibawa-2023/Python-Code-Large/train/row_97488 | 2 | 4 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97488:Assign_L3_C0", "label": "files =", "type": "assigned_variable", "loc": [3, 3], "level": 0, "parent": null, "vector": [14, 0, 0.75, 0.25, 0, 0.66, 0.0, 598, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "files", "arg_names": [], "import_names": [], "rhs_call_name": ""... | [] |
#! /usr/bin/python
files=["constructiva.out","busq_local.out","tabu.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])]))
| ajibawa-2023/Python-Code-Large/train/row_97489 | 2 | 4 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97489:Assign_L3_C0", "label": "files =", "type": "assigned_variable", "loc": [3, 3], "level": 0, "parent": null, "vector": [14, 0, 0.75, 0.25, 0, 0.66, 0.0, 598, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "files", "arg_names": [], "import_names": [], "rhs_call_name": ""... | [] |
#!/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... | ajibawa-2023/Python-Code-Large/train/row_97490 | 17 | 23 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97490:ImportFrom_L2_C0", "label": "from matplotlib.pyplot import *", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.087, 0.0435, 0, 0.66, 0.0, 596, 0, 1, 0, 0, 596, 0, 0], "semantic": {"name": "matplotlib.pyplot", "arg_names": [], "impor... | [] |
#! /usr/bin/python
files=["constructiva.out","busq_local.out","tabu.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])]))
| ajibawa-2023/Python-Code-Large/train/row_97491 | 2 | 4 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97491:Assign_L3_C0", "label": "files =", "type": "assigned_variable", "loc": [3, 3], "level": 0, "parent": null, "vector": [14, 0, 0.75, 0.25, 0, 0.66, 0.0, 598, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "files", "arg_names": [], "import_names": [], "rhs_call_name": ""... | [] |
#!/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... | ajibawa-2023/Python-Code-Large/train/row_97492 | 17 | 23 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97492:ImportFrom_L2_C0", "label": "from matplotlib.pyplot import *", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.087, 0.0435, 0, 0.66, 0.0, 596, 0, 1, 0, 0, 596, 0, 0], "semantic": {"name": "matplotlib.pyplot", "arg_names": [], "impor... | [] |
#! /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... | ajibawa-2023/Python-Code-Large/train/row_97493 | 23 | 30 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97493:ImportFrom_L2_C0", "label": "from random import randint", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0667, 0.0333, 0, 0.66, 0.0, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "random", "arg_names": [], "import_names": ["ran... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97493:For_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97493:Assign_L15_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97493:For_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97493:Expr_L16_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row... |
#! /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... | ajibawa-2023/Python-Code-Large/train/row_97494 | 23 | 30 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97494:ImportFrom_L2_C0", "label": "from random import randint", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0667, 0.0333, 0, 0.66, 0.0, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "random", "arg_names": [], "import_names": ["ran... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97494:For_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97494:Assign_L15_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97494:For_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97494:Expr_L16_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row... |
#! /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])]))
| ajibawa-2023/Python-Code-Large/train/row_97495 | 2 | 4 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97495:Assign_L3_C0", "label": "files =", "type": "assigned_variable", "loc": [3, 3], "level": 0, "parent": null, "vector": [14, 0, 0.75, 0.25, 0, 0.66, 0.0, 598, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "files", "arg_names": [], "import_names": [], "rhs_call_name": ""... | [] |
#! /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... | ajibawa-2023/Python-Code-Large/train/row_97496 | 20 | 27 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97496:ImportFrom_L2_C0", "label": "from random import randint", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0741, 0.037, 0, 0.66, 0.0, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "random", "arg_names": [], "import_names": ["rand... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97496:For_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97496:Assign_L14_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97496:For_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97496:Assign_L15_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/r... |
#!/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... | ajibawa-2023/Python-Code-Large/train/row_97497 | 16 | 22 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97497:ImportFrom_L2_C0", "label": "from matplotlib.pyplot import *", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0909, 0.0455, 0, 0.66, 0.0, 596, 0, 1, 0, 0, 596, 0, 0], "semantic": {"name": "matplotlib.pyplot", "arg_names": [], "impo... | [] |
#! /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])]))
| ajibawa-2023/Python-Code-Large/train/row_97498 | 2 | 4 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97498:Assign_L3_C0", "label": "files =", "type": "assigned_variable", "loc": [3, 3], "level": 0, "parent": null, "vector": [14, 0, 0.75, 0.25, 0, 0.66, 0.0, 598, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "files", "arg_names": [], "import_names": [], "rhs_call_name": ""... | [] |
#!/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... | ajibawa-2023/Python-Code-Large/train/row_97500 | 17 | 23 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97500:ImportFrom_L2_C0", "label": "from matplotlib.pyplot import *", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.087, 0.0435, 0, 0.66, 0.0, 596, 0, 1, 0, 0, 596, 0, 0], "semantic": {"name": "matplotlib.pyplot", "arg_names": [], "impor... | [] |
#!/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(... | ajibawa-2023/Python-Code-Large/train/row_97501 | 19 | 23 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97501:ImportFrom_L2_C0", "label": "from matplotlib.pyplot import *", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.087, 0.0435, 0, 0.66, 0.0, 596, 0, 1, 0, 0, 596, 0, 0], "semantic": {"name": "matplotlib.pyplot", "arg_names": [], "impor... | [] |
#! /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])]))
| ajibawa-2023/Python-Code-Large/train/row_97502 | 2 | 4 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97502:Assign_L3_C0", "label": "files =", "type": "assigned_variable", "loc": [3, 3], "level": 0, "parent": null, "vector": [14, 0, 0.75, 0.25, 0, 0.66, 0.0, 598, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "files", "arg_names": [], "import_names": [], "rhs_call_name": ""... | [] |
#!/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(... | ajibawa-2023/Python-Code-Large/train/row_97503 | 19 | 23 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97503:ImportFrom_L2_C0", "label": "from matplotlib.pyplot import *", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.087, 0.0435, 0, 0.66, 0.0, 596, 0, 1, 0, 0, 596, 0, 0], "semantic": {"name": "matplotlib.pyplot", "arg_names": [], "impor... | [] |
#! /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])]))
| ajibawa-2023/Python-Code-Large/train/row_97504 | 2 | 4 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97504:Assign_L3_C0", "label": "files =", "type": "assigned_variable", "loc": [3, 3], "level": 0, "parent": null, "vector": [14, 0, 0.75, 0.25, 0, 0.66, 0.0, 598, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "files", "arg_names": [], "import_names": [], "rhs_call_name": ""... | [] |
#!/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 ... | ajibawa-2023/Python-Code-Large/train/row_97506 | 11 | 18 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97506:ImportFrom_L2_C0", "label": "from matplotlib.pyplot import *", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.1111, 0.0556, 0, 0.66, 0.0, 596, 0, 1, 0, 0, 596, 0, 0], "semantic": {"name": "matplotlib.pyplot", "arg_names": [], "impo... | [] |
#!/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 ... | ajibawa-2023/Python-Code-Large/train/row_97507 | 11 | 18 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97507:ImportFrom_L2_C0", "label": "from matplotlib.pyplot import *", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.1111, 0.0556, 0, 0.66, 0.0, 596, 0, 1, 0, 0, 596, 0, 0], "semantic": {"name": "matplotlib.pyplot", "arg_names": [], "impo... | [] |
#! /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... | ajibawa-2023/Python-Code-Large/train/row_97508 | 20 | 27 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97508:ImportFrom_L2_C0", "label": "from random import randint", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0741, 0.037, 0, 0.66, 0.0, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "random", "arg_names": [], "import_names": ["rand... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97508:For_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97508:Assign_L14_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97508:For_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97508:Assign_L15_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/r... |
#!/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 ... | ajibawa-2023/Python-Code-Large/train/row_97509 | 16 | 23 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97509:ImportFrom_L2_C0", "label": "from matplotlib.pyplot import *", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.087, 0.0435, 0, 0.66, 0.0, 596, 0, 1, 0, 0, 596, 0, 0], "semantic": {"name": "matplotlib.pyplot", "arg_names": [], "impor... | [] |
#! /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... | ajibawa-2023/Python-Code-Large/train/row_97510 | 2 | 7 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97510:Assign_L6_C0", "label": "files =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.8571, 0.1429, 0, 0.66, 0.0, 598, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "files", "arg_names": [], "import_names": [], "rhs_call_name"... | [] |
#!/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 ... | ajibawa-2023/Python-Code-Large/train/row_97511 | 16 | 23 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97511:ImportFrom_L2_C0", "label": "from matplotlib.pyplot import *", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.087, 0.0435, 0, 0.66, 0.0, 596, 0, 1, 0, 0, 596, 0, 0], "semantic": {"name": "matplotlib.pyplot", "arg_names": [], "impor... | [] |
#! /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... | ajibawa-2023/Python-Code-Large/train/row_97512 | 2 | 7 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97512:Assign_L6_C0", "label": "files =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.8571, 0.1429, 0, 0.66, 0.0, 598, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "files", "arg_names": [], "import_names": [], "rhs_call_name"... | [] |
#! /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])]))
| ajibawa-2023/Python-Code-Large/train/row_97513 | 2 | 4 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97513:Assign_L3_C0", "label": "files =", "type": "assigned_variable", "loc": [3, 3], "level": 0, "parent": null, "vector": [14, 0, 0.75, 0.25, 0, 0.66, 0.0, 598, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "files", "arg_names": [], "import_names": [], "rhs_call_name": ""... | [] |
#! /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])]))
| ajibawa-2023/Python-Code-Large/train/row_97514 | 2 | 4 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97514:Assign_L3_C0", "label": "files =", "type": "assigned_variable", "loc": [3, 3], "level": 0, "parent": null, "vector": [14, 0, 0.75, 0.25, 0, 0.66, 0.0, 598, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "files", "arg_names": [], "import_names": [], "rhs_call_name": ""... | [] |
#!/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... | ajibawa-2023/Python-Code-Large/train/row_97515 | 17 | 23 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97515:ImportFrom_L2_C0", "label": "from matplotlib.pyplot import *", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.087, 0.0435, 0, 0.66, 0.0, 596, 0, 1, 0, 0, 596, 0, 0], "semantic": {"name": "matplotlib.pyplot", "arg_names": [], "impor... | [] |
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... | ajibawa-2023/Python-Code-Large/train/row_97516 | 26 | 30 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97516:ImportFrom_L1_C0", "label": "from random import randint", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0333, 0.0333, 0, 0.66, 0.0, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "random", "arg_names": [], "import_names": ["ran... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97516:FunctionDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97516:Return_L4_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97516:For_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97516:For_L9_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/... |
#!/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... | ajibawa-2023/Python-Code-Large/train/row_97517 | 45 | 56 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97517:Import_L1_C0", "label": "getopt import getopt, sys", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0179, 0.0179, 0, 0.66, 0.0, 588, 0, 2, 0, 0, 588, 0, 0], "semantic": {"name": "getopt", "arg_names": [], "import_names": ["getopt",... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97517:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97517:Assign_L8_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97517:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97517:For_L9_C1"}, {"f": "ajibawa-2023/Python-Code-Larg... |
#!/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... | ajibawa-2023/Python-Code-Large/train/row_97518 | 32 | 41 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97518:Import_L1_C0", "label": "getopt import getopt, sys", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0244, 0.0244, 0, 0.66, 0.0, 588, 0, 2, 0, 0, 588, 0, 0], "semantic": {"name": "getopt", "arg_names": [], "import_names": ["getopt",... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97518:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97518:Assign_L8_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97518:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97518:For_L9_C1"}, {"f": "ajibawa-2023/Python-Code-Larg... |
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... | ajibawa-2023/Python-Code-Large/train/row_97519 | 44 | 72 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97519:ImportFrom_L1_C0", "label": "from math import cos, pi, sqrt", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0139, 0.0139, 0, 0.66, 0.0, 526, 0, 3, 0, 0, 526, 0, 0], "semantic": {"name": "math", "arg_names": [], "import_names": ["c... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97519:FunctionDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97519:Expr_L5_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97519:FunctionDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97519:Return_L8_C1"}, {"f": "ajibawa-2023/Python-Code-Lar... |
#!/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... | ajibawa-2023/Python-Code-Large/train/row_97520 | 32 | 41 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97520:Import_L1_C0", "label": "getopt import getopt, sys", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0244, 0.0244, 0, 0.66, 0.0, 588, 0, 2, 0, 0, 588, 0, 0], "semantic": {"name": "getopt", "arg_names": [], "import_names": ["getopt",... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97520:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97520:Assign_L8_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97520:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97520:For_L9_C1"}, {"f": "ajibawa-2023/Python-Code-Larg... |
#!/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... | ajibawa-2023/Python-Code-Large/train/row_97521 | 17 | 21 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97521:Import_L1_C0", "label": "getopt import getopt, sys", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0476, 0.0476, 0, 0.66, 0.0, 588, 0, 2, 0, 0, 588, 0, 0], "semantic": {"name": "getopt", "arg_names": [], "import_names": ["getopt",... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97521:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97521:Assign_L8_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97521:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97521:For_L9_C1"}, {"f": "ajibawa-2023/Python-Code-Larg... |
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
| ajibawa-2023/Python-Code-Large/train/row_97522 | 11 | 12 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97522:Assign_L1_C0", "label": "f = open()", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.0833, 0.0833, 0, 0.66, 0.0, 899, 3, 1, 0, 0, 693, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_nam... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97522:While_L2_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97522:Assign_L3_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97522:While_L2_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97522:If_L4_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_9... |
#!/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... | ajibawa-2023/Python-Code-Large/train/row_97523 | 17 | 21 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97523:Import_L1_C0", "label": "getopt import getopt, sys", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0476, 0.0476, 0, 0.66, 0.0, 588, 0, 2, 0, 0, 588, 0, 0], "semantic": {"name": "getopt", "arg_names": [], "import_names": ["getopt",... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97523:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97523:Assign_L8_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97523:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97523:For_L9_C1"}, {"f": "ajibawa-2023/Python-Code-Larg... |
# This file is an introductory example to
# the python language of programmation.
import numpy as np;
def power(x,n):
""" The function "power" takes two arguments :
x is a real number
n is an integer
and returns the value y = x^n"""
if (n == 0):
y = 1;
elif (n == 1):
y =... | ajibawa-2023/Python-Code-Large/train/row_97526 | 56 | 81 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97526:Import_L3_C0", "label": "numpy import np", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.037, 0.0123, 0, 0.66, 0.0, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97526:FunctionDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97526:Expr_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97526:FunctionDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97526:If_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/... |
#Ceci est un commentaire en python.
#Début du fichier.
| ajibawa-2023/Python-Code-Large/train/row_97527 | 0 | 3 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [] | [] |
# This is Python example on how to use Mongoose embeddable web server,
# http://code.google.com/p/mongoose
#
# Before using the mongoose module, make sure that Mongoose shared library is
# built and present in the current (or system library) directory
import mongoose
import sys
# Handle /show and /form URIs.
def Even... | ajibawa-2023/Python-Code-Large/train/row_97528 | 33 | 62 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97528:Import_L7_C0", "label": "mongoose import mongoose", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.1129, 0.0161, 0, 0.66, 0.0, 755, 0, 1, 0, 0, 755, 0, 0], "semantic": {"name": "mongoose", "arg_names": [], "import_names": ["mongoos... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97528:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97528:If_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97528:If_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97528:Expr_L13_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/... |
# Copyright (c) 2004-2009 Sergey Lyubka
#
# 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 use, copy, modify, merge, publ... | ajibawa-2023/Python-Code-Large/train/row_97529 | 69 | 159 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97529:Expr_L23_C0", "label": "expression", "type": "expression", "loc": [23, 36], "level": 0, "parent": null, "vector": [8, 0, 0.1855, 0.0881, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "anno... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97529:ClassDef_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97529:Expr_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97529:ClassDef_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97529:Assign_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large... |
#!/usr/bin/python
# Copyright 2011 Google, Inc. All Rights Reserved.
# simple script to walk source tree looking for third-party licenses
# dumps resulting html page to stdout
import os, re, mimetypes, sys
# read source directories to scan from command line
SOURCE = sys.argv[1:]
# regex to find /* */ style commen... | ajibawa-2023/Python-Code-Large/train/row_97530 | 51 | 98 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97530:Import_L8_C0", "label": "os import os, re, mimetypes\u2026", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0816, 0.0102, 0, 0.66, 0.0, 688, 0, 4, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os",... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97530:ClassDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97530:FunctionDef_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97530:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97530:Assign_L33_C8"}, {"f": "ajibawa-2023/Python-... |
# -*- coding: utf-8 -*-
#
# jQuery File Upload Plugin GAE Python Example 2.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.appeng... | ajibawa-2023/Python-Code-Large/train/row_97531 | 85 | 150 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97531:ImportFrom_L13_C0", "label": "from __future__ import with_statement", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.0867, 0.0067, 0, 0.66, 0.0, 777, 0, 1, 0, 0, 777, 0, 0], "semantic": {"name": "__future__", "arg_names": [], "im... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97531:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97531:Expr_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97531:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97531:FunctionDef_L32_C4"}, {"f": "ajibawa-2023/Python-Co... |
'''
Module which prompts the user for translations and saves them.
TODO: implement
@author: Rodrigo Damazio
'''
class Translator(object):
'''
classdocs
'''
def __init__(self, language):
'''
Constructor
'''
self._language = language
def Translate(self, string_names):
print string_names | ajibawa-2023/Python-Code-Large/train/row_97532 | 8 | 21 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97532:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 7], "level": 0, "parent": null, "vector": [8, 0, 0.1905, 0.3333, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97532:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97532:Expr_L10_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97532:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97532:FunctionDef_L14_C2"}, {"f": "ajibawa-2023/Python-Code-La... |
'''
Module which brings history information about files from Mercurial.
@author: Rodrigo Damazio
'''
import re
import subprocess
REVISION_REGEX = re.compile(r'(?P<hash>[0-9a-f]{12}):.*')
def _GetOutputLines(args):
'''
Runs an external process and returns its output as a list of lines.
@param args: the argume... | ajibawa-2023/Python-Code-Large/train/row_97533 | 38 | 94 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97533:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0319, 0.0532, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97533:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97533:Expr_L13_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97533:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97533:Assign_L18_C2"}, {"f": "ajibawa-2023/Python-Code... |
'''
Module which parses a string XML file.
@author: Rodrigo Damazio
'''
from xml.parsers.expat import ParserCreate
import re
#import xml.etree.ElementTree as ET
class StringsParser(object):
'''
Parser for string XML files.
This object is not thread-safe and should be used for parsing a single file at
a time... | ajibawa-2023/Python-Code-Large/train/row_97534 | 54 | 115 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97534:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0261, 0.0435, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97534:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97534:Expr_L12_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97534:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97534:FunctionDef_L19_C2"}, {"f": "ajibawa-2023/Python-Code-... |
#!/usr/bin/python
'''
Entry point for My Tracks i18n tool.
@author: Rodrigo Damazio
'''
import mytracks.files
import mytracks.translate
import mytracks.validate
import sys
def Usage():
print 'Usage: %s <command> [<language> ...]\n' % sys.argv[0]
print 'Commands are:'
print ' cleanup'
print ' translate'
p... | ajibawa-2023/Python-Code-Large/train/row_97535 | 58 | 96 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97535:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 6], "level": 0, "parent": null, "vector": [8, 0, 0.0417, 0.0521, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97535:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97535:Expr_L14_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97535:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97535:Expr_L15_C2"}, {"f": "ajibawa-2023/Python-Code-L... |
'''
Module which compares languague files to the master file and detects
issues.
@author: Rodrigo Damazio
'''
import os
from mytracks.parser import StringsParser
import mytracks.history
class Validator(object):
def __init__(self, languages):
'''
Builds a strings file validator.
Params:
@para... | ajibawa-2023/Python-Code-Large/train/row_97536 | 65 | 115 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97536:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 6], "level": 0, "parent": null, "vector": [8, 0, 0.0304, 0.0522, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97536:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97536:FunctionDef_L14_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97536:FunctionDef_L14_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_97536:Expr_L15_C4"}, {"f": "ajibawa-2023/Python-Co... |
'''
Module for dealing with resource files (but not their contents).
@author: Rodrigo Damazio
'''
import os.path
from glob import glob
import re
MYTRACKS_RES_DIR = 'MyTracks/res'
ANDROID_MASTER_VALUES = 'values'
ANDROID_VALUES_MASK = 'values-*'
def GetMyTracksDir():
'''
Returns the directory in which the MyTrac... | ajibawa-2023/Python-Code-Large/train/row_97537 | 25 | 45 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97537:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0667, 0.1111, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97537:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97537:Expr_L16_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97537:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97537:Assign_L19_C2"}, {"f": "ajibawa-2023/Python-Code... |
import urllib, urllib.request, io, os, sys, re
url = "http://music.baidu.com/search/lrc"
search = [('key','蒙娜丽莎的眼泪')]
url_String = url + "?" + urllib.parse.urlencode(search)
print(url_String)
req = urllib.request.Request(url_String)
fd = urllib.request.urlopen(req)
print(fd)
xx = fd.read()
yy = xx.decode().spl... | ajibawa-2023/Python-Code-Large/train/row_97538 | 24 | 24 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97538:Import_L1_C0", "label": "urllib import urllib, urllib.request, io\u2026", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0417, 0.0417, 0, 0.66, 0.0, 614, 0, 6, 0, 0, 614, 0, 0], "semantic": {"name": "urllib", "arg_names": [], "impo... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97538:While_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97538:Assign_L13_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97538:While_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97538:If_L14_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/r... |
import random
print 200
letras = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
for i in range(501,701):
x=random.randint(0,len(letras)-1)
s=""
for j in range(i):
s+=str(letras[(x+j) % len(letras)])
print "*",s
... | ajibawa-2023/Python-Code-Large/train/row_97539 | 8 | 13 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97539:Import_L1_C0", "label": "random import random", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0769, 0.0769, 0, 0.66, 0.0, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "random", "arg_names": [], "import_names": ["random"], "rh... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97539:For_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97539:Assign_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97539:For_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97539:Assign_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_9... |
import random
print 500
letras = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
for i in range(999501,1000001):
x=random.randint(0,len(letras)-1)
s=""
for j in range(i):
s+=str(letras[(x+j) % len(letras)])
print s
... | ajibawa-2023/Python-Code-Large/train/row_97540 | 8 | 13 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97540:Import_L1_C0", "label": "random import random", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0769, 0.0769, 0, 0.66, 0.0, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "random", "arg_names": [], "import_names": ["random"], "rh... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97540:For_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97540:Assign_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97540:For_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97540:Assign_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_9... |
#!/usr/bin/python
# -*- coding: iso-8859-1 -*-
class GrafoCircular:
def __init__(self,n,acuerdos):
self.n = n
self.lista_acuerdos = acuerdos
# creo la matriz de acuerdos
self.acuerdos = []
for i in range(n):
self.acuerdos.append([0]*n)
... | ajibawa-2023/Python-Code-Large/train/row_97542 | 15 | 28 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97542:ClassDef_L4_C0", "label": "GrafoCircular", "type": "class", "loc": [4, 28], "level": 0, "parent": null, "vector": [3, 0, 0.5714, 0.8929, 0, 0.66, 0.0, 202, 0, 3, 0, 0, 0, 0, 5], "semantic": {"name": "GrafoCircular", "arg_names": [], "import_names": [], "rhs_call_n... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97542:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97542:FunctionDef_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97542:FunctionDef_L5_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97542:Assign_L6_C8"}, {"f": "ajibawa-2023/Python-Code... |
#!/usr/bin/python
# -*- coding: iso-8859-1 -*-
class GrafoCircular:
def __init__(self,n,acuerdos):
self.n = n
self.lista_acuerdos = acuerdos
# creo la matriz de acuerdos
self.acuerdos = []
for i in range(n):
self.acuerdos.append([0]*n)
... | ajibawa-2023/Python-Code-Large/train/row_97544 | 15 | 28 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97544:ClassDef_L4_C0", "label": "GrafoCircular", "type": "class", "loc": [4, 28], "level": 0, "parent": null, "vector": [3, 0, 0.5714, 0.8929, 0, 0.66, 0.0, 202, 0, 3, 0, 0, 0, 0, 5], "semantic": {"name": "GrafoCircular", "arg_names": [], "import_names": [], "rhs_call_n... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97544:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97544:FunctionDef_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97544:FunctionDef_L5_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97544:Assign_L6_C8"}, {"f": "ajibawa-2023/Python-Code... |
#!/usr/bin/python
# -*- coding: iso-8859-1 -*-
class Grafo:
def __init__(self,n,acuerdos):
self.n = n
self.lista_acuerdos = acuerdos
# creo la matriz de acuerdos
self.acuerdos = []
for i in range(n):
self.acuerdos.append([0]*n)
for ... | ajibawa-2023/Python-Code-Large/train/row_97545 | 15 | 28 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97545:ClassDef_L4_C0", "label": "Grafo", "type": "class", "loc": [4, 28], "level": 0, "parent": null, "vector": [3, 0, 0.5714, 0.8929, 0, 0.66, 0.0, 330, 0, 3, 0, 0, 0, 0, 5], "semantic": {"name": "Grafo", "arg_names": [], "import_names": [], "rhs_call_name": "", "annot... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97545:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97545:FunctionDef_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97545:FunctionDef_L5_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97545:Assign_L6_C8"}, {"f": "ajibawa-2023/Python-Code... |
#!/usr/bin/python
# -*- coding: iso-8859-1 -*-
from grafo import Grafo
from sets import Set
import os
import random
def ordenar(t):
if t[0] < t[1]:
return t
else:
return (t[1],t[0])
def generarInstancia(ciudades=10, acuerdos=None):
if acuerdos is None:
acuerdos = random.randint(1... | ajibawa-2023/Python-Code-Large/train/row_97546 | 47 | 77 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97546:ImportFrom_L4_C0", "label": "from grafo import Grafo", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0519, 0.013, 0, 0.66, 0.0, 503, 0, 1, 0, 0, 503, 0, 0], "semantic": {"name": "grafo", "arg_names": [], "import_names": ["Grafo"],... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97546:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97546:If_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97546:If_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97546:Return_L12_C8"}, {"f": "ajibawa-2023/Python-Code-Large/trai... |
#!/usr/bin/python
# -*- coding: iso-8859-1 -*-
from grafo import Grafo
from sets import Set
import os
import random
def ordenar(t):
if t[0] < t[1]:
return t
else:
return (t[1],t[0])
def generarInstancia(ciudades=10, acuerdos=None):
if acuerdos is None:
acuerdos = random.randint(1... | ajibawa-2023/Python-Code-Large/train/row_97547 | 47 | 77 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97547:ImportFrom_L4_C0", "label": "from grafo import Grafo", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0519, 0.013, 0, 0.66, 0.0, 503, 0, 1, 0, 0, 503, 0, 0], "semantic": {"name": "grafo", "arg_names": [], "import_names": ["Grafo"],... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97547:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97547:If_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97547:If_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97547:Return_L12_C8"}, {"f": "ajibawa-2023/Python-Code-Large/trai... |
#!/usr/bin/python
# -*- coding: iso-8859-1 -*-
class Grafo:
def __init__(self,n,acuerdos):
self.n = n
self.lista_acuerdos = acuerdos
# creo la matriz de acuerdos
self.acuerdos = []
for i in range(n):
self.acuerdos.append([0]*n)
for ... | ajibawa-2023/Python-Code-Large/train/row_97548 | 15 | 28 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97548:ClassDef_L4_C0", "label": "Grafo", "type": "class", "loc": [4, 28], "level": 0, "parent": null, "vector": [3, 0, 0.5714, 0.8929, 0, 0.66, 0.0, 330, 0, 3, 0, 0, 0, 0, 5], "semantic": {"name": "Grafo", "arg_names": [], "import_names": [], "rhs_call_name": "", "annot... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97548:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97548:FunctionDef_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97548:FunctionDef_L5_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97548:Assign_L6_C8"}, {"f": "ajibawa-2023/Python-Code... |
#############################################################################
valor=[]
num = 0
visitado = []
fuerte = []
#############################################################################
# grafo sobre listas de adyacencia
# FIXME: a las 5 a.m me parecio re coherente que si llegan se llamen out
# y s... | ajibawa-2023/Python-Code-Large/train/row_97549 | 94 | 150 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97549:Assign_L2_C0", "label": "valor =", "type": "assigned_variable", "loc": [2, 2], "level": 0, "parent": null, "vector": [14, 0, 0.0133, 0.0067, 0, 0.66, 0.0, 580, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "valor", "arg_names": [], "import_names": [], "rhs_call_name"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97549:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97549:FunctionDef_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97549:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97549:Assign_L12_C8"}, {"f": "ajibawa-2023/Python-... |
import random
import psyco
psyco.full()
class Grafo:
def __init__(self,nodos, relacion):
self.nodos = nodos
self.verticesIn = [[] for x in range(nodos)]
self.verticesOut = [[] for x in range(nodos)]
for each in relacion:
self.verticesIn[each[0]].append(each[1])
... | ajibawa-2023/Python-Code-Large/train/row_97550 | 60 | 80 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97550:Import_L1_C0", "label": "random import random", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0125, 0.0125, 0, 0.66, 0.0, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "random", "arg_names": [], "import_names": ["random"], "rh... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97550:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97550:FunctionDef_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97550:FunctionDef_L6_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97550:Assign_L7_C8"}, {"f": "ajibawa-2023/Python-Code... |
#!/usr/bin/python
# -*- coding: iso-8859-1 -*-
class GrafoCircular:
def __init__(self,n,acuerdos):
self.n = n
self.lista_acuerdos = acuerdos
# creo la matriz de acuerdos
self.acuerdos = []
for i in range(n):
self.acuerdos.append([0]*n)
... | ajibawa-2023/Python-Code-Large/train/row_97553 | 15 | 28 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97553:ClassDef_L4_C0", "label": "GrafoCircular", "type": "class", "loc": [4, 28], "level": 0, "parent": null, "vector": [3, 0, 0.5714, 0.8929, 0, 0.66, 0.0, 202, 0, 3, 0, 0, 0, 0, 5], "semantic": {"name": "GrafoCircular", "arg_names": [], "import_names": [], "rhs_call_n... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97553:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97553:FunctionDef_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97553:FunctionDef_L5_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97553:Assign_L6_C8"}, {"f": "ajibawa-2023/Python-Code... |
#!/usr/bin/python
# -*- coding: iso-8859-1 -*-
class GrafoCircular:
def __init__(self,n,acuerdos):
self.n = n
self.lista_acuerdos = acuerdos
# creo la matriz de acuerdos
self.acuerdos = []
for i in range(n):
self.acuerdos.append([0]*n)
... | ajibawa-2023/Python-Code-Large/train/row_97555 | 15 | 28 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97555:ClassDef_L4_C0", "label": "GrafoCircular", "type": "class", "loc": [4, 28], "level": 0, "parent": null, "vector": [3, 0, 0.5714, 0.8929, 0, 0.66, 0.0, 202, 0, 3, 0, 0, 0, 0, 5], "semantic": {"name": "GrafoCircular", "arg_names": [], "import_names": [], "rhs_call_n... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97555:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97555:FunctionDef_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97555:FunctionDef_L5_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97555:Assign_L6_C8"}, {"f": "ajibawa-2023/Python-Code... |
#!/usr/bin/python
# -*- coding: iso-8859-1 -*-
from grafocircular import GrafoCircular
from sets import Set
import random
#################################################################
# Generador de instancias de barcos y ciudades #
################################################################... | ajibawa-2023/Python-Code-Large/train/row_97558 | 20 | 33 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97558:ImportFrom_L4_C0", "label": "from grafocircular import GrafoCircular", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.1212, 0.0303, 0, 0.66, 0.0, 295, 0, 1, 0, 0, 295, 0, 0], "semantic": {"name": "grafocircular", "arg_names": [], "... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97558:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97558:If_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97558:If_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97558:Return_L14_C8"}, {"f": "ajibawa-2023/Python-Code-Large/trai... |
#!/usr/bin/python
# -*- coding: iso-8859-1 -*-
from grafocircular import GrafoCircular
from sets import Set
import random
#################################################################
# Generador de instancias de barcos y ciudades #
################################################################... | ajibawa-2023/Python-Code-Large/train/row_97560 | 20 | 33 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97560:ImportFrom_L4_C0", "label": "from grafocircular import GrafoCircular", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.1212, 0.0303, 0, 0.66, 0.0, 295, 0, 1, 0, 0, 295, 0, 0], "semantic": {"name": "grafocircular", "arg_names": [], "... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97560:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97560:If_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97560:If_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97560:Return_L14_C8"}, {"f": "ajibawa-2023/Python-Code-Large/trai... |
#!/usr/bin/env python
"""
svg.py - Construct/display SVG scenes.
The following code is a lightweight wrapper around SVG files. The metaphor
is to construct a scene, add objects to it, and then write it to a file
to display it.
This program uses ImageMagick to display the SVG files. ImageMagick also
does a remarkable... | ajibawa-2023/Python-Code-Large/train/row_97561 | 79 | 120 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97561:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 11], "level": 0, "parent": null, "vector": [8, 0, 0.0542, 0.0833, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97561:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97561:FunctionDef_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97561:FunctionDef_L17_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97561:Assign_L18_C8"}, {"f": "ajibawa-2023/Python-... |
from GrafoBipartito import *
from GeneradorGrafos import *
from Dibujador import *
# grafo: todos los nodos y ejes, p1 p2 estaRel(v,u)
#dibujo: l1, l2 los nodos que no se pueden mover
class HeuristicaInsercionEjes (ResolvedorConstructivo):
# establece el rango en el cual se puede insertar un nodo
#... | ajibawa-2023/Python-Code-Large/train/row_97563 | 100 | 153 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97563:ImportFrom_L1_C0", "label": "from GrafoBipartito import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0065, 0.0065, 0, 0.66, 0.0, 16, 0, 1, 0, 0, 16, 0, 0], "semantic": {"name": "GrafoBipartito", "arg_names": [], "import_names... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97563:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97563:FunctionDef_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97563:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97563:If_L10_C8"}, {"f": "ajibawa-2023/Python-Code-La... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
#import psyco
#psyco.full()
from GrafoBipartito import Dibujo, ResolvedorConstructivo
class ResolvedorBasico(ResolvedorConstructivo):
def resolver(self):
g = self.dibujo.g
d = self.dibujo
# busco los nodos que quedan por posicionar
... | ajibawa-2023/Python-Code-Large/train/row_97564 | 48 | 76 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97564:Import_L4_C0", "label": "sys import sys", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0526, 0.0132, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97564:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97564:FunctionDef_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97564:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97564:Assign_L13_C8"}, {"f": "ajibawa-2023/Python-... |
# Heuristica de agregar nodos de a uno y a acomodarlos
from GrafoBipartito import ResolvedorConstructivo, Dibujo
from Dibujador import DibujadorGrafoBipartito
from GeneradorGrafos import generarGrafoBipartitoAleatorio, generarDibujoAleatorio
class HeuristicaInsercionNodosPrimero(ResolvedorConstructivo):
def resolv... | ajibawa-2023/Python-Code-Large/train/row_97565 | 69 | 93 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97565:ImportFrom_L2_C0", "label": "from GrafoBipartito import ResolvedorConstructivo, Dibujo", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0215, 0.0108, 0, 0.66, 0.0, 16, 0, 2, 0, 0, 16, 0, 0], "semantic": {"name": "GrafoBipartito", "... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97565:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97565:FunctionDef_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97565:FunctionDef_L7_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97565:Assign_L8_C8"}, {"f": "ajibawa-2023/Python-Code... |
import random
from HeuristicaInsercionEjes import *
import psyco
from psyco import *
class BusquedaLocalReInsercion(BusquedaLocal):
def _rango(self,x,pi,marcados):
if x not in marcados:
return range(len(pi)+1)
else:
posxMarcado = marcados.index(x)
... | ajibawa-2023/Python-Code-Large/train/row_97566 | 107 | 121 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97566:Import_L1_C0", "label": "random import random", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0083, 0.0083, 0, 0.66, 0.0, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "random", "arg_names": [], "import_names": ["random"], "rh... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97566:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97566:FunctionDef_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97566:FunctionDef_L7_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97566:If_L8_C8"}, {"f": "ajibawa-2023/Python-Code-Lar... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
from HeuristicaInsercionEjes import *
#import psyco
#psyco.full()
from GrafoBipartito import Dibujo, ResolvedorConstructivo
from SolucionFuerzaBruta import cuantasCombinaciones
class ResolvedorSwapperConPoda(ResolvedorConstructivo):
def resolver(self):
... | ajibawa-2023/Python-Code-Large/train/row_97567 | 63 | 112 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97567:Import_L4_C0", "label": "sys import sys", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0357, 0.0089, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97567:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97567:FunctionDef_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97567:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97567:Assign_L14_C8"}, {"f": "ajibawa-2023/Python-... |
import random
from HeuristicaInsercionEjes import *
from HeuristicaInsercionNodosMayorGrado import *
import psyco
psyco.full()
class BusquedaLocalIntercambioGreedy(BusquedaLocal):
def swapValido(self,i,j,l,marcados):
if i in marcados:
if j in marcados:
return Fal... | ajibawa-2023/Python-Code-Large/train/row_97569 | 96 | 122 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97569:Import_L1_C0", "label": "random import random", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0082, 0.0082, 0, 0.66, 0.0, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "random", "arg_names": [], "import_names": ["random"], "rh... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97569:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97569:FunctionDef_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97569:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97569:If_L10_C8"}, {"f": "ajibawa-2023/Python-Code-La... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
#import psyco
#psyco.full()
from GrafoBipartito import Dibujo, ResolvedorConstructivo
class ResolvedorSwapper(ResolvedorConstructivo):
def resolver(self):
g = self.dibujo.g
d = self.dibujo
# busco los nodos que quedan por posicionar
... | ajibawa-2023/Python-Code-Large/train/row_97570 | 58 | 101 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97570:Import_L4_C0", "label": "sys import sys", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0396, 0.0099, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97570:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97570:FunctionDef_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97570:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97570:Assign_L13_C8"}, {"f": "ajibawa-2023/Python-... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from sets import Set
import svg
from GrafoBipartito import GrafoBipartito, Dibujo
class DibujadorGrafoBipartito:
def __init__(self, dibujo, nombre="GrafoBipartito", height=800,marcados1=None,marcados2=None):
self.dibujo = dibujo
# calculo las dimensiones... | ajibawa-2023/Python-Code-Large/train/row_97571 | 85 | 128 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97571:ImportFrom_L4_C0", "label": "from sets import Set", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0312, 0.0078, 0, 0.66, 0.0, 842, 0, 1, 0, 0, 842, 0, 0], "semantic": {"name": "sets", "arg_names": [], "import_names": ["Set"], "rhs... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97571:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97571:FunctionDef_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97571:FunctionDef_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97571:Assign_L11_C8"}, {"f": "ajibawa-2023/Python-C... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
#import psyco
#psyco.full()
from GrafoBipartito import Dibujo, ResolvedorConstructivo
from SolucionFuerzaBruta import cuantasCombinaciones
class ResolvedorBasicoConPoda(ResolvedorConstructivo):
def resolver(self):
g = self.dibujo.g
d = self.di... | ajibawa-2023/Python-Code-Large/train/row_97572 | 55 | 90 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97572:Import_L4_C0", "label": "sys import sys", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0444, 0.0111, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97572:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97572:FunctionDef_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97572:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97572:Assign_L14_C8"}, {"f": "ajibawa-2023/Python-... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
#import psyco
#psyco.full()
from GrafoBipartito import Dibujo, ResolvedorConstructivo
class ResolvedorSwapper(ResolvedorConstructivo):
def resolver(self):
g = self.dibujo.g
d = self.dibujo
# busco los nodos que quedan por posicionar
... | ajibawa-2023/Python-Code-Large/train/row_97575 | 58 | 101 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97575:Import_L4_C0", "label": "sys import sys", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0396, 0.0099, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97575:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97575:FunctionDef_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97575:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97575:Assign_L13_C8"}, {"f": "ajibawa-2023/Python-... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
from HeuristicaInsercionEjes import *
#import psyco
#psyco.full()
from GrafoBipartito import Dibujo, ResolvedorConstructivo
from SolucionFuerzaBruta import cuantasCombinaciones
class ResolvedorSwapperConPoda(ResolvedorConstructivo):
def resolver(self):
... | ajibawa-2023/Python-Code-Large/train/row_97576 | 63 | 112 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97576:Import_L4_C0", "label": "sys import sys", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0357, 0.0089, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97576:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97576:FunctionDef_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97576:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97576:Assign_L14_C8"}, {"f": "ajibawa-2023/Python-... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from GrafoBipartito import Dibujo, ResolvedorConstructivo
import sys
#import psyco
#psyco.full()
class ResolvedorFuerzaBruta(ResolvedorConstructivo):
def resolver(self):
# busco los nodos que quedan por posicionar
q1 = [x for x in self.dibujo.g.p1 if not... | ajibawa-2023/Python-Code-Large/train/row_97577 | 77 | 133 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97577:ImportFrom_L4_C0", "label": "from GrafoBipartito import Dibujo, ResolvedorConstructivo", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0301, 0.0075, 0, 0.66, 0.0, 16, 0, 2, 0, 0, 16, 0, 0], "semantic": {"name": "GrafoBipartito", "... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97577:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97577:FunctionDef_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97577:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97577:Assign_L14_C8"}, {"f": "ajibawa-2023/Python-... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from GrafoBipartito import ResolvedorConstructivo, Dibujo
from GrafoBipartito import crucesEntre, crucesPorAgregarAtras
from GeneradorGrafos import generarGrafoBipartitoAleatorio, generarDibujoAleatorio
import random
class HeuristicaInsercionNodos(ResolvedorConstructivo):
... | ajibawa-2023/Python-Code-Large/train/row_97578 | 125 | 230 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97578:ImportFrom_L4_C0", "label": "from GrafoBipartito import ResolvedorConstructivo, Dibujo", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0174, 0.0043, 0, 0.66, 0.0, 16, 0, 2, 0, 0, 16, 0, 0], "semantic": {"name": "GrafoBipartito", "... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97578:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97578:FunctionDef_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97578:FunctionDef_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97578:Assign_L18_C8"}, {"f": "ajibawa-2023/Python-... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
#import psyco
#psyco.full()
from GrafoBipartito import Dibujo, ResolvedorConstructivo
from GrafoBipartito import crucesEntre, crucesPorAgregarAdelante, crucesPorAgregarAtras
from SolucionFuerzaBruta import cuantasCombinaciones, tamArbol
class ResolvedorSwapperTa... | ajibawa-2023/Python-Code-Large/train/row_97579 | 186 | 368 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97579:Import_L4_C0", "label": "sys import sys", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0109, 0.0027, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97579:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97579:FunctionDef_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97579:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97579:Assign_L21_C8"}, {"f": "ajibawa-2023/Python-... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
#import psyco
#psyco.full()
from GrafoBipartito import Dibujo, ResolvedorConstructivo
from GrafoBipartito import crucesEntre, crucesPorAgregarAdelante, crucesPorAgregarAtras
from SolucionFuerzaBruta import cuantasCombinaciones
class ResolvedorSwapperTabla(Resolv... | ajibawa-2023/Python-Code-Large/train/row_97580 | 147 | 310 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97580:Import_L4_C0", "label": "sys import sys", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0129, 0.0032, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97580:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97580:FunctionDef_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97580:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97580:Assign_L21_C8"}, {"f": "ajibawa-2023/Python-... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
#import psyco
#psyco.full()
from GrafoBipartito import Dibujo, ResolvedorConstructivo
class ResolvedorBasico(ResolvedorConstructivo):
def resolver(self):
g = self.dibujo.g
d = self.dibujo
# busco los nodos que quedan por posicionar
... | ajibawa-2023/Python-Code-Large/train/row_97582 | 48 | 76 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97582:Import_L4_C0", "label": "sys import sys", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0526, 0.0132, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97582:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97582:FunctionDef_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97582:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97582:Assign_L13_C8"}, {"f": "ajibawa-2023/Python-... |
#!/usr/bin/env python
"""
svg.py - Construct/display SVG scenes.
The following code is a lightweight wrapper around SVG files. The metaphor
is to construct a scene, add objects to it, and then write it to a file
to display it.
This program uses ImageMagick to display the SVG files. ImageMagick also
does a remarkable... | ajibawa-2023/Python-Code-Large/train/row_97583 | 79 | 120 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97583:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 11], "level": 0, "parent": null, "vector": [8, 0, 0.0542, 0.0833, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97583:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97583:FunctionDef_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97583:FunctionDef_L17_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97583:Assign_L18_C8"}, {"f": "ajibawa-2023/Python-... |
from GrafoBipartito import *
from GeneradorGrafos import *
from Dibujador import *
from SolucionBasicaPoda import *
from HeuristicaInsercionEjes import *
import random
# grafo: todos los nodos y ejes, p1 p2 estaRel(v,u)
#dibujo: l1, l2 los nodos que no se pueden mover
class HeuristicaDeLaMediana (ResolvedorCons... | ajibawa-2023/Python-Code-Large/train/row_97584 | 163 | 198 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97584:ImportFrom_L1_C0", "label": "from GrafoBipartito import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0051, 0.0051, 0, 0.66, 0.0, 16, 0, 1, 0, 0, 16, 0, 0], "semantic": {"name": "GrafoBipartito", "arg_names": [], "import_names... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97584:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97584:FunctionDef_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97584:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97584:Assign_L13_C8"}, {"f": "ajibawa-2023/Python-C... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
#import psyco
#psyco.full()
from GrafoBipartito import Dibujo, ResolvedorConstructivo
from SolucionFuerzaBruta import cuantasCombinaciones
class ResolvedorBasicoConPoda(ResolvedorConstructivo):
def resolver(self):
g = self.dibujo.g
d = self.di... | ajibawa-2023/Python-Code-Large/train/row_97585 | 55 | 90 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97585:Import_L4_C0", "label": "sys import sys", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0444, 0.0111, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97585:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97585:FunctionDef_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97585:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97585:Assign_L14_C8"}, {"f": "ajibawa-2023/Python-... |
from BusquedaLocalIntercambioGreedy import *
from BusquedaLocalReInsercion import *
from HeuristicaInsercionEjes import *
class BusquedaLocalMix(BusquedaLocal):
def hallarMinimoLocal(self,dibujo,marcados1,marcados2,losEjesDe):
crucesInicial = contadorDeCruces(dibujo.l1,dibujo.l2,losEjesDe)
c... | ajibawa-2023/Python-Code-Large/train/row_97586 | 40 | 45 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97586:ImportFrom_L1_C0", "label": "from BusquedaLocalIntercambioGreedy import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0222, 0.0222, 0, 0.66, 0.0, 170, 0, 1, 0, 0, 170, 0, 0], "semantic": {"name": "BusquedaLocalIntercambioGreed... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97586:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97586:FunctionDef_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97586:FunctionDef_L6_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97586:Assign_L7_C8"}, {"f": "ajibawa-2023/Python-Code... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from GrafoBipartito import Dibujo, ResolvedorConstructivo
import sys
#import psyco
#psyco.full()
class ResolvedorFuerzaBruta(ResolvedorConstructivo):
def resolver(self):
# busco los nodos que quedan por posicionar
q1 = [x for x in self.dibujo.g.p1 if not... | ajibawa-2023/Python-Code-Large/train/row_97587 | 77 | 133 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97587:ImportFrom_L4_C0", "label": "from GrafoBipartito import Dibujo, ResolvedorConstructivo", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0301, 0.0075, 0, 0.66, 0.0, 16, 0, 2, 0, 0, 16, 0, 0], "semantic": {"name": "GrafoBipartito", "... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97587:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97587:FunctionDef_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97587:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97587:Assign_L14_C8"}, {"f": "ajibawa-2023/Python-... |
import random
from HeuristicaDeLaMediana import *
import psyco
psyco.full()
class BusquedaLocalMediana(BusquedaLocal):
def calcularMediana(self,each,indicesi,losEjesDe):
med = []
for each1 in losEjesDe[each]:
med.append(indicesi[each1])
med.sort()
if med == []... | ajibawa-2023/Python-Code-Large/train/row_97588 | 138 | 155 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97588:Import_L1_C0", "label": "random import random", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0065, 0.0065, 0, 0.66, 0.0, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "random", "arg_names": [], "import_names": ["random"], "rh... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97588:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97588:FunctionDef_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97588:FunctionDef_L7_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97588:Assign_L8_C8"}, {"f": "ajibawa-2023/Python-Code... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from sets import Set
import svg
from GrafoBipartito import GrafoBipartito, Dibujo
class DibujadorGrafoBipartito:
def __init__(self, dibujo, nombre="GrafoBipartito", height=800,marcados1=None,marcados2=None):
self.dibujo = dibujo
# calculo las dimensiones... | ajibawa-2023/Python-Code-Large/train/row_97590 | 85 | 128 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97590:ImportFrom_L4_C0", "label": "from sets import Set", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0312, 0.0078, 0, 0.66, 0.0, 842, 0, 1, 0, 0, 842, 0, 0], "semantic": {"name": "sets", "arg_names": [], "import_names": ["Set"], "rhs... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97590:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97590:FunctionDef_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97590:FunctionDef_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97590:Assign_L11_C8"}, {"f": "ajibawa-2023/Python-C... |
# Heuristica de agregar nodos de a uno y a acomodarlos
from GrafoBipartito import ResolvedorConstructivo, Dibujo, GrafoBipartito
from Dibujador import DibujadorGrafoBipartito
from GeneradorGrafos import generarGrafoBipartitoAleatorio, generarDibujoAleatorio
from sets import *
class HeuristicaInsercionNodosMenorGrado(Re... | ajibawa-2023/Python-Code-Large/train/row_97591 | 81 | 111 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97591:ImportFrom_L2_C0", "label": "from GrafoBipartito import ResolvedorConstructivo, Dibujo, GrafoBipartito", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.018, 0.009, 0, 0.66, 0.0, 16, 0, 3, 0, 0, 16, 0, 0], "semantic": {"name": "Graf... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97591:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97591:FunctionDef_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97591:FunctionDef_L7_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97591:Assign_L8_C8"}, {"f": "ajibawa-2023/Python-Code... |
from GrafoBipartito import *
from GeneradorGrafos import *
from Dibujador import *
# grafo: todos los nodos y ejes, p1 p2 estaRel(v,u)
#dibujo: l1, l2 los nodos que no se pueden mover
class HeuristicaRemocion (ResolvedorConstructivo):
def contarCrucesAcumTree(p1,p2,ejes):
if len(p1) < len(p2):
... | ajibawa-2023/Python-Code-Large/train/row_97592 | 171 | 206 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97592:ImportFrom_L1_C0", "label": "from GrafoBipartito import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0049, 0.0049, 0, 0.66, 0.0, 16, 0, 1, 0, 0, 16, 0, 0], "semantic": {"name": "GrafoBipartito", "arg_names": [], "import_names... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97592:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97592:FunctionDef_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97592:FunctionDef_L7_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97592:If_L8_C8"}, {"f": "ajibawa-2023/Python-Code-Lar... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
#import psyco
#psyco.full()
from GrafoBipartito import Dibujo, ResolvedorConstructivo
from GrafoBipartito import crucesEntre, crucesPorAgregarAdelante, crucesPorAgregarAtras
from SolucionFuerzaBruta import cuantasCombinaciones
class ResolvedorSwapperTabla(Resolv... | ajibawa-2023/Python-Code-Large/train/row_97593 | 147 | 310 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97593:Import_L4_C0", "label": "sys import sys", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0129, 0.0032, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97593:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97593:FunctionDef_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97593:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97593:Assign_L21_C8"}, {"f": "ajibawa-2023/Python-... |
# Heuristica de agregar nodos de a uno y a acomodarlos
from GrafoBipartito import ResolvedorConstructivo, Dibujo, GrafoBipartito
from Dibujador import DibujadorGrafoBipartito
from GeneradorGrafos import generarGrafoBipartitoAleatorio, generarDibujoAleatorio
from sets import *
class HeuristicaInsercionNodosMayorGrado(R... | ajibawa-2023/Python-Code-Large/train/row_97594 | 80 | 109 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97594:ImportFrom_L2_C0", "label": "from GrafoBipartito import ResolvedorConstructivo, Dibujo, GrafoBipartito", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0183, 0.0092, 0, 0.66, 0.0, 16, 0, 3, 0, 0, 16, 0, 0], "semantic": {"name": "Gr... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97594:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97594:FunctionDef_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97594:FunctionDef_L8_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97594:Assign_L9_C8"}, {"f": "ajibawa-2023/Python-Code... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
#import psyco
#psyco.full()
from GrafoBipartito import Dibujo, ResolvedorConstructivo
from GrafoBipartito import crucesEntre, crucesPorAgregarAdelante, crucesPorAgregarAtras
from SolucionFuerzaBruta import cuantasCombinaciones, tamArbol
class ResolvedorSwapperTa... | ajibawa-2023/Python-Code-Large/train/row_97595 | 186 | 368 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97595:Import_L4_C0", "label": "sys import sys", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0109, 0.0027, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97595:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97595:FunctionDef_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97595:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97595:Assign_L21_C8"}, {"f": "ajibawa-2023/Python-... |
# Heuristica de agregar nodos de a uno y a acomodarlos
from GrafoBipartito import ResolvedorConstructivo, Dibujo
from Dibujador import DibujadorGrafoBipartito
from GeneradorGrafos import generarGrafoBipartitoAleatorio, generarDibujoAleatorio
import random
class HeuristicaInsercionNodosRandom(ResolvedorConstructivo):
... | ajibawa-2023/Python-Code-Large/train/row_97596 | 70 | 95 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97596:ImportFrom_L2_C0", "label": "from GrafoBipartito import ResolvedorConstructivo, Dibujo", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0211, 0.0105, 0, 0.66, 0.0, 16, 0, 2, 0, 0, 16, 0, 0], "semantic": {"name": "GrafoBipartito", "... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97596:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97596:FunctionDef_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97596:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97596:Assign_L10_C8"}, {"f": "ajibawa-2023/Python-Cod... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.