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 |
|---|---|---|---|---|---|---|---|
from random import shuffle
from Carta import Carta
class Mazo(object):
"""Representa a un mazo de barajas inglesas"""
def __init__(self):
"""Inicializa un mazo con sus 52 cartas"""
self.cartas = []
for numero in xrange(1, 13 + 1):
for palo in (Carta.CORAZONES, Carta.DIAMANTES, Carta.PICAS, Carta.TREBOLES):... | ajibawa-2023/Python-Code-Large/train/row_98153 | 19 | 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_98153:ImportFrom_L1_C0", "label": "from random import shuffle", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0417, 0.0417, 0, 0.66, 0.0, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "random", "arg_names": [], "import_names": ["shu... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98153:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98153:Expr_L5_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98153:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98153:FunctionDef_L6_C1"}, {"f": "ajibawa-2023/Python-Code-Larg... |
from string import upper
import re
from sys import stdin
SCORES = {'A':1, 'E':1, 'I':1, 'L':1, 'N':1, 'O':1, 'R':1, 'S':1, 'T':1, 'U':1,
'D':2, 'G':2, 'B':3, 'C':3, 'M':3, 'P':3, 'F':4, 'H':4, 'V':4, 'W':4,
'Y':4, 'K':5, 'J':8, 'X':8, 'Q':10, 'Z':10}
def read_dictionary_from_file():
... | ajibawa-2023/Python-Code-Large/train/row_98154 | 74 | 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_98154:ImportFrom_L1_C0", "label": "from string import upper", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.009, 0.009, 0, 0.66, 0.0, 890, 0, 1, 0, 0, 890, 0, 0], "semantic": {"name": "string", "arg_names": [], "import_names": ["upper"]... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98154:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98154:Assign_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98154:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98154:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code... |
from time import clock, time
import heapq
POINTS_TABLE = { 'A': 1, 'E': 1, 'I': 1, 'L': 1, 'N': 1, 'O': 1, 'R': 1, 'S': 1,
'T': 1, 'U': 1, 'D': 2, 'G': 2, 'B': 3, 'C': 3, 'M': 3, 'P': 3,
'F': 4, 'H': 4, 'V': 4, 'W': 4, 'Y': 4, 'K': 5, 'J': 8, 'X': 8,
'Q': 10, 'Z': 10 }
class WordNode(... | ajibawa-2023/Python-Code-Large/train/row_98155 | 196 | 284 | 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_98155:ImportFrom_L1_C0", "label": "from time import clock, time", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0035, 0.0035, 0, 0.66, 0.0, 654, 0, 2, 0, 0, 654, 0, 0], "semantic": {"name": "time", "arg_names": [], "import_names": ["clo... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98155:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98155:FunctionDef_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98155:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98155:Assign_L12_C8"}, {"f": "ajibawa-2023/Python-C... |
import matplotlib.pyplot as plt
import fib1,fib2,fib3,fib4,fib5
from monitor import monitorFib
def showFigure(module,n):
x = []
y = []
print "?????"
for i in range(n):
print i
x.append(i)
y.append(monitorFib(module,i))
plt.plot(x,y)
print x
print y
plt.show()
i... | ajibawa-2023/Python-Code-Large/train/row_98156 | 17 | 20 | 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_98156:Import_L2_C0", "label": "matplotlib.pyplot import plt", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.1, 0.05, 0, 0.66, 0.0, 596, 0, 1, 0, 0, 596, 0, 0], "semantic": {"name": "matplotlib.pyplot", "arg_names": [], "import_names": [... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98156:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98156:Assign_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98156:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98156:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-L... |
#!/usr/bin/python
# -*- coding: utf8 -*-
from math import sqrt
# 存储运算中需要用到的两个常量
a = (1+sqrt(5))/2.0
b = (1-sqrt(5))/2.0
def fib(n):
""" Standard Formula """
# 特殊情况:n为0或1
if(n == 0):
return 0
elif(n == 1):
return 1
else:
index = 2
c = a
d = b
# 根据公式计... | ajibawa-2023/Python-Code-Large/train/row_98157 | 16 | 25 | 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_98157:ImportFrom_L4_C0", "label": "from math import sqrt", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.16, 0.04, 0, 0.66, 0.0, 526, 0, 1, 0, 0, 526, 0, 0], "semantic": {"name": "math", "arg_names": [], "import_names": ["sqrt"], "rhs_c... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98157:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98157:Expr_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98157:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98157:If_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
#!/usr/bin/python
# -*- coding: utf8 -*-
def square(m):
""" 求矩阵m的平方 """
r2 = m[2]*m[2]+m[1]*m[1]
r1 = m[2]*m[1]+m[1]*m[0]
r0 = m[1]*m[1]+m[0]*m[0]
m[2] = r2
m[1] = r1
m[0] = r0
def recur(matrix,n):
# 递归结束条件
if n == 1:
return matrix
else:
recur(matrix,n/2) # Di... | ajibawa-2023/Python-Code-Large/train/row_98158 | 28 | 40 | 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_98158:FunctionDef_L4_C0", "label": "square", "type": "function", "loc": [4, 11], "level": 0, "parent": null, "vector": [2, 0, 0.1875, 0.2, 0, 0.66, 0.0, 342, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "square", "arg_names": ["m"], "import_names": [], "rhs_call_name": ""... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98158:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98158:Expr_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98158:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98158:Assign_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
#!/usr/bin/python
# -*- coding: utf8 -*-
from math import sqrt
# 存储运算中需要用到的两个常量
a = (1+sqrt(5))/2.0
b = (1-sqrt(5))/2.0
def fib(n):
""" Standard Formula """
# 特殊情况:n为0或1
if(n == 0):
return 0
elif(n == 1):
return 1
else:
index = 2
c = a
d = b
# 根据公式计... | ajibawa-2023/Python-Code-Large/train/row_98159 | 16 | 25 | 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_98159:ImportFrom_L4_C0", "label": "from math import sqrt", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.16, 0.04, 0, 0.66, 0.0, 526, 0, 1, 0, 0, 526, 0, 0], "semantic": {"name": "math", "arg_names": [], "import_names": ["sqrt"], "rhs_c... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98159:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98159:Expr_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98159:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98159:If_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
#!/usr/bin/python
# -*- coding: utf8 -*-
from math import sqrt
a = (1+sqrt(5))/2
def recur(n):
# 递归结束条件
if(n == 0):
return 1
elif(n == 1):
return a
else:
b = recur(n/2) #递归调用,Divide and Conquer
# Combine
b = b * b
if(n % 2 == 1): #处理n为奇数的情况
... | ajibawa-2023/Python-Code-Large/train/row_98160 | 19 | 29 | 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_98160:ImportFrom_L4_C0", "label": "from math import sqrt", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.1379, 0.0345, 0, 0.66, 0.0, 526, 0, 1, 0, 0, 526, 0, 0], "semantic": {"name": "math", "arg_names": [], "import_names": ["sqrt"], "r... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98160:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98160:If_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98160:If_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98160:Return_L11_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train... |
#!/usr/bin/python
# -*- coding: utf8 -*-
def square(m):
""" 求矩阵m的平方 """
r2 = m[2]*m[2]+m[1]*m[1]
r1 = m[2]*m[1]+m[1]*m[0]
r0 = m[1]*m[1]+m[0]*m[0]
m[2] = r2
m[1] = r1
m[0] = r0
def recur(matrix,n):
# 递归结束条件
if n == 1:
return matrix
else:
recur(matrix,n/2) # Di... | ajibawa-2023/Python-Code-Large/train/row_98161 | 28 | 40 | 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_98161:FunctionDef_L4_C0", "label": "square", "type": "function", "loc": [4, 11], "level": 0, "parent": null, "vector": [2, 0, 0.1875, 0.2, 0, 0.66, 0.0, 342, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "square", "arg_names": ["m"], "import_names": [], "rhs_call_name": ""... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98161:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98161:Expr_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98161:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98161:Assign_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
#!/usr/bin/python
# -*- coding: utf8 -*-
def fib(n):
""" Recursion """
# 递归结束条件: n为0或1
if(n == 0):
return 0
elif(n == 1):
return 1
else:
return fib(n-1)+fib(n-2) # 递归调用
| ajibawa-2023/Python-Code-Large/train/row_98162 | 7 | 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_98162:FunctionDef_L4_C0", "label": "fib", "type": "function", "loc": [4, 12], "level": 0, "parent": null, "vector": [2, 0, 0.6667, 0.75, 0, 0.66, 0.0, 604, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "fib", "arg_names": ["n"], "import_names": [], "rhs_call_name": "", "an... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98162:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98162:Expr_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98162:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98162:If_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t... |
#!/usr/bin/python
# -*- coding: utf8 -*-
def fib(n):
""" Bottom-up """
# 特殊情况: n为0或1
if(n == 0):
return 0
elif(n == 1):
return 1
else:
# 用f(0)表示F(n-2),f1表示F(n-1),f2表示F(n)
f0 = 0
f1 = 1
f2 = f0+f1
index = 2
while(index < n):
... | ajibawa-2023/Python-Code-Large/train/row_98163 | 16 | 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_98163:FunctionDef_L4_C0", "label": "fib", "type": "function", "loc": [4, 23], "level": 0, "parent": null, "vector": [2, 0, 0.5625, 0.8333, 0, 0.66, 0.0, 604, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "fib", "arg_names": ["n"], "import_names": [], "rhs_call_name": "", "... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98163:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98163:Expr_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98163:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98163:If_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t... |
#!/usr/bin/python
# -*- coding: utf8 -*-
import sys
from time import time
import fib1,fib2,fib3,fib4,fib5
def monitorFib(module,n):
start = time()
result = module.fib(n)
elapsed = time()-start
print "%s took %0.3f ms :%d (%s)" % (module.__name__,elapsed*1000.0,result,module.fib.__doc__)
return ela... | ajibawa-2023/Python-Code-Large/train/row_98164 | 19 | 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_98164:Import_L4_C0", "label": "sys import sys", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.1481, 0.037, 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_98164:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98164:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98164:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98164:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-... |
#!/usr/bin/python
# -*- coding: utf8 -*-
import sys
from time import time
import fib1,fib2,fib3,fib4,fib5
def monitorFib(module,n):
start = time()
result = module.fib(n)
elapsed = time()-start
print "%s took %0.3f ms :%d (%s)" % (module.__name__,elapsed*1000.0,result,module.fib.__doc__)
return ela... | ajibawa-2023/Python-Code-Large/train/row_98165 | 19 | 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_98165:Import_L4_C0", "label": "sys import sys", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.1481, 0.037, 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_98165:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98165:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98165:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98165:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-... |
#!/usr/bin/python
# -*- coding: utf8 -*-
def fib(n):
""" Bottom-up """
# 特殊情况: n为0或1
if(n == 0):
return 0
elif(n == 1):
return 1
else:
# 用f(0)表示F(n-2),f1表示F(n-1),f2表示F(n)
f0 = 0
f1 = 1
f2 = f0+f1
index = 2
while(index < n):
... | ajibawa-2023/Python-Code-Large/train/row_98166 | 16 | 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_98166:FunctionDef_L4_C0", "label": "fib", "type": "function", "loc": [4, 23], "level": 0, "parent": null, "vector": [2, 0, 0.5625, 0.8333, 0, 0.66, 0.0, 604, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "fib", "arg_names": ["n"], "import_names": [], "rhs_call_name": "", "... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98166:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98166:Expr_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98166:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98166:If_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t... |
#!/usr/bin/python
# -*- coding: utf8 -*-
from math import sqrt
a = (1+sqrt(5))/2
def recur(n):
# 递归结束条件
if(n == 0):
return 1
elif(n == 1):
return a
else:
b = recur(n/2) #递归调用,Divide and Conquer
# Combine
b = b * b
if(n % 2 == 1): #处理n为奇数的情况
... | ajibawa-2023/Python-Code-Large/train/row_98167 | 19 | 29 | 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_98167:ImportFrom_L4_C0", "label": "from math import sqrt", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.1379, 0.0345, 0, 0.66, 0.0, 526, 0, 1, 0, 0, 526, 0, 0], "semantic": {"name": "math", "arg_names": [], "import_names": ["sqrt"], "r... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98167:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98167:If_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98167:If_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98167:Return_L11_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train... |
#!/usr/bin/python
# -*- coding: utf8 -*-
def fib(n):
""" Recursion """
# 递归结束条件: n为0或1
if(n == 0):
return 0
elif(n == 1):
return 1
else:
return fib(n-1)+fib(n-2) # 递归调用
| ajibawa-2023/Python-Code-Large/train/row_98168 | 7 | 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_98168:FunctionDef_L4_C0", "label": "fib", "type": "function", "loc": [4, 12], "level": 0, "parent": null, "vector": [2, 0, 0.6667, 0.75, 0, 0.66, 0.0, 604, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "fib", "arg_names": ["n"], "import_names": [], "rhs_call_name": "", "an... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98168:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98168:Expr_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98168:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98168:If_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t... |
#!/usr/bin/env python2
import random
import math
n = 1
count = 100
rate = 20
for V in range(5, count):
filename = "test-" + str(n) + ".txt"
n = n + 1
fle = open(filename, "w+")
print "Generating test: " + filename + "..."
nodos = V + 1
fabricas = int(math.ceil(rate * nodos / 100))
clientes = nodos -... | ajibawa-2023/Python-Code-Large/train/row_98169 | 19 | 31 | 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_98169:Import_L3_C0", "label": "random import random", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0968, 0.0323, 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_98169:For_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98169:Assign_L12_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98169:For_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98169:Assign_L14_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/r... |
#!/usr/bin/env python2
import random
import math
n = 1
count = 100
rate = 20
for V in range(5, count):
filename = "test-" + str(n) + ".txt"
n = n + 1
fle = open(filename, "w+")
print "Generating test: " + filename + "..."
nodos = V + 1
fabricas = int(math.ceil(rate * nodos / 100))
clientes = nodos -... | ajibawa-2023/Python-Code-Large/train/row_98170 | 19 | 31 | 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_98170:Import_L3_C0", "label": "random import random", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0968, 0.0323, 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_98170:For_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98170:Assign_L12_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98170:For_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98170:Assign_L14_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/r... |
#!/usr/bin/env python2
import subprocess, time, os, sys
def instanceFromFile(path):
f = open(path)
text = ""
for line in f:
text += line
return text
def launch(input):
command = ["./problema3-test"]
subp = subprocess.Popen(command, stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.STDOUT)
st... | ajibawa-2023/Python-Code-Large/train/row_98171 | 27 | 42 | 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_98171:Import_L4_C0", "label": "subprocess import subprocess, time, os\u2026", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0952, 0.0238, 0, 0.66, 0.0, 394, 0, 4, 0, 0, 394, 0, 0], "semantic": {"name": "subprocess", "arg_names": [], "im... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98171:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98171:Assign_L7_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98171:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98171:Assign_L8_C1"}, {"f": "ajibawa-2023/Python-Code-L... |
#!/usr/bin/env python2
import subprocess, time, os, sys
def instanceFromFile(path):
f = open(path)
text = ""
for line in f:
text += line
return text
def launch(input):
command = ["./problema3-test"]
subp = subprocess.Popen(command, stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.STDOUT)
st... | ajibawa-2023/Python-Code-Large/train/row_98172 | 27 | 42 | 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_98172:Import_L4_C0", "label": "subprocess import subprocess, time, os\u2026", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0952, 0.0238, 0, 0.66, 0.0, 394, 0, 4, 0, 0, 394, 0, 0], "semantic": {"name": "subprocess", "arg_names": [], "im... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98172:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98172:Assign_L7_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98172:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98172:Assign_L8_C1"}, {"f": "ajibawa-2023/Python-Code-L... |
#!/usr/bin/env python2
import subprocess, time, os, sys
def instanceFromFile(path):
f = open(path)
text = ""
for line in f:
text += line
return text
def launch(input):
command = ["./problema2-test"]
subp = subprocess.Popen(command, stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.STDOUT)
st... | ajibawa-2023/Python-Code-Large/train/row_98173 | 28 | 42 | 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_98173:Import_L4_C0", "label": "subprocess import subprocess, time, os\u2026", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0952, 0.0238, 0, 0.66, 0.0, 394, 0, 4, 0, 0, 394, 0, 0], "semantic": {"name": "subprocess", "arg_names": [], "im... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98173:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98173:Assign_L7_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98173:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98173:Assign_L8_C1"}, {"f": "ajibawa-2023/Python-Code-L... |
#!/usr/bin/env python2
import random
#~ i = 1
#~
#~ for nodos in range(100):
#~ name = "test-" + str(i) + ".txt"
#~ i = i + 1
#~ f = open(name, "w+")
#~
#~ print "Generating " + name + "..."
#~
#~ f.write(str(nodos+1) + " " + str(nodos) + "\n")
#~
#~ for j in range(nodos):
#~ f.write(str(j+1) + " " + str(... | ajibawa-2023/Python-Code-Large/train/row_98174 | 15 | 43 | 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_98174:Import_L3_C0", "label": "random import random", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0698, 0.0233, 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_98174:For_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98174:Assign_L26_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98174:For_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98174:Assign_L28_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/r... |
#!/usr/bin/env python2
import subprocess, time, os, sys
def instanceFromFile(path):
f = open(path)
text = ""
for line in f:
text += line
return text
def launch(input):
command = ["./problema2-test"]
subp = subprocess.Popen(command, stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.STDOUT)
st... | ajibawa-2023/Python-Code-Large/train/row_98175 | 28 | 42 | 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_98175:Import_L4_C0", "label": "subprocess import subprocess, time, os\u2026", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0952, 0.0238, 0, 0.66, 0.0, 394, 0, 4, 0, 0, 394, 0, 0], "semantic": {"name": "subprocess", "arg_names": [], "im... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98175:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98175:Assign_L7_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98175:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98175:Assign_L8_C1"}, {"f": "ajibawa-2023/Python-Code-L... |
#!/usr/bin/env python2
import random
#~ i = 1
#~
#~ for nodos in range(100):
#~ name = "test-" + str(i) + ".txt"
#~ i = i + 1
#~ f = open(name, "w+")
#~
#~ print "Generating " + name + "..."
#~
#~ f.write(str(nodos+1) + " " + str(nodos) + "\n")
#~
#~ for j in range(nodos):
#~ f.write(str(j+1) + " " + str(... | ajibawa-2023/Python-Code-Large/train/row_98176 | 15 | 43 | 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_98176:Import_L3_C0", "label": "random import random", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0698, 0.0233, 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_98176:For_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98176:Assign_L26_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98176:For_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98176:Assign_L28_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/r... |
import re
import config
import common
import random
import array
# Step 1: Choose a starting point of MarkovOrder (2 or 3) notes.
# Choose from list of states that have a non-empty successor list.
# Step 2: Find a note randomly(?) from the list of successors.
# There's scope for improvement(?) here - we can choose to... | ajibawa-2023/Python-Code-Large/train/row_98178 | 52 | 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_98178:Import_L1_C0", "label": "re import re", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0132, 0.0132, 0, 0.66, 0.0, 540, 0, 1, 0, 0, 540, 0, 0], "semantic": {"name": "re", "arg_names": [], "import_names": ["re"], "rhs_call_name": ""... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98178:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98178:Assign_L22_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98178:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98178:For_L23_C1"}, {"f": "ajibawa-2023/Python-Code-... |
RagaDef = {};
RagaDef['Mohana'] = ['Sa','Re','Ga','Pa','Da'];
RagaDef['SriRanjani'] = ['Sa','Re','Ga','Ma','Da','Ni'];
| ajibawa-2023/Python-Code-Large/train/row_98179 | 3 | 5 | 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_98179:Assign_L2_C0", "label": "RagaDef =", "type": "assigned_variable", "loc": [2, 2], "level": 0, "parent": null, "vector": [14, 0, 0.4, 0.2, 0, 0.66, 0.0, 689, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "RagaDef", "arg_names": [], "import_names": [], "rhs_call_name": ... | [] |
Path='../corpus/Mohana'
Raga='Mohana'
Tala='Adi'
Instrument='Piano'
MarkovOrder=3;
OutFile='Analytics.txt'
| ajibawa-2023/Python-Code-Large/train/row_98181 | 6 | 6 | 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_98181:Assign_L1_C0", "label": "Path =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.1667, 0.1667, 0, 0.66, 0.0, 754, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "Path", "arg_names": [], "import_names": [], "rhs_call_name": ... | [] |
#Archivo: Modulo Serial
#Version:1
#Autores: Yimy Juarez, Manuel Arana, Irrael Eduardo
#Descripcion: Este programa es un modulo que permite enviar los
#datos al puerto serial, mediante el parametro ingresado.
#Modificacion: 22 de Mayo de 2011
#----------------Se importan los modulos
import time
import serial
d... | ajibawa-2023/Python-Code-Large/train/row_98182 | 12 | 20 | 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_98182:Import_L8_C0", "label": "time import time", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.4, 0.05, 0, 0.66, 0.0, 654, 0, 1, 0, 0, 654, 0, 0], "semantic": {"name": "time", "arg_names": [], "import_names": ["time"], "rhs_call_name":... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98182:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98182:Assign_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98182:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98182:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Co... |
#!/usr/bin/env python2
import subprocess, time, os, sys, random
def instanceFromFile(path):
f = open(path)
input = ""
for line in f:
input += line
return input.strip()
def toDot(path):
f = open(path)
input = []
for line in f:
input.append(line.strip())
input = input[1:]
dotFile = ""
dotFile += "Gr... | ajibawa-2023/Python-Code-Large/train/row_98183 | 65 | 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_98183:Import_L3_C0", "label": "subprocess import subprocess, time, os\u2026", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0316, 0.0105, 0, 0.66, 0.0, 394, 0, 5, 0, 0, 394, 0, 0], "semantic": {"name": "subprocess", "arg_names": [], "im... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98183:FunctionDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98183:Assign_L6_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98183:FunctionDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98183:Assign_L7_C1"}, {"f": "ajibawa-2023/Python-Code-L... |
#!/usr/bin/env python2
import subprocess, time, os, sys, random
def instanceFromFile(path):
f = open(path)
input = ""
for line in f:
input += line
return input.strip()
def toDot(path):
f = open(path)
input = []
for line in f:
input.append(line.strip())
input = input[1:]
dotFile = ""
dotFile += "Gr... | ajibawa-2023/Python-Code-Large/train/row_98184 | 65 | 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_98184:Import_L3_C0", "label": "subprocess import subprocess, time, os\u2026", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0316, 0.0105, 0, 0.66, 0.0, 394, 0, 5, 0, 0, 394, 0, 0], "semantic": {"name": "subprocess", "arg_names": [], "im... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98184:FunctionDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98184:Assign_L6_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98184:FunctionDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98184:Assign_L7_C1"}, {"f": "ajibawa-2023/Python-Code-L... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
import subprocess, time, os, sys
cmf = "./cmf"
iterations = 1000
def instanceFromFile(path):
f = open(path)
input = ""
for line in f:
input += line
return input.strip()
def getTestFiles(folder, ext):
testFiles = []
for root, dirs, files in os.walk(folder):
fo... | ajibawa-2023/Python-Code-Large/train/row_98185 | 50 | 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_98185:Import_L4_C0", "label": "subprocess import subprocess, time, os\u2026", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0494, 0.0123, 0, 0.66, 0.0, 394, 0, 4, 0, 0, 394, 0, 0], "semantic": {"name": "subprocess", "arg_names": [], "im... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98185:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98185:Assign_L10_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98185:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98185:Assign_L11_C1"}, {"f": "ajibawa-2023/Python-Code... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
import subprocess, time, os, sys
cmf = "./cmf"
iterations = 1000
def instanceFromFile(path):
f = open(path)
input = ""
for line in f:
input += line
return input.strip()
def getTestFiles(folder, ext):
testFiles = []
for root, dirs, files in os.walk(folder):
fo... | ajibawa-2023/Python-Code-Large/train/row_98186 | 50 | 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_98186:Import_L4_C0", "label": "subprocess import subprocess, time, os\u2026", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0494, 0.0123, 0, 0.66, 0.0, 394, 0, 4, 0, 0, 394, 0, 0], "semantic": {"name": "subprocess", "arg_names": [], "im... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98186:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98186:Assign_L10_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98186:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98186:Assign_L11_C1"}, {"f": "ajibawa-2023/Python-Code... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
import subprocess, time, os, sys
cmf = "./cmf"
iterations = 50
def instanceFromFile(path):
f = open(path)
input = ""
for line in f:
input += line
return input.strip()
def getTestFiles(folder, ext):
testFiles = []
for root, dirs, files in os.walk(folder):
for ... | ajibawa-2023/Python-Code-Large/train/row_98187 | 50 | 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_98187:Import_L4_C0", "label": "subprocess import subprocess, time, os\u2026", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0494, 0.0123, 0, 0.66, 0.0, 394, 0, 4, 0, 0, 394, 0, 0], "semantic": {"name": "subprocess", "arg_names": [], "im... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98187:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98187:Assign_L10_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98187:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98187:Assign_L11_C1"}, {"f": "ajibawa-2023/Python-Code... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
import subprocess, time, os, sys
cmf = "./cmf"
iterations = 50
def instanceFromFile(path):
f = open(path)
input = ""
for line in f:
input += line
return input.strip()
def getTestFiles(folder, ext):
testFiles = []
for root, dirs, files in os.walk(folder):
for ... | ajibawa-2023/Python-Code-Large/train/row_98188 | 50 | 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_98188:Import_L4_C0", "label": "subprocess import subprocess, time, os\u2026", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0494, 0.0123, 0, 0.66, 0.0, 394, 0, 4, 0, 0, 394, 0, 0], "semantic": {"name": "subprocess", "arg_names": [], "im... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98188:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98188:Assign_L10_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98188:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98188:Assign_L11_C1"}, {"f": "ajibawa-2023/Python-Code... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
import subprocess, time, os, sys
cmf = "./cmf"
iterations = 1000
def instanceFromFile(path):
f = open(path)
input = ""
for line in f:
input += line
return input.strip()
def getTestFiles(folder, ext):
testFiles = []
for root, dirs, files in os.walk(folder):
fo... | ajibawa-2023/Python-Code-Large/train/row_98189 | 50 | 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_98189:Import_L4_C0", "label": "subprocess import subprocess, time, os\u2026", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0494, 0.0123, 0, 0.66, 0.0, 394, 0, 4, 0, 0, 394, 0, 0], "semantic": {"name": "subprocess", "arg_names": [], "im... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98189:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98189:Assign_L10_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98189:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98189:Assign_L11_C1"}, {"f": "ajibawa-2023/Python-Code... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
import subprocess, time, os, sys
cmf = "./cmf"
iterations = 1000
def instanceFromFile(path):
f = open(path)
input = ""
for line in f:
input += line
return input.strip()
def getTestFiles(folder, ext):
testFiles = []
for root, dirs, files in os.walk(folder):
fo... | ajibawa-2023/Python-Code-Large/train/row_98190 | 50 | 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_98190:Import_L4_C0", "label": "subprocess import subprocess, time, os\u2026", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0494, 0.0123, 0, 0.66, 0.0, 394, 0, 4, 0, 0, 394, 0, 0], "semantic": {"name": "subprocess", "arg_names": [], "im... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98190:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98190:Assign_L10_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98190:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98190:Assign_L11_C1"}, {"f": "ajibawa-2023/Python-Code... |
__all__=["bubblesort","insertionsort"]
| ajibawa-2023/Python-Code-Large/train/row_98193 | 1 | 1 | 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_98193:Assign_L1_C0", "label": "__all__ =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 1.0, 1.0, 0, 0.66, 0.0, 272, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "__all__", "arg_names": [], "import_names": [], "rhs_call_name": ... | [] |
#!/usr/bin/python
"""
Heapsort implementation
"""
def siftup(x, n):
i = n
c = x[i] #x[i] == c
while True:
p = i / 2
if x[p] >= c:
break
x[i] = x[p]
i = p
x[i] = c
def siftdown(x, n):
if n <= 1: return
i = 1
c = x[i]
while True:
p =... | ajibawa-2023/Python-Code-Large/train/row_98194 | 71 | 100 | 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_98194:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 5], "level": 0, "parent": null, "vector": [8, 0, 0.04, 0.03, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98194:FunctionDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98194:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98194:FunctionDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98194:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-L... |
#!/usr/bin/python
"""
Binary Tree implementation and visualization
"""
import os
import sys
pygraphvizOk = True
try:
import pygraphviz
except ImportError:
pygraphvizOk = False
__metaclass__ = type
class BinTree:
def __init__(self, value = 0, parent = None, label='', left=None, right=None):
... | ajibawa-2023/Python-Code-Large/train/row_98195 | 309 | 460 | 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_98195:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0087, 0.0065, 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_98195:Try_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98195:Import_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98195:Try_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98195:Assign_L14_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/r... |
#!/usr/bin/python
import sys
import os, commands
"""
Run program from source code directly. Support C, C++, Java, etc
"""
if len(sys.argv) < 2:
print 'Usage: %s sourcefile' % os.path.basename(sys.argv[0])
sourcename = sys.argv[1]
handler = None
if len(sourcename.split('.')) > 1:
suffix = sourcename.split(... | ajibawa-2023/Python-Code-Large/train/row_98196 | 35 | 68 | 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_98196:Import_L3_C0", "label": "sys import sys", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0441, 0.0147, 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_98196:If_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98196:Expr_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98196:If_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98196:Assign_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_9... |
#!/usr/bin/python
"""
for the non-integral part of fraction a/b, found the n-th occurence of digit m, where 0 <= m <= 9
2013 Yahoo competition question 1
"""
def getNthPosViolent(a, b, m, n):
import decimal
precision = 2000
decimal.getcontext().prec = precision
a %= b
q = decimal.Decimal(a)/decim... | ajibawa-2023/Python-Code-Large/train/row_98197 | 64 | 107 | 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_98197:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 6], "level": 0, "parent": null, "vector": [8, 0, 0.0421, 0.0374, 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_98197:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98197:Import_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98197:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98197:Assign_L11_C4"}, {"f": "ajibawa-2023/Python-Code... |
# -*- coding: utf-8 -*-
import partie_1_diff as tn
import numpy as np
# Question 1 :
def elastic_force(k, xo = 0, yo = 0):
"define a k-elastic force"
return lambda x, y: np.array([[-k*x], [-k*y]])
def centrifugal_force(k, xo, yo):
"define a k-elastic force"
return lambda x, y: np.array([[k*(x-xo)], ... | ajibawa-2023/Python-Code-Large/train/row_98198 | 31 | 68 | 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_98198:Import_L3_C0", "label": "partie_1_diff import tn", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0441, 0.0147, 0, 0.66, 0.0, 570, 0, 1, 0, 0, 570, 0, 0], "semantic": {"name": "partie_1_diff", "arg_names": [], "import_names": ["tn"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98198:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98198:Expr_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98198:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98198:Return_L10_C4"}, {"f": "ajibawa-2023/Python-Code-La... |
# -*- coding:utf-8 -*-
# Entry : (f::function, J::jacobian of f, U0::initial value, N::maximum of iteration, epsilon::accuracy)
# Return : U::position vector
import numpy as np
import matplotlib.pyplot as plt
# precision de la derivee :
derivate_accuracy = pow(10, -15)
def methode_de_Newton (f, Uo, N, epsilon, sho... | ajibawa-2023/Python-Code-Large/train/row_98199 | 58 | 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_98199:Import_L6_C0", "label": "numpy import np", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0612, 0.0102, 0, 0.66, 0.0, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_nam... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98199:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98199:Expr_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98199:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98199:Expr_L15_C4"}, {"f": "ajibawa-2023/Python-Code-L... |
import numpy as np
import matplotlib.pyplot as plt
def Newton_Raphson (f, fJ, Uo, N, epsilon, show = 0, name="figure", E = None):
"applies Newton methode to the function f and its jacobian matrix J beginning from the vector Uo, looping at max at N and with an accuracy of epsilon"
if(E == None):
E = la... | ajibawa-2023/Python-Code-Large/train/row_98200 | 73 | 97 | 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_98200:Import_L1_C0", "label": "numpy import np", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0103, 0.0103, 0, 0.66, 0.0, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_nam... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98200:FunctionDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98200:Expr_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98200:FunctionDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98200:If_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t... |
##SECTION 4: ELECTROSTATIC EQUILIBRIUM ##
# -*- coding: utf-8 -*-
import numpy as np
import partie_1 as nr
from numpy import polynomial as P
import matplotlib.pyplot as plt
def ElecEnergy(X):
"Calcule l'énergie totale du système "
n=X.shape[0]
r =0.
for i in range(n):
cpt =0.
for j i... | ajibawa-2023/Python-Code-Large/train/row_98201 | 63 | 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_98201:Import_L4_C0", "label": "numpy import np", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.043, 0.0108, 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_98201:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98201:Expr_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98201:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98201:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code... |
# -*- coding: utf-8 -*-
import partie_1 as tn
import numpy as np
# Question 1 :
def elastic_force(k, xo = 0, yo = 0):
"defines a k-elastic force"
return lambda x, y: np.array([[-k*x], [-k*y]])
def centrifugal_force(k, xo, yo):
"defines a k-elastic force"
return lambda x, y: np.array([[k*(x-xo)],
... | ajibawa-2023/Python-Code-Large/train/row_98202 | 42 | 92 | 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_98202:Import_L2_C0", "label": "partie_1 import tn", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0217, 0.0109, 0, 0.66, 0.0, 210, 0, 1, 0, 0, 210, 0, 0], "semantic": {"name": "partie_1", "arg_names": [], "import_names": ["tn"], "rhs_ca... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98202:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98202:Expr_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98202:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98202:Return_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
# -*- coding: utf-8 -*-
vowels = 'aAiIuUfFxXeEoOMH'
consonants = 'kKgGNcCjJYwWqQRtTdDnpPbBmyrlvSzsh'
other = ". |-\r\n\t"
virama = u'\u094d'
map_vowels = {'a':u'\u0905', 'A':u'\u0906', 'i':u'\u0907', 'I':u'\u0908', 'u':u'\u0909', \
'U':u'\u090a', 'f':u'\u090b', 'F':u'\u0960', 'x':u'\u090c', 'X':... | ajibawa-2023/Python-Code-Large/train/row_98203 | 41 | 64 | 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_98203:Assign_L3_C0", "label": "vowels =", "type": "assigned_variable", "loc": [3, 3], "level": 0, "parent": null, "vector": [14, 0, 0.0469, 0.0156, 0, 0.66, 0.0, 841, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "vowels", "arg_names": [], "import_names": [], "rhs_call_nam... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98203:FunctionDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98203:Return_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98203:FunctionDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98203:Return_L29_C4"}, {"f": "ajibawa-2023/Python-Co... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Devanagari Editor
import pygtk, pango
pygtk.require('2.0')
import gtk
from decoders import devanagari
help_string = '''
अ आ इ ई उ ऊ ऋ ॠ ऌ ॡ ए ऐ ओ औ अं अः
a A i I u U R RR lR lRR e ai o au M H
क ख ग घ ङ | य र ल व
k kh g gh G | y r l v
च छ ज झ ञ | श ष स ह
c ch j jh J | ... | ajibawa-2023/Python-Code-Large/train/row_98204 | 98 | 154 | 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_98204:Import_L6_C0", "label": "pygtk import pygtk, pango", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.039, 0.0065, 0, 0.66, 0.0, 106, 0, 2, 0, 0, 106, 0, 0], "semantic": {"name": "pygtk", "arg_names": [], "import_names": ["pygtk", "p... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98204:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98204:FunctionDef_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98204:FunctionDef_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98204:Expr_L30_C8"}, {"f": "ajibawa-2023/Python-Co... |
# -*- coding: utf-8 -*-
# Devanagari Editor
import pygtk, pango
pygtk.require('2.0')
import gtk
from decoders import devanagari
Vowels = 'aAiIuUReoMH'
Consonants = 'kgGcjJTDNtdnpbmyrlvzSsh'
Numbers = '0123456789'
other = ". |-\r\n\t"
virama = u'\u094d'
map_vowels = {'a':u'\u0905', 'A':u'\u0906', 'i':... | ajibawa-2023/Python-Code-Large/train/row_98205 | 233 | 311 | 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_98205:Import_L5_C0", "label": "pygtk import pygtk, pango", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0161, 0.0032, 0, 0.66, 0.0, 106, 0, 2, 0, 0, 106, 0, 0], "semantic": {"name": "pygtk", "arg_names": [], "import_names": ["pygtk", "... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98205:FunctionDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98205:Return_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98205:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98205:Return_L39_C4"}, {"f": "ajibawa-2023/Python-Co... |
hk_map = [['X', 'LRR'],
['F', 'RR'], ['E', 'ai'], ['O', 'au'], ['K', 'kh'], ['G', 'gh'],
['C', 'ch'], ['J', 'jh'], ['W', 'Th'], ['Q', 'Dh'], ['T', 'th'],
['D', 'dh'], ['P', 'ph'], ['B', 'bh'],
['a', 'a'], ['A', 'A'], ['i', 'i'], ['I', 'I'], ['u', 'u'],
['U', 'U'], ... | ajibawa-2023/Python-Code-Large/train/row_98206 | 3 | 35 | 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_98206:Assign_L1_C0", "label": "hk_map =", "type": "assigned_variable", "loc": [1, 12], "level": 0, "parent": null, "vector": [14, 0, 0.1857, 0.3429, 0, 0.66, 0.0, 9, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "hk_map", "arg_names": [], "import_names": [], "rhs_call_name... | [] |
# -*- coding: utf-8 -*-
#the program encodes text between slp1, hk, wx and itrans formats
##Usage Guidelines:
##1) Copy the module to your
## working directory
##2) import Transcode
##3) use the methods as per your need
##
##example: if you have your source byte stream
## in HK translit... | ajibawa-2023/Python-Code-Large/train/row_98207 | 63 | 104 | 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_98207:Import_L18_C0", "label": "pickle import pickle", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.1731, 0.0096, 0, 0.66, 0.0, 848, 0, 1, 0, 0, 848, 0, 0], "semantic": {"name": "pickle", "arg_names": [], "import_names": ["pickle"], ... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98207:FunctionDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98207:If_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98207:If_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98207:Assign_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/trai... |
# -*- coding: utf-8 -*
''' Hare Krsna '''
''' om namo Bhagavate Vasudevaya '''
#to find dictonary entries in the given ver
'''
find the dictonary matches in the MW dictonary
and NITAI VEDA and Glossary
'''
#function to sort the list according to the index
def add_index_tag(in_list,in_string):... | ajibawa-2023/Python-Code-Large/train/row_98208 | 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_98208:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 2], "level": 0, "parent": null, "vector": [8, 0, 0.0247, 0.0123, 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_98208:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98208:Assign_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98208:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98208:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Co... |
#! usr/bin/env python
#-*- coding: UTF-8 -*-
import heapq
import math
def distancia_entre_puntos(x1,x2,y1,y2):
return math.sqrt((x1-y1)**2+(x2-y2)**2)
def dijkstra(grafo, origen, destino=None, p=0):
if origen == destino: return (0, [origen])
distancias = {} # diccionario con las distancias finales
c... | ajibawa-2023/Python-Code-Large/train/row_98209 | 26 | 32 | 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_98209:Import_L3_C0", "label": "heapq import heapq", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0938, 0.0312, 0, 0.66, 0.0, 251, 0, 1, 0, 0, 251, 0, 0], "semantic": {"name": "heapq", "arg_names": [], "import_names": ["heapq"], "rhs_ca... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98209:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98209:Return_L7_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98209:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98209:If_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
#! usr/bin/env python
#-*- coding: UTF-8 -*-
import heapq
import math
def distancia_entre_puntos(x1,x2,y1,y2):
return math.sqrt((x1-y1)**2+(x2-y2)**2)
def dijkstra(grafo, origen, destino=None, p=0):
if origen == destino: return (0, [origen])
distancias = {} # diccionario con las distancias finales
c... | ajibawa-2023/Python-Code-Large/train/row_98210 | 26 | 32 | 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_98210:Import_L3_C0", "label": "heapq import heapq", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0938, 0.0312, 0, 0.66, 0.0, 251, 0, 1, 0, 0, 251, 0, 0], "semantic": {"name": "heapq", "arg_names": [], "import_names": ["heapq"], "rhs_ca... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98210:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98210:Return_L7_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98210:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98210:If_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
#! usr/bin/env python
#-*- coding: UTF-8 -*-
class Vertice(object):
def __init__(self, id, datos):
self.adyacentes = {}
self.datos = datos
self.id = id
def __cmp__(self, otro):
if self.id == otro.id:
return 0
if self.id > otro.id:
return 1
if self.id < otro.id:
return -1
def ver_adyacentes... | ajibawa-2023/Python-Code-Large/train/row_98212 | 59 | 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_98212:ClassDef_L4_C0", "label": "Vertice", "type": "class", "loc": [4, 20], "level": 0, "parent": null, "vector": [3, 0, 0.15, 0.2125, 0, 0.66, 0.0, 519, 0, 3, 0, 0, 186, 0, 1], "semantic": {"name": "Vertice", "arg_names": [], "import_names": [], "rhs_call_name": "", "a... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98212:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98212:FunctionDef_L5_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98212:FunctionDef_L5_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_98212:Assign_L6_C2"}, {"f": "ajibawa-2023/Python-Code... |
#! usr/bin/env python
#-*- coding: UTF-8 -*-
import sys
import grafo
import math
import heapq
def guardar_vertices(archivo, Grafo):
'''Lee la cantidad de lineas equivalente a las intersecciones y
agrega el vértice con el primer campo como id, y el resto como datos'''
linea = archivo.readline()
for i in range (int... | ajibawa-2023/Python-Code-Large/train/row_98213 | 166 | 260 | 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_98213:Import_L4_C0", "label": "sys import sys", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0154, 0.0038, 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_98213:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98213:Expr_L10_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98213:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98213:Assign_L12_C1"}, {"f": "ajibawa-2023/Python-Code-L... |
#! usr/bin/env python
#-*- coding: UTF-8 -*-
import sys
import grafo
import math
import heapq
def guardar_vertices(archivo, Grafo):
'''Lee la cantidad de lineas equivalente a las intersecciones y
agrega el vértice con el primer campo como id, y el resto como datos'''
linea = archivo.readline()
for i in range (int... | ajibawa-2023/Python-Code-Large/train/row_98215 | 166 | 260 | 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_98215:Import_L4_C0", "label": "sys import sys", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0154, 0.0038, 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_98215:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98215:Expr_L10_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98215:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98215:Assign_L12_C1"}, {"f": "ajibawa-2023/Python-Code-L... |
#! usr/bin/env python
#-*- coding: UTF-8 -*-
class Vertice(object):
def __init__(self, id, datos):
self.adyacentes = {}
self.datos = datos
self.id = id
def __cmp__(self, otro):
if self.id == otro.id:
return 0
if self.id > otro.id:
return 1
if self.id < otro.id:
return -1
def ver_adyacentes... | ajibawa-2023/Python-Code-Large/train/row_98216 | 59 | 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_98216:ClassDef_L4_C0", "label": "Vertice", "type": "class", "loc": [4, 20], "level": 0, "parent": null, "vector": [3, 0, 0.15, 0.2125, 0, 0.66, 0.0, 519, 0, 3, 0, 0, 186, 0, 1], "semantic": {"name": "Vertice", "arg_names": [], "import_names": [], "rhs_call_name": "", "a... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98216:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98216:FunctionDef_L5_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98216:FunctionDef_L5_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_98216:Assign_L6_C2"}, {"f": "ajibawa-2023/Python-Code... |
#!/usr/bin/python
'''
@author: Manuel F Martinez <manpaz@bashlinux.com>
@organization: Bashlinux
@copyright: Copyright (c) 2012 Bashlinux
@license: GPL
'''
import Image
import time
from constants import *
from exceptions import *
class Escpos:
""" ESC/POS Printer object """
device = None
def _check_... | ajibawa-2023/Python-Code-Large/train/row_98217 | 167 | 255 | 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_98217:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 7], "level": 0, "parent": null, "vector": [8, 0, 0.0176, 0.0235, 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_98217:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98217:Expr_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98217:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98217:Assign_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large... |
#!/usr/bin/python
'''
@author: Manuel F Martinez <manpaz@bashlinux.com>
@organization: Bashlinux
@copyright: Copyright (c) 2012 Bashlinux
@license: GPL
'''
import usb.core
import usb.util
import serial
import socket
from escpos import *
from constants import *
from exceptions import *
class Usb(Escpos):
""" Defi... | ajibawa-2023/Python-Code-Large/train/row_98218 | 78 | 135 | 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_98218:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 7], "level": 0, "parent": null, "vector": [8, 0, 0.0333, 0.0444, 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_98218:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98218:Expr_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98218:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98218:FunctionDef_L21_C4"}, {"f": "ajibawa-2023/Python-Code-... |
""" ESC/POS Exceptions classes """
import os
class Error(Exception):
""" Base class for ESC/POS errors """
def __init__(self, msg, status=None):
Exception.__init__(self)
self.msg = msg
self.resultcode = 1
if status is not None:
self.resultcode = status
def __st... | ajibawa-2023/Python-Code-Large/train/row_98219 | 54 | 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_98219:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0125, 0.0125, 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_98219:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98219:Expr_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98219:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98219:FunctionDef_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Larg... |
""" ESC/POS Commands (Constants) """
# Feed control sequences
CTL_LF = '\x0a' # Print and line feed
CTL_FF = '\x0c' # Form feed
CTL_CR = '\x0d' # Carriage return
CTL_HT = '\x09' # Horizontal tab
CTL_VT = '\x0b' # Vertical tab
# Printer hardware... | ajibawa-2023/Python-Code-Large/train/row_98220 | 45 | 53 | 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_98220:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0189, 0.0189, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat... | [] |
__all__ = ["constants","escpos","exceptions","printer"]
| ajibawa-2023/Python-Code-Large/train/row_98221 | 1 | 1 | 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_98221:Assign_L1_C0", "label": "__all__ =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 1.0, 1.0, 0, 0.66, 0.0, 272, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "__all__", "arg_names": [], "import_names": [], "rhs_call_name": ... | [] |
#!/usr/bin/env python
# This file is part of django_ip2country.
# django_ip2country is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... | ajibawa-2023/Python-Code-Large/train/row_98222 | 17 | 39 | 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_98222:Import_L18_C0", "label": "urllib import urllib", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.4615, 0.0256, 0, 0.66, 0.0, 614, 0, 1, 0, 0, 614, 0, 0], "semantic": {"name": "urllib", "arg_names": [], "import_names": ["urllib"], ... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98222:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98222:Assign_L26_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98222:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98222:If_L27_C1"}, {"f": "ajibawa-2023/Python-Code-L... |
#!/usr/bin/env python
# This file is part of django_ip2country.
# django_ip2country is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... | ajibawa-2023/Python-Code-Large/train/row_98223 | 32 | 63 | 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_98223:Import_L18_C0", "label": "csv import csv", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.2857, 0.0159, 0, 0.66, 0.0, 312, 0, 1, 0, 0, 312, 0, 0], "semantic": {"name": "csv", "arg_names": [], "import_names": ["csv"], "rhs_call_na... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98223:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98223:If_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98223:If_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98223:Expr_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/... |
# This file is part of django_ip2country.
# django_ip2country is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# dja... | ajibawa-2023/Python-Code-Large/train/row_98224 | 12 | 38 | 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_98224:Import_L17_C0", "label": "bigint_patch import bigint_patch", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.4474, 0.0263, 0, 0.66, 0.0, 521, 0, 1, 0, 0, 521, 0, 0], "semantic": {"name": "bigint_patch", "arg_names": [], "import_na... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98224:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98224:Assign_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98224:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98224:Assign_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
# This file is part of django_ip2country.
# django_ip2country is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# dja... | ajibawa-2023/Python-Code-Large/train/row_98225 | 3 | 20 | 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_98225:ImportFrom_L17_C0", "label": "from django.contrib import admin", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.85, 0.05, 0, 0.66, 0.0, 302, 0, 1, 0, 0, 302, 0, 0], "semantic": {"name": "django.contrib", "arg_names": [], "import_... | [] |
# This file is part of django_ip2country.
# django_ip2country is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# dja... | ajibawa-2023/Python-Code-Large/train/row_98226 | 11 | 32 | 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_98226:ImportFrom_L17_C0", "label": "from django_ip2country.models import Ip2Country", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.5312, 0.0312, 0, 0.66, 0.0, 6, 0, 1, 0, 0, 6, 0, 0], "semantic": {"name": "django_ip2country.models", ... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98226:FunctionDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98226:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98226:FunctionDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98226:Assign_L21_C4"}, {"f": "ajibawa-2023/Python-Co... |
# This file is part of django_ip2country.
# django_ip2country is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# dja... | ajibawa-2023/Python-Code-Large/train/row_98227 | 0 | 14 | 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 file is part of django_ip2country.
# django_ip2country is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# dja... | ajibawa-2023/Python-Code-Large/train/row_98228 | 44 | 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_98228:Expr_L17_C0", "label": "expression", "type": "expression", "loc": [17, 24], "level": 0, "parent": null, "vector": [8, 0, 0.2158, 0.0842, 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_98228:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98228:FunctionDef_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98228:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98228:If_L38_C8"}, {"f": "ajibawa-2023/Python-Code... |
#!/usr/bin/env python
import sys
import os
import datetime
import shutil
import dateutil.tz
if len(sys.argv) != 8:
sys.exit();
srm = str('SRM') + sys.argv[1]
num1 = sys.argv[2]
num2 = sys.argv[3]
num3 = sys.argv[4]
num4 = sys.argv[5]
num5 = sys.argv[6]
num6 = sys.argv[7]
os.mkdir(srm, 0777);
os.chdir(os.getcwd() +... | ajibawa-2023/Python-Code-Large/train/row_98229 | 27 | 36 | 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_98229:Import_L3_C0", "label": "sys import sys", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0833, 0.0278, 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_98229:If_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98229:Expr_L10_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98229:For_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98229:Assign_L26_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_9... |
#!/usr/bin/env python
import sys, os
if os.path.exists('output.txt'):
os.remove('output.txt')
top = './'
fd = open('output.txt', 'w+')
for root, dirs, files in os.walk(top, topdown=False):
for name in dirs:
if name[:-4] == 'Volumn':
fd.write(name + ' has : ')
count = 0
for root, dirs, files in os.... | ajibawa-2023/Python-Code-Large/train/row_98230 | 15 | 20 | 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_98230:Import_L3_C0", "label": "sys import sys, os", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.15, 0.05, 0, 0.66, 0.0, 509, 0, 2, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys", "os"], "rhs_call... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98230:If_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98230:Expr_L6_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98230:For_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98230:For_L12_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98230... |
cnt = int(raw_input())
rectlst=[]
for i in xrange(cnt):
tmplst = []
for k in xrange(3):
input = raw_input()
tmplst.append([int(j) for j in input.split()])
rectlst.append(tmplst)
for i in xrange(cnt):
coor=rectlst[i]
result=[]
center=reduce(lambda a,b:[a[0]+b[0], a[1]+b[1]], coor)
center=[center[0]/3.0,center... | ajibawa-2023/Python-Code-Large/train/row_98231 | 20 | 20 | 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_98231:Assign_L1_C0", "label": "cnt = int()", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.05, 0.05, 0, 0.66, 0.0, 307, 3, 1, 0, 0, 901, 10, 2], "semantic": {"name": "cnt", "arg_names": [], "import_names": [], "rhs_call_name... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98231:For_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98231:Assign_L4_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98231:For_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98231:For_L5_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_9823... |
from Queue import Queue
count = int(raw_input())
class Stack(Queue):
def _get(self):
item = self.queue[-1]
del self.queue[-1]
return item
a = Stack();
b = Stack();
c = Stack();
k=[a,b,c]
def move(src,dest):
k[dest-1].put(k[src-1].get())
if(count<=20):
print src,dest
def other(h1,h2):
t... | ajibawa-2023/Python-Code-Large/train/row_98232 | 30 | 37 | 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_98232:ImportFrom_L1_C0", "label": "from Queue import Queue", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.027, 0.027, 0, 0.66, 0.0, 952, 0, 1, 0, 0, 952, 0, 0], "semantic": {"name": "Queue", "arg_names": [], "import_names": ["Queue"], ... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98232:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98232:FunctionDef_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98232:FunctionDef_L5_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98232:Assign_L6_C8"}, {"f": "ajibawa-2023/Python-Code... |
__author__ = 'changwoncheo'
a0=(0,'zero')
a1=(1,'one')
a2=(2,'two')
a3=(3,'three')
a4=(4,'four')
a5=(5,'five')
a6=(6,'six')
a7=(7,'seven')
a8=(8,'eight')
a9=(9,'nine')
alist = [a0,a1,a2,a3,a4,a5,a6,a7,a8,a9]
biglist =[];
def compareNum(string):
for i in alist:
temp = ''
com = i[1]
l = list(c... | ajibawa-2023/Python-Code-Large/train/row_98233 | 56 | 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_98233:Assign_L1_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.0132, 0.0132, 0, 0.66, 0.0, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98233:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98233:For_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98233:For_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98233:Assign_L16_C8"}, {"f": "ajibawa-2023/Python-Code-Large/tr... |
def sort(_list):
for i in range(len(_list)):
target = _list[i]
for k in range(len(_list)):
if( (k+1) != len(_list)):
if (_list[k] > _list[k+1]):
swap(_list,k,k+1)
else :
k+=1
def printMax(_list):
temp = 0
for i in _list:
if i>temp:
temp = i
print '%.1f'%(temp)
def swap(_list,sindex,d... | ajibawa-2023/Python-Code-Large/train/row_98234 | 38 | 47 | 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_98234:FunctionDef_L1_C0", "label": "sort", "type": "function", "loc": [1, 9], "level": 0, "parent": null, "vector": [2, 0, 0.1064, 0.1915, 0, 0.66, 0.0, 489, 0, 1, 0, 0, 0, 0, 6], "semantic": {"name": "sort", "arg_names": ["_list"], "import_names": [], "rhs_call_name": ... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98234:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98234:For_L2_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98234:For_L2_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_98234:Assign_L3_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/... |
from django.db import models
from django.contrib.auth.models import User
class ProgrammingLanguage(models.Model):
name = models.CharField(max_length=10)
def __unicode__(self):
return u'%s' % self.name
class Classification(models.Model):
name = models.CharField(max_length=35)
uri = models.URLField()
def get... | ajibawa-2023/Python-Code-Large/train/row_98235 | 62 | 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_98235:ImportFrom_L1_C0", "label": "from django.db import models", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0105, 0.0105, 0, 0.66, 0.0, 40, 0, 1, 0, 0, 40, 0, 0], "semantic": {"name": "django.db", "arg_names": [], "import_names": ["... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98235:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98235:Assign_L5_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98235:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98235:FunctionDef_L7_C1"}, {"f": "ajibawa-2023/Python-Code-La... |
"""
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from django.test import TestCase
class SimpleTest(TestCase):
def test_basic_addition(self):
"""
Tests that 1 + 1 a... | ajibawa-2023/Python-Code-Large/train/row_98236 | 6 | 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_98236:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 6], "level": 0, "parent": null, "vector": [8, 0, 0.2188, 0.375, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotati... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98236:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98236:FunctionDef_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98236:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98236:Expr_L13_C8"}, {"f": "ajibawa-2023/Python-Co... |
from algorithm.models import Algorithm
from django import forms
from django.forms import Textarea
class AlgorithmForm(forms.ModelForm):
class Meta:
model = Algorithm
fields = ('name','description','classification')
widgets = {
'description': Textarea(attrs={'cols': 240, 'rows': 10}),
... | ajibawa-2023/Python-Code-Large/train/row_98237 | 13 | 17 | 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_98237:ImportFrom_L1_C0", "label": "from algorithm.models import Algorithm", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0588, 0.0588, 0, 0.66, 0.0, 363, 0, 1, 0, 0, 363, 0, 0], "semantic": {"name": "algorithm.models", "arg_names": [],... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98237:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98237:ClassDef_L6_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98237:ClassDef_L6_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_98237:Assign_L7_C2"}, {"f": "ajibawa-2023/Python-Code-Large... |
from django import forms
class ContactForm(forms.Form):
subject = forms.CharField(max_length=100)
message = forms.CharField(widget=forms.Textarea)
sender = forms.EmailField()
#cc_myself = forms.BooleanField(required=False) | ajibawa-2023/Python-Code-Large/train/row_98238 | 5 | 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_98238:ImportFrom_L1_C0", "label": "from django import forms", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.1429, 0.1429, 0, 0.66, 0.0, 294, 0, 1, 0, 0, 294, 0, 0], "semantic": {"name": "django", "arg_names": [], "import_names": ["forms... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98238:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98238:Assign_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98238:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98238:Assign_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t... |
import os
from algorithm.models import Classification, Implementation, Algorithm, ProgrammingLanguage, Interest, ProeficiencyScale, ProgrammingLanguageProeficiencyScale, ClassificationProeficiencyScale, Question,QuestionAnswer,UserQuestion,ImplementationQuestion,ImplementationQuestionAnswer,UserQuestionAnswer
from ex... | ajibawa-2023/Python-Code-Large/train/row_98239 | 268 | 426 | 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_98239:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0023, 0.0023, 0, 0.66, 0.0, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name": ""... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98239:FunctionDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98239:Assign_L8_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98239:FunctionDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98239:Return_L15_C1"}, {"f": "ajibawa-2023/Python-Code-... |
from django.contrib import admin
from algorithm.models import ProgrammingLanguage, Classification, Algorithm, Implementation, Interest, ProeficiencyScale, ProgrammingLanguageProeficiencyScale, ClassificationProeficiencyScale, Question,QuestionAnswer,UserQuestion,ImplementationQuestion,ImplementationQuestionAnswer,User... | ajibawa-2023/Python-Code-Large/train/row_98240 | 25 | 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_98240:ImportFrom_L1_C0", "label": "from django.contrib import admin", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0303, 0.0303, 0, 0.66, 0.0, 302, 0, 1, 0, 0, 302, 0, 0], "semantic": {"name": "django.contrib", "arg_names": [], "import... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98240:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98240:Assign_L5_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98240:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98240:Assign_L6_C1"}, {"f": "ajibawa-2023/Python-Code-Large/t... |
# Create your views here.
from django.contrib import auth
from django.views.decorators.csrf import csrf_exempt
from django.http import HttpResponse, HttpResponseRedirect
from django.template import Context
from django.template.loader import get_template
from algorithm.models import Classification, Implementation,Algor... | ajibawa-2023/Python-Code-Large/train/row_98241 | 189 | 302 | 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_98241:ImportFrom_L2_C0", "label": "from django.contrib import auth", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0066, 0.0033, 0, 0.66, 0.0, 302, 0, 1, 0, 0, 302, 0, 0], "semantic": {"name": "django.contrib", "arg_names": [], "import_... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98241:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98241:Return_L25_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98241:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98241:Assign_L28_C1"}, {"f": "ajibawa-2023/Python-Co... |
from __future__ import unicode_literals
from django import forms
from django.forms.util import flatatt
from django.template import loader
from django.utils.datastructures import SortedDict
from django.utils.html import format_html, format_html_join
from django.utils.http import int_to_base36
from django.utils.... | ajibawa-2023/Python-Code-Large/train/row_98242 | 40 | 68 | 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_98242:ImportFrom_L1_C0", "label": "from __future__ import unicode_literals", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0147, 0.0147, 0, 0.66, 0.0, 777, 0, 1, 0, 0, 777, 0, 0], "semantic": {"name": "__future__", "arg_names": [], "imp... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98242:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98242:Expr_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98242:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98242:Assign_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large... |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "AlgPedia.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| ajibawa-2023/Python-Code-Large/train/row_98243 | 6 | 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_98243:Import_L2_C0", "label": "os import os", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.2, 0.1, 0, 0.66, 0.0, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name": "", "ann... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98243:If_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98243:Expr_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98243:If_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98243:ImportFrom_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_9... |
from django.db import models
# Create your models here.
| ajibawa-2023/Python-Code-Large/train/row_98245 | 1 | 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"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98245:ImportFrom_L1_C0", "label": "from django.db import models", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.3333, 0.3333, 0, 0.66, 0.0, 40, 0, 1, 0, 0, 40, 0, 0], "semantic": {"name": "django.db", "arg_names": [], "import_names": ["... | [] |
"""
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from django.test import TestCase
class SimpleTest(TestCase):
def test_basic_addition(self):
"""
Tests that 1 + 1 a... | ajibawa-2023/Python-Code-Large/train/row_98246 | 6 | 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_98246:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 6], "level": 0, "parent": null, "vector": [8, 0, 0.2188, 0.375, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotati... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98246:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98246:FunctionDef_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98246:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98246:Expr_L13_C8"}, {"f": "ajibawa-2023/Python-Co... |
'''
Created on 20/02/2013
@author: Pericolo
'''
from DBPediaQueryFetcher import QueryFetcher
from FileWriters import TXTWriter
import os
from algorithm.models import Classification
class ColumnExtractor:
def __init__(self, file_name):
self.file_name = file_name
def extractColumn(self, col... | ajibawa-2023/Python-Code-Large/train/row_98249 | 38 | 87 | 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_98249:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0345, 0.0575, 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_98249:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98249:FunctionDef_L16_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98249:FunctionDef_L16_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_98249:Assign_L17_C2"}, {"f": "ajibawa-2023/Python-... |
class CSVColumnExtractor:
def __init__(self, file_name):
self.file_name = file_name
def extract_column(self, column_index):
F_H = open(self.file_name, 'r')
lines = F_H.readlines()
F_H.close()
column = map(lambda x: x.split(';')[column_index], lines)
return column | ajibawa-2023/Python-Code-Large/train/row_98251 | 9 | 14 | 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_98251:ClassDef_L1_C0", "label": "CSVColumnExtractor", "type": "class", "loc": [1, 14], "level": 0, "parent": null, "vector": [3, 0, 0.5357, 1.0, 0, 0.66, 0.0, 877, 0, 2, 0, 0, 0, 0, 5], "semantic": {"name": "CSVColumnExtractor", "arg_names": [], "import_names": [], "rhs... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98251:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98251:FunctionDef_L2_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98251:FunctionDef_L2_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_98251:Assign_L3_C2"}, {"f": "ajibawa-2023/Python-Code... |
# Create your views here.
| ajibawa-2023/Python-Code-Large/train/row_98254 | 0 | 1 | 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"] | [] | [] |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "AlgPedia.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| ajibawa-2023/Python-Code-Large/train/row_98255 | 6 | 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_98255:Import_L2_C0", "label": "os import os", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.2, 0.1, 0, 0.66, 0.0, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name": "", "ann... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98255:If_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98255:Expr_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98255:If_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98255:ImportFrom_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_9... |
from django.conf.urls import patterns, include, url
from django.contrib.auth.views import login, logout
from algorithm.views import *
#show_main_page, sync_database, clear_database, show_all_classifications, show_classification_by_id
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
... | ajibawa-2023/Python-Code-Large/train/row_98256 | 6 | 38 | 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_98256:ImportFrom_L1_C0", "label": "from django.conf.urls import patterns, include, url", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0263, 0.0263, 0, 0.66, 0.0, 528, 0, 3, 0, 0, 528, 0, 0], "semantic": {"name": "django.conf.urls", "ar... | [] |
# Django settings for AlgPedia project.
import os
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'AlgPedia',
'USER': 'root',
'PASSWORD': '',
'HOST': '127.0.0.1', # Empty... | ajibawa-2023/Python-Code-Large/train/row_98257 | 38 | 187 | 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_98257:Import_L3_C0", "label": "os import os", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.016, 0.0053, 0, 0.66, 0.0, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name": "",... | [] |
"""
WSGI config for AlgPedia project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION``... | ajibawa-2023/Python-Code-Large/train/row_98258 | 5 | 32 | 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_98258:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 15], "level": 0, "parent": null, "vector": [8, 0, 0.25, 0.4688, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotati... | [] |
import sys
f = open(sys.argv[2], "w")
out = sys.argv[3] + "<<-c("+','.join(open(sys.argv[1]).read().split("\n"))+")"
f.write(out[:-2]+')')
f.close() | ajibawa-2023/Python-Code-Large/train/row_98259 | 5 | 8 | 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_98259:Import_L2_C0", "label": "sys import sys", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.25, 0.125, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "... | [] |
#!/usr/bin/env python
# Copyright (c) 2009, Prashanth Ellina
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice,... | ajibawa-2023/Python-Code-Large/train/row_98260 | 230 | 430 | 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_98260:Import_L27_C0", "label": "os import os", "type": "import", "loc": [27, 27], "level": 0, "parent": null, "vector": [1, 0, 0.0628, 0.0023, 0, 0.66, 0.0, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name":... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98260:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98260:If_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98260:If_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98260:Expr_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/... |
#!/usr/bin/env python
# Copyright (c) 2009, Prashanth Ellina
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice,... | ajibawa-2023/Python-Code-Large/train/row_98261 | 230 | 430 | 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_98261:Import_L27_C0", "label": "os import os", "type": "import", "loc": [27, 27], "level": 0, "parent": null, "vector": [1, 0, 0.0628, 0.0023, 0, 0.66, 0.0, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name":... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98261:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98261:If_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98261:If_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98261:Expr_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/... |
import sys
import os
import re
def getQ(fin, query, N_dom):
qseq = ''
miss = False
for line in fin:
if miss == False:
if re.match("(>%s)\sD(%d).*Query: start\s(\d+)\send\s(\d+).*\n(.*)" %(query,int(N_dom)), line):
Qid = re.match("(>%s)\sD(%d).*Query: start\s(\d+)\send\s(\d+).*\n(.*)" %(query, ... | ajibawa-2023/Python-Code-Large/train/row_98262 | 84 | 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_98262:Import_L1_C0", "label": "sys import sys", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0105, 0.0105, 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_98262:FunctionDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98262:Assign_L7_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98262:FunctionDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98262:Assign_L8_C1"}, {"f": "ajibawa-2023/Python-Code-L... |
#!/usr/bin/env python
##########################
# FASTA PARCER #
# prints fasfa file #
# for domain hit #
# match. Optional #
# matching parameters #
# allow for parameter #
# specific domain hit #
# results. Options #
# allow for creation #
# of summary and #
# detail d... | ajibawa-2023/Python-Code-Large/train/row_98263 | 223 | 285 | 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_98263:Import_L27_C0", "label": "sys import sys", "type": "import", "loc": [27, 27], "level": 0, "parent": null, "vector": [1, 0, 0.0947, 0.0035, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_na... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98263:FunctionDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98263:Assign_L35_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98263:FunctionDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98263:For_L36_C1"}, {"f": "ajibawa-2023/Python-Code-... |
#!/usr/bin/env python
##########################
# FASTA PARCER #
# prints fasfa file #
# for domain hit #
# match. Optional #
# matching parameters #
# allow for parameter #
# specific domain hit #
# results. Options #
# allow for creation #
# of summary and #
# detail d... | ajibawa-2023/Python-Code-Large/train/row_98264 | 223 | 285 | 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_98264:Import_L27_C0", "label": "sys import sys", "type": "import", "loc": [27, 27], "level": 0, "parent": null, "vector": [1, 0, 0.0947, 0.0035, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_na... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98264:FunctionDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98264:Assign_L35_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98264:FunctionDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98264:For_L36_C1"}, {"f": "ajibawa-2023/Python-Code-... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.