code
stringlengths
1
1.49M
file_id
stringlengths
42
46
node_count
int64
0
7.38k
total_lines
int64
1
20.9k
vector_dim
int64
15
15
vector_labels
stringclasses
1 value
nodes
stringlengths
2
3.75M
connections
stringlengths
2
964k
def test(t): t = "O"+t print t test("K")
ajibawa-2023/Python-Code-Large/train/row_89420
4
4
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_89420:FunctionDef_L1_C0", "label": "test", "type": "function", "loc": [1, 3], "level": 0, "parent": null, "vector": [2, 0, 0.5, 0.75, 0, 0.66, 0.0, 224, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "test", "arg_names": ["t"], "import_names": [], "rhs_call_name": "", "anno...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_89420:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89420:Assign_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89420:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89420:Expr_L3_C4"}]
print str.lower("Hello") x = [4,5,0] list.sort(x) print x
ajibawa-2023/Python-Code-Large/train/row_89421
4
4
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_89421:Expr_L1_C0", "label": "print()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.25, 0.25, 0, 0.66, 0.0, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "an...
[]
def test(a,b): return a+b print test(1,1)+test(1,1)
ajibawa-2023/Python-Code-Large/train/row_89422
3
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_89422:FunctionDef_L1_C0", "label": "test", "type": "function", "loc": [1, 2], "level": 0, "parent": null, "vector": [2, 0, 0.5, 0.6667, 0, 0.66, 0.0, 224, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "test", "arg_names": ["a", "b"], "import_names": [], "rhs_call_name": ""...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_89422:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89422:Return_L2_C4"}]
def wee(): print "from wee" def waa(): print "from waa" def woo(): print "from woo" def blorp(): print "from blorp"
ajibawa-2023/Python-Code-Large/train/row_89423
8
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_89423:FunctionDef_L1_C0", "label": "wee", "type": "function", "loc": [1, 2], "level": 0, "parent": null, "vector": [2, 0, 0.1875, 0.25, 0, 0.66, 0.0, 48, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "wee", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_89423:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89423:Expr_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89423:FunctionDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89423:Expr_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large...
x = 1 while x < 3: break x = x + 1 print x
ajibawa-2023/Python-Code-Large/train/row_89424
4
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_89424:Assign_L1_C0", "label": "x =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.2, 0.2, 0, 0.66, 0.0, 190, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_89424:While_L2_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89424:Assign_L4_C4"}]
print min(3,8,2,6)
ajibawa-2023/Python-Code-Large/train/row_89425
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_89425:Expr_L1_C0", "label": "print()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 1.0, 1.0, 0, 0.66, 0.0, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "anno...
[]
a = (1,2,3) b = ('a', 'b', 'c') for x in a+b: print x print "a:",a print "b:",b
ajibawa-2023/Python-Code-Large/train/row_89426
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_89426:Assign_L1_C0", "label": "a =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.1667, 0.1667, 0, 0.66, 0.0, 475, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "a", "arg_names": [], "import_names": [], "rhs_call_name": "", "a...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_89426:For_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89426:Expr_L4_C4"}]
x = 5 x &= 7 print x
ajibawa-2023/Python-Code-Large/train/row_89427
2
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_89427:Assign_L1_C0", "label": "x =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.3333, 0.3333, 0, 0.66, 0.0, 190, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "a...
[]
print [] or 5
ajibawa-2023/Python-Code-Large/train/row_89428
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_89428:Expr_L1_C0", "label": "print()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 1.0, 1.0, 0, 0.66, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "anno...
[]
print object.__bases__ print object.__mro__ class X(object): pass class Y(X): pass print(X.__bases__) print(X.__mro__) print(Y.__bases__) print(Y.__mro__)
ajibawa-2023/Python-Code-Large/train/row_89429
8
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_89429:Expr_L1_C0", "label": "print()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.125, 0.125, 0, 0.66, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "...
[]
print str(range(0,5,3))[:5] print len(range(0,5,3)) print range(0,5,3)[0] print range(0,5,3)[1] print range(0,5,3)[-1]
ajibawa-2023/Python-Code-Large/train/row_89430
5
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_89430:Expr_L1_C0", "label": "print()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.2, 0.2, 0, 0.66, 0.0, 535, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "anno...
[]
print "abc"[1.5]
ajibawa-2023/Python-Code-Large/train/row_89431
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_89431:Expr_L1_C0", "label": "print()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 1.0, 1.0, 0, 0.66, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "anno...
[]
print repr((1,2,3)) print repr([1,2,3]) print repr({1:'ok', 2:'stuff'}) print repr("weewaa")
ajibawa-2023/Python-Code-Large/train/row_89432
4
4
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_89432:Expr_L1_C0", "label": "print()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.25, 0.25, 0, 0.66, 0.0, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "an...
[]
print "xOK"[1:]
ajibawa-2023/Python-Code-Large/train/row_89433
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_89433:Expr_L1_C0", "label": "print()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 1.0, 1.0, 0, 0.66, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "anno...
[]
from t279_sub import wee, blorp wee() blorp() from t279_sub import waa as woo woo()
ajibawa-2023/Python-Code-Large/train/row_89434
5
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_89434:ImportFrom_L1_C0", "label": "from t279_sub import wee, blorp", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.1667, 0.1667, 0, 0.66, 0.0, 130, 0, 2, 0, 0, 130, 0, 0], "semantic": {"name": "t279_sub", "arg_names": [], "import_names"...
[]
x = [0]*10 for i in range(10): x[i] += i x[i] += i*2 print x
ajibawa-2023/Python-Code-Large/train/row_89435
3
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_89435:Assign_L1_C0", "label": "x =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.1429, 0.1429, 0, 0.66, 0.0, 190, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "a...
[]
big = 0x1234567890abcdef12345L # 21 hex digits print "'%x'" % big print "'%x'" % -big print "'%5x'" % -big print "'%22x'" % -big print "'%23x'" % -big print "'%-23x'" % -big print "'%023x'" % -big print "'%-023x'" % -big print "'%025x'" % -big print "'%025x'" % big print "'%0+25x'" % big print "'%+25x'" % big print "'...
ajibawa-2023/Python-Code-Large/train/row_89436
32
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_89436:Expr_L1_C0", "label": "print()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0286, 0.0286, 0, 0.66, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print",...
[]
def test(): global x x = "OK" test() print x
ajibawa-2023/Python-Code-Large/train/row_89437
4
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_89437:FunctionDef_L1_C0", "label": "test", "type": "function", "loc": [1, 3], "level": 0, "parent": null, "vector": [2, 0, 0.4, 0.6, 0, 0.66, 0.0, 224, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "test", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotati...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_89437:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89437:Assign_L3_C4"}]
def f(a, b, **c): sortc = [(x,y) for x,y in c.items()] sortc.sort() print a, b, sortc f(1, 2, d=4, e=5) f(1, b=4, e=5) f(a=1, b=4, e=5, f=6, g=7)
ajibawa-2023/Python-Code-Large/train/row_89438
7
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_89438:FunctionDef_L1_C0", "label": "f", "type": "function", "loc": [1, 4], "level": 0, "parent": null, "vector": [2, 0, 0.3125, 0.5, 0, 0.66, 0.0, 899, 0, 3, 0, 0, 0, 0, 3], "semantic": {"name": "f", "arg_names": ["a", "b", "c"], "import_names": [], "rhs_call_name": "",...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_89438:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89438:Assign_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89438:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89438:Expr_L3_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
big = 012345670123456701234567012345670L # 32 octal digits print "'%o'" % big print "'%o'" % -big print "'%5o'" % -big print "'%33o'" % -big print "'%34o'" % -big print "'%-34o'" % -big print "'%034o'" % -big print "'%-034o'" % -big print "'%036o'" % -big print "'%036o'" % big print "'%0+36o'" % big print "'%+36o'" % ...
ajibawa-2023/Python-Code-Large/train/row_89439
33
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_89439:Expr_L1_C0", "label": "print()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0256, 0.0256, 0, 0.66, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print",...
[]
x=1 if x == 1: print "yes"
ajibawa-2023/Python-Code-Large/train/row_89440
3
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_89440:Assign_L1_C0", "label": "x =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.3333, 0.3333, 0, 0.66, 0.0, 190, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "a...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_89440:If_L2_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89440:Expr_L3_C4"}]
print 123456 print 12345678987654321567 print repr(12345678987654321567)
ajibawa-2023/Python-Code-Large/train/row_89441
3
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_89441:Expr_L1_C0", "label": "print()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.3333, 0.3333, 0, 0.66, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print",...
[]
x = 2 x ^= 7 print x
ajibawa-2023/Python-Code-Large/train/row_89442
2
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_89442:Assign_L1_C0", "label": "x =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.3333, 0.3333, 0, 0.66, 0.0, 190, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "a...
[]
def domul(a,b): return a*b print domul(10, 123456789876543) print domul(876543234567, 123456789876543) print domul(-876543234567, 123456789876543) print domul(-876543234567, -123456789876543) print domul(876543234567, -123456789876543) print domul(876543234567, 10) print domul(876543234567, -10)
ajibawa-2023/Python-Code-Large/train/row_89443
9
9
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_89443:FunctionDef_L1_C0", "label": "domul", "type": "function", "loc": [1, 2], "level": 0, "parent": null, "vector": [2, 0, 0.1667, 0.2222, 0, 0.66, 0.0, 945, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "domul", "arg_names": ["a", "b"], "import_names": [], "rhs_call_name...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_89443:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89443:Return_L2_C4"}]
class A: def __init__(self): print "at0" self.a = 'O' self.b = 'x' def test(self): print "KO" class B(A): def __init__(self): print "at1" A.__init__(self) self.b = 'K' def test(self): print self.a + self.b print "at2" B().test() print "at3"...
ajibawa-2023/Python-Code-Large/train/row_89444
17
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_89444:ClassDef_L1_C0", "label": "A", "type": "class", "loc": [1, 7], "level": 0, "parent": null, "vector": [3, 0, 0.2353, 0.4118, 0, 0.66, 0.0, 429, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "A", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": "...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_89444:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89444:FunctionDef_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89444:FunctionDef_L2_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_89444:Expr_L3_C8"}, {"f": "ajibawa-2023/Python-Code-L...
var1 = "foo" if isinstance(var1, str): print "var1 is a string"
ajibawa-2023/Python-Code-Large/train/row_89445
3
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_89445:Assign_L1_C0", "label": "var1 =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.3333, 0.3333, 0, 0.66, 0.0, 897, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "var1", "arg_names": [], "import_names": [], "rhs_call_name": ...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_89445:If_L2_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89445:Expr_L3_C4"}]
# Test set unions # sets are un-ordered, though python seems to sort them sometimes... # hence the testing for equality to known sets rather than printing. s = set([2,3,4]) t = set([4,5,6]) u = set([1,2,3,4,5]) print s print t print u print '# pair unions' a = s.union(t) b = s.union(u) c = t.union(s) d = t.union(u) e =...
ajibawa-2023/Python-Code-Large/train/row_89446
33
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_89446:Assign_L4_C0", "label": "s = set()", "type": "assigned_variable", "loc": [4, 4], "level": 0, "parent": null, "vector": [14, 0, 0.1026, 0.0256, 0, 0.66, 0.0, 553, 3, 1, 0, 0, 21, 10, 1], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name"...
[]
if "x" is "x" or "y" is "y": print "OK"
ajibawa-2023/Python-Code-Large/train/row_89447
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"]
[]
[]
class Stuff: def __init__(self): self.modes = { 'wee': self.things } self.modes['wee']() def things(self): print "OK" Stuff()
ajibawa-2023/Python-Code-Large/train/row_89448
7
9
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_89448:ClassDef_L1_C0", "label": "Stuff", "type": "class", "loc": [1, 8], "level": 0, "parent": null, "vector": [3, 0, 0.5, 0.8889, 0, 0.66, 0.0, 710, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "Stuff", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotatio...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_89448:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89448:FunctionDef_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89448:FunctionDef_L2_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_89448:Assign_L3_C8"}, {"f": "ajibawa-2023/Python-Code...
for i in "skulpt": print i
ajibawa-2023/Python-Code-Large/train/row_89449
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"]
[]
[]
print int print float print int(3.0) print float(3)
ajibawa-2023/Python-Code-Large/train/row_89450
4
4
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_89450:Expr_L1_C0", "label": "print()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.25, 0.25, 0, 0.66, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "an...
[]
class X: pass x = X() print x.__class__ print str(x.__class__) print repr(x.__class__)
ajibawa-2023/Python-Code-Large/train/row_89451
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_89451:ClassDef_L1_C0", "label": "X", "type": "class", "loc": [1, 2], "level": 0, "parent": null, "vector": [3, 0, 0.2143, 0.2857, 0, 0.66, 0.0, 783, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "X", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": "...
[]
a = (1 for x in range(3)) print a for i in a: print i
ajibawa-2023/Python-Code-Large/train/row_89452
4
4
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_89452:Assign_L1_C0", "label": "a =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.25, 0.25, 0, 0.66, 0.0, 475, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "a", "arg_names": [], "import_names": [], "rhs_call_name": "", "annot...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_89452:For_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89452:Expr_L4_C4"}]
a = 1, print a
ajibawa-2023/Python-Code-Large/train/row_89453
2
2
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_89453:Assign_L1_C0", "label": "a =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.5, 0.5, 0, 0.66, 0.0, 475, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "a", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[]
x = {'a':'OK'} print x['a']
ajibawa-2023/Python-Code-Large/train/row_89454
2
2
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_89454:Assign_L1_C0", "label": "x =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.5, 0.5, 0, 0.66, 0.0, 190, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[]
x = 'OK', print x[0]
ajibawa-2023/Python-Code-Large/train/row_89455
2
2
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_89455:Assign_L1_C0", "label": "x =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.5, 0.5, 0, 0.66, 0.0, 190, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[]
print "%s:%r:%d:%x" % ("dog", "cat", 23456, 999999999999L)
ajibawa-2023/Python-Code-Large/train/row_89456
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"]
[]
[]
def stuff(n): print not n for x in range(-5, 5): stuff(x)
ajibawa-2023/Python-Code-Large/train/row_89457
4
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_89457:FunctionDef_L1_C0", "label": "stuff", "type": "function", "loc": [1, 2], "level": 0, "parent": null, "vector": [2, 0, 0.3, 0.4, 0, 0.66, 0.0, 686, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "stuff", "arg_names": ["n"], "import_names": [], "rhs_call_name": "", "ann...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_89457:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89457:Expr_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89457:For_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89457:Expr_L5_C4"}]
def f(): for i in 1,2,3,4,5: if i == 3: break yield i print list(f())
ajibawa-2023/Python-Code-Large/train/row_89458
5
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_89458:FunctionDef_L1_C0", "label": "f", "type": "function", "loc": [1, 4], "level": 0, "parent": null, "vector": [2, 0, 0.5, 0.8, 0, 0.66, 0.0, 899, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": "...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_89458:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89458:For_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89458:For_L2_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_89458:If_L3_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_...
print 2e9 print 2e10 print 1e9 print 1e10 print 1e8 print 1e7
ajibawa-2023/Python-Code-Large/train/row_89459
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_89459:Expr_L1_C0", "label": "print()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.1667, 0.1667, 0, 0.66, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print",...
[]
big = 123456789012345678901234567890L print "'%d'" % big print "'%d'" % -big print "'%5d'" % -big print "'%31d'" % -big print "'%32d'" % -big print "'%-32d'" % -big print "'%032d'" % -big print "'%-032d'" % -big print "'%034d'" % -big print "'%034d'" % big print "'%0+34d'" % big print "'%+34d'" % big print "'%34d'" % b...
ajibawa-2023/Python-Code-Large/train/row_89460
17
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_89460:Expr_L1_C0", "label": "print()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0588, 0.0588, 0, 0.66, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print",...
[]
class Stuff: def __init__(self): self.a = 0 self.b = 'b' self.c = [1,2,3] self.d = 100000000000000 s = Stuff() s.a += 10 s.b += 'dog' s.c += [9,10] s.d += 10000 print s.a print s.b print s.c print s.d
ajibawa-2023/Python-Code-Large/train/row_89461
11
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_89461:ClassDef_L1_C0", "label": "Stuff", "type": "class", "loc": [1, 6], "level": 0, "parent": null, "vector": [3, 0, 0.2059, 0.3529, 0, 0.66, 0.0, 710, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "Stuff", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_89461:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89461:FunctionDef_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89461:FunctionDef_L2_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_89461:Assign_L3_C8"}, {"f": "ajibawa-2023/Python-Code...
s='abcd' print s[::2]
ajibawa-2023/Python-Code-Large/train/row_89462
2
2
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_89462:Assign_L1_C0", "label": "s =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.5, 0.5, 0, 0.66, 0.0, 553, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[]
print False and False or False print False or False and False
ajibawa-2023/Python-Code-Large/train/row_89463
2
2
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_89463:Expr_L1_C0", "label": "print()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.5, 0.5, 0, 0.66, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "anno...
[]
print [x*x for x in range(20) if x > 10 if x % 2 == 0]
ajibawa-2023/Python-Code-Large/train/row_89464
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_89464:Expr_L1_C0", "label": "print()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 1.0, 1.0, 0, 0.66, 0.0, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "anno...
[]
print "+%s+" % "hello" print "+%d+" % 10 print "%c" % "a" print '%c' % 34 print '%c' % 36 print '%d' % 10 print '%c' % 0x7f
ajibawa-2023/Python-Code-Large/train/row_89465
7
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_89465:Expr_L1_C0", "label": "print()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.1429, 0.1429, 0, 0.66, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print",...
[]
a = range(17) del a[::3] print a a = range(16) del a[::3] print a a = range(17) del a[::2] print a a = range(16) del a[::2] print a
ajibawa-2023/Python-Code-Large/train/row_89467
8
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_89467:Assign_L1_C0", "label": "a = range()", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.0833, 0.0833, 0, 0.66, 0.0, 475, 3, 1, 0, 0, 816, 10, 1], "semantic": {"name": "a", "arg_names": [], "import_names": [], "rhs_call_na...
[]
print 2+3
ajibawa-2023/Python-Code-Large/train/row_89468
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_89468:Expr_L1_C0", "label": "print()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 1.0, 1.0, 0, 0.66, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "anno...
[]
print 7 in {1:2,'a':7}
ajibawa-2023/Python-Code-Large/train/row_89469
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_89469:Expr_L1_C0", "label": "print()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 1.0, 1.0, 0, 0.66, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "anno...
[]
def test(): return x = 1 print test()
ajibawa-2023/Python-Code-Large/train/row_89470
4
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_89470:FunctionDef_L1_C0", "label": "test", "type": "function", "loc": [1, 1], "level": 0, "parent": null, "vector": [2, 0, 0.3333, 0.3333, 0, 0.66, 0.0, 224, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "test", "arg_names": [], "import_names": [], "rhs_call_name": "", "an...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_89470:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89470:Return_L1_C12"}]
if 0 == 1: print "X" elif 1 == 1: print "OK" else: print "Y"
ajibawa-2023/Python-Code-Large/train/row_89471
5
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_89471:If_L1_C0", "label": "if", "type": "if", "loc": [1, 6], "level": 0, "parent": null, "vector": [4, 0, 0.5833, 1.0, 0, 0.66, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet":...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_89471:If_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89471:Expr_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89471:If_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89471:If_L3_C0"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89471:If_...
print type(1) print type(2**10) print type(2**1024) print type("wee")
ajibawa-2023/Python-Code-Large/train/row_89472
4
4
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_89472:Expr_L1_C0", "label": "print()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.25, 0.25, 0, 0.66, 0.0, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "an...
[]
print str(range(-4,-8,-1))[:5] print len(range(-4,-8,-1)) print range(-4,-8,-1)[0] print range(-4,-8,-1)[1] print range(-4,-8,-1)[-1]
ajibawa-2023/Python-Code-Large/train/row_89473
5
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_89473:Expr_L1_C0", "label": "print()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.2, 0.2, 0, 0.66, 0.0, 535, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "anno...
[]
t = [[y*10+x for x in range(0,10)] for y in range(0,10)] print t[2][3]
ajibawa-2023/Python-Code-Large/train/row_89474
2
2
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_89474:Assign_L1_C0", "label": "t =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.5, 0.5, 0, 0.66, 0.0, 15, 5, 0, 0, 0, 0, 0, 2], "semantic": {"name": "t", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotati...
[]
# using obj[token] in JS doesn't work as a generic string dict # make sure to use *both* hasOwnProperty and then get it, otherwise object # builtins will return existence. def toString(): print "wee" class stuff: def toString(self): return "waa" def valueOf(self): return "stuff" toString()...
ajibawa-2023/Python-Code-Large/train/row_89475
11
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_89475:FunctionDef_L4_C0", "label": "toString", "type": "function", "loc": [4, 5], "level": 0, "parent": null, "vector": [2, 0, 0.2812, 0.125, 0, 0.66, 0.0, 661, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "toString", "arg_names": [], "import_names": [], "rhs_call_name": ...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_89475:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89475:Expr_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89475:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89475:FunctionDef_L8_C4"}, {"f": "ajibawa-2023/Python-Code-L...
print [5]*10 print [1,2,3]*4 print (5,)*10 print (1,2,3)*4 print 10*[5] print 4*[1,2,3] print 10*(5,) print 4*(1,2,3)
ajibawa-2023/Python-Code-Large/train/row_89476
8
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_89476:Expr_L1_C0", "label": "print()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.125, 0.125, 0, 0.66, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "...
[]
x="OK" print x
ajibawa-2023/Python-Code-Large/train/row_89477
2
2
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_89477:Assign_L1_C0", "label": "x =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.5, 0.5, 0, 0.66, 0.0, 190, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[]
print 2 in [1,2,3]
ajibawa-2023/Python-Code-Large/train/row_89478
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_89478:Expr_L1_C0", "label": "print()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 1.0, 1.0, 0, 0.66, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "anno...
[]
import goog.graphics as gfx import goog.dom as dom def main(): g = gfx.createSimpleGraphics(600, 200) print g fill = gfx.SolidFill('yellow') stroke = gfx.Stroke(2, 'green') g.drawRect(30, 10, 100, 80, stroke, fill) stroke = gfx.Stroke(4, 'green') g.drawImage(30, 110, 276, 110, 'http://www...
ajibawa-2023/Python-Code-Large/train/row_89480
28
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_89480:Import_L1_C0", "label": "goog.graphics import gfx", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0256, 0.0256, 0, 0.66, 0.0, 78, 0, 1, 0, 0, 78, 0, 0], "semantic": {"name": "goog.graphics", "arg_names": [], "import_names": ["gfx"...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_89480:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89480:Assign_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89480:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89480:Expr_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
y = 1
ajibawa-2023/Python-Code-Large/train/row_89481
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_89481:Assign_L1_C0", "label": "y =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 1.0, 1.0, 0, 0.66, 0.0, 304, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat...
[]
print x+2*3
ajibawa-2023/Python-Code-Large/train/row_89482
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_89482:Expr_L1_C0", "label": "print()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 1.0, 1.0, 0, 0.66, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "anno...
[]
def f(): n = "OK" print n f()
ajibawa-2023/Python-Code-Large/train/row_89483
4
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_89483:FunctionDef_L1_C0", "label": "f", "type": "function", "loc": [1, 4], "level": 0, "parent": null, "vector": [2, 0, 0.4167, 0.6667, 0, 0.66, 0.0, 899, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotati...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_89483:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89483:Assign_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89483:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89483:Expr_L4_C4"}]
print '0"1' print '2\'3' print "4'5" print "6\"7" print '''8'9"0'''
ajibawa-2023/Python-Code-Large/train/row_89484
5
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_89484:Expr_L1_C0", "label": "print()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.2, 0.2, 0, 0.66, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "anno...
[]
import ast import sys def astppdump(node): def _format(node, indent): #print node, len(indent) if isinstance(node, ast.AST): namelen = " "*(len(node.__class__.__name__)) + " " fields = [] for a,b in ast.iter_fields(node): fieldlen = len(a)*" " ...
ajibawa-2023/Python-Code-Large/train/row_89485
22
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_89485:Import_L1_C0", "label": "ast import ast", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.037, 0.037, 0, 0.66, 0.0, 809, 0, 1, 0, 0, 809, 0, 0], "semantic": {"name": "ast", "arg_names": [], "import_names": ["ast"], "rhs_call_name": ...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_89485:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89485:FunctionDef_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89485:FunctionDef_L5_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_89485:If_L7_C8"}, {"f": "ajibawa-2023/Python-Code-...
#! /usr/bin/env python """Token constants (from "token.h").""" # Taken from Python (r53757) and modified to include some tokens # originally monkeypatched in by pgen2.tokenize #--start constants-- ENDMARKER = 0 NAME = 1 NUMBER = 2 STRING = 3 NEWLINE = 4 INDENT = 5 DEDENT = 6 LPAR = 7 RPAR = 8 LSQB = 9 RSQB = 10 C...
ajibawa-2023/Python-Code-Large/train/row_89487
69
82
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_89487:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0366, 0.0122, 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_89487:For_L70_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89487:If_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89487:If_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_89487:Assign_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89...
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 Python Software Foundation. # All rights reserved. """Tokenization help for Python programs. generate_tokens(readline) is a generator that breaks a stream of text into Python tokens. It accepts a readline-like method which is called repeatedly to get the next line o...
ajibawa-2023/Python-Code-Large/train/row_89488
256
477
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_89488:Expr_L4_C0", "label": "expression", "type": "expression", "loc": [4, 26], "level": 0, "parent": null, "vector": [8, 0, 0.0314, 0.0482, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_89488:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89488:Return_L41_C21"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89488:FunctionDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89488:Return_L42_C19"}, {"f": "ajibawa-2023/Python-...
# Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. # Pgen imports import grammar, token, tokenize class PgenGrammar(grammar.Grammar): pass class ParserGenerator(object): def __init__(self, filename, stream=None): close_stream = None ...
ajibawa-2023/Python-Code-Large/train/row_89489
273
384
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_89489:Import_L5_C0", "label": "grammar import grammar, token, tokenize", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.013, 0.0026, 0, 0.66, 0.0, 260, 0, 3, 0, 0, 260, 0, 0], "semantic": {"name": "grammar", "arg_names": [], "import_name...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_89489:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89489:FunctionDef_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89489:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_89489:Assign_L13_C8"}, {"f": "ajibawa-2023/Python-...
# Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """This module defines the data structures used to represent a grammar. These are a bit arcane because they are derived from the data structures used by Python's 'pgen' parser generator. There's also ...
ajibawa-2023/Python-Code-Large/train/row_89490
49
202
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_89490:Expr_L4_C0", "label": "expression", "type": "expression", "loc": [4, 13], "level": 0, "parent": null, "vector": [8, 0, 0.0421, 0.0495, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_89490:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89490:Expr_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89490:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89490:FunctionDef_L76_C4"}, {"f": "ajibawa-2023/Python-Code-...
#! /usr/bin/env python """Generate JS code from an ASDL description.""" # TO DO # handle fields that have a type but no name import os, sys import asdl TABSIZE = 4 MAX_COL = 80 def get_c_type(name): """Return a string for the C name of the type. This function special cases the default types provided by as...
ajibawa-2023/Python-Code-Large/train/row_89492
251
391
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_89492:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 2], "level": 0, "parent": null, "vector": [8, 0, 0.0051, 0.0026, 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_89492:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89492:Expr_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89492:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89492:If_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
__author__ = 'bmiller' def testEqual(actual, expected): if type(expected) == type(1): if actual == expected: print('Pass') return True elif type(expected) == type(1.11): if abs(actual-expected) < 0.00001: print('Pass') return True else: ...
ajibawa-2023/Python-Code-Large/train/row_89494
16
21
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_89494:Assign_L1_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.0476, 0.0476, 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_89494:FunctionDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89494:If_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89494:If_L4_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_89494:If_L5_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89...
s = """Gur Mra bs Clguba, ol Gvz Crgref Ornhgvshy vf orggre guna htyl. Rkcyvpvg vf orggre guna vzcyvpvg. Fvzcyr vf orggre guna pbzcyrk. Pbzcyrk vf orggre guna pbzcyvpngrq. Syng vf orggre guna arfgrq. Fcnefr vf orggre guna qrafr. Ernqnovyvgl pbhagf. Fcrpvny pnfrf nera'g fcrpvny rabhtu gb oernx gur ehyrf. Nygubhtu cenpg...
ajibawa-2023/Python-Code-Large/train/row_89496
6
28
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_89496:Assign_L1_C0", "label": "s =", "type": "assigned_variable", "loc": [1, 21], "level": 0, "parent": null, "vector": [14, 0, 0.3929, 0.75, 0, 0.66, 0.0, 553, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name": "", "an...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_89496:For_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89496:For_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89496:For_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_89496:Assign_L26_C8"}]
# JSLint doesn't allow/support disabling the requirement for braces around # blocks, and that's one uglification I refuse to perform in the service of a # lint. # # There are of course lots of other intelligent things JSLint has to say # because it's just too easy in JS to do something that (e.g.) IE won't like. # So, ...
ajibawa-2023/Python-Code-Large/train/row_89497
42
77
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_89497:ImportFrom_L14_C0", "label": "from subprocess import Popen, PIPE", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.1818, 0.013, 0, 0.66, 0.0, 394, 0, 2, 0, 0, 394, 0, 0], "semantic": {"name": "subprocess", "arg_names": [], "import...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_89497:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89497:If_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89497:If_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_89497:Return_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/trai...
# San Angeles Observation # Original C version Copyright 2004-2005 Jetro Lauha # Web: http://iki.fi/jetro/ # # BSD-license. # # Javascript version by Ken Waters # Skulpt (Python) version by Scott Graham import webgl ShapeParams = [ # m a b n1 n2 n3 m a b n1 n2 n3 res1...
ajibawa-2023/Python-Code-Large/train/row_89498
270
500
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_89498:Import_L10_C0", "label": "webgl import webgl", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.02, 0.002, 0, 0.66, 0.0, 201, 0, 1, 0, 0, 201, 0, 0], "semantic": {"name": "webgl", "arg_names": [], "import_names": ["webgl"], "rhs_ca...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_89498:ClassDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89498:FunctionDef_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89498:FunctionDef_L39_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_89498:Assign_L40_C8"}, {"f": "ajibawa-2023/Python-...
from google.appengine.ext import webapp from google.appengine.ext.webapp.util import run_wsgi_app import os from django.utils import simplejson from google.appengine.ext import db class MainPage(webapp.RequestHandler): def get(self): self.response.headers['Content-Type'] = 'text/html' path = os.pat...
ajibawa-2023/Python-Code-Large/train/row_89499
46
61
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_89499:ImportFrom_L1_C0", "label": "from google.appengine.ext import webapp", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0164, 0.0164, 0, 0.66, 0.0, 167, 0, 1, 0, 0, 167, 0, 0], "semantic": {"name": "google.appengine.ext", "arg_names"...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_89499:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89499:FunctionDef_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89499:FunctionDef_L8_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_89499:Assign_L9_C8"}, {"f": "ajibawa-2023/Python-Code...
import sys import webgl import webgl.primitives import webgl.models import webgl.matrix4 as m4 def main(): print "Starting up..." gl = webgl.Context("canvas") sh = webgl.Shader(gl, VertexShader, FragmentShader) sh.use() m = webgl.models.Model(sh, webgl.primitives.createCube(1), []) eyePos...
ajibawa-2023/Python-Code-Large/train/row_89500
43
85
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_89500:Import_L1_C0", "label": "sys import sys", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0118, 0.0118, 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_89500:FunctionDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89500:Expr_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89500:FunctionDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89500:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
""" quick hack script to convert from quake2 .bsp to simple format to draw. drops most information. keeps only raw polys and lightmaps. makes .blv and .llv file (big and little endian level) file format is 'BLV1' or 'LLV1' int texwidth int texheight int numtris float startx, starty, s...
ajibawa-2023/Python-Code-Large/train/row_89501
116
214
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_89501:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 30], "level": 0, "parent": null, "vector": [8, 0, 0.0724, 0.1402, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_89501:FunctionDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89501:Return_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89501:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89501:Expr_L40_C4"}, {"f": "ajibawa-2023/Python-Code...
#==================================================================== # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you ...
ajibawa-2023/Python-Code-Large/train/row_89502
38
74
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_89502:Import_L26_C0", "label": "os import os", "type": "import", "loc": [26, 26], "level": 0, "parent": null, "vector": [1, 0, 0.3514, 0.0135, 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_89502:FunctionDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89502:Assign_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89502:FunctionDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89502:For_L37_C4"}, {"f": "ajibawa-2023/Python-Code-...
import rope.base.oi.soi from rope.base import pynames from rope.base.pynames import * class AssignedName(pynames.AssignedName): def __init__(self, lineno=None, module=None, pyobject=None): self.lineno = lineno self.module = module self.assignments = [] self.pyobject = _Inferred(se...
ajibawa-2023/Python-Code-Large/train/row_89504
38
55
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_89504:Import_L1_C0", "label": "rope.base.oi.soi import rope.base.oi.soi", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0182, 0.0182, 0, 0.66, 0.0, 666, 0, 1, 0, 0, 666, 0, 0], "semantic": {"name": "rope.base.oi.soi", "arg_names": [], "...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_89504:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89504:FunctionDef_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89504:FunctionDef_L8_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_89504:Assign_L9_C8"}, {"f": "ajibawa-2023/Python-Code...
from rope.base import exceptions, change, taskhandle class History(object): """A class that holds project history""" def __init__(self, project, maxundos=None): self.project = project self._undo_list = [] self._redo_list = [] self._maxundos = maxundos self._load_histor...
ajibawa-2023/Python-Code-Large/train/row_89505
155
235
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_89505:ImportFrom_L1_C0", "label": "from rope.base import exceptions, change, taskhandle", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0043, 0.0043, 0, 0.66, 0.0, 632, 0, 3, 0, 0, 632, 0, 0], "semantic": {"name": "rope.base", "arg_name...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_89505:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89505:Expr_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89505:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89505:FunctionDef_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Larg...
import bisect import keyword import rope.base.simplify def get_name_at(resource, offset): source_code = resource.read() word_finder = Worder(source_code) return word_finder.get_word_at(offset) class Worder(object): """A class for finding boundaries of words and expressions Note that in these m...
ajibawa-2023/Python-Code-Large/train/row_89506
393
524
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_89506:Import_L1_C0", "label": "bisect import bisect", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0019, 0.0019, 0, 0.66, 0.0, 325, 0, 1, 0, 0, 325, 0, 0], "semantic": {"name": "bisect", "arg_names": [], "import_names": ["bisect"], "rh...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_89506:FunctionDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89506:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89506:FunctionDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89506:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-L...
import bisect import difflib import sys import warnings import rope.base.oi.doa import rope.base.oi.objectinfo import rope.base.oi.soa from rope.base import ast, exceptions, taskhandle, utils, stdmods from rope.base.exceptions import ModuleNotFoundError from rope.base.pyobjectsdef import PyModule, PyPackage, PyClass i...
ajibawa-2023/Python-Code-Large/train/row_89507
282
410
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_89507:Import_L1_C0", "label": "bisect import bisect", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0024, 0.0024, 0, 0.66, 0.0, 325, 0, 1, 0, 0, 325, 0, 0], "semantic": {"name": "bisect", "arg_names": [], "import_names": ["bisect"], "rh...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_89507:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89507:FunctionDef_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89507:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_89507:Assign_L20_C8"}, {"f": "ajibawa-2023/Python-...
import UserDict class ObjectDB(object): def __init__(self, db, validation): self.db = db self.validation = validation self.observers = [] self.files = db.files def validate_files(self): for file in list(self.files): if not self.validation.is_file_valid(fil...
ajibawa-2023/Python-Code-Large/train/row_89508
108
175
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_89508:Import_L1_C0", "label": "UserDict import UserDict", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0057, 0.0057, 0, 0.66, 0.0, 351, 0, 1, 0, 0, 351, 0, 0], "semantic": {"name": "UserDict", "arg_names": [], "import_names": ["UserDic...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_89508:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89508:FunctionDef_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89508:FunctionDef_L6_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_89508:Assign_L7_C8"}, {"f": "ajibawa-2023/Python-Code...
"""Provides classes for persisting `PyObject`\s""" import os import re import rope.base.builtins from rope.base import exceptions class PyObjectToTextual(object): """For transforming `PyObject` to textual form This can be used for storing `PyObjects` in files. Use `TextualToPyObject` for converting bac...
ajibawa-2023/Python-Code-Large/train/row_89509
203
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_89509:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0035, 0.0035, 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_89509:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89509:Expr_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89509:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89509:FunctionDef_L17_C4"}, {"f": "ajibawa-2023/Python-Code-La...
"""A module for inferring objects For more information see the documentation in `rope.base.oi` package. """ import rope.base.builtins import rope.base.pynames import rope.base.pyobjects from rope.base import evaluate, utils, arguments _ignore_inferred = utils.ignore_exception( rope.base.pyobjects.IsBeingInferre...
ajibawa-2023/Python-Code-Large/train/row_89510
134
186
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_89510:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 6], "level": 0, "parent": null, "vector": [8, 0, 0.0188, 0.0323, 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_89510:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89510:Expr_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89510:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89510:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code...
def __rope_start_everything(): import os import sys import socket import cPickle as pickle import marshal import inspect import types import threading class _MessageSender(object): def send_data(self, data): pass class _SocketSender(_MessageSender): ...
ajibawa-2023/Python-Code-Large/train/row_89511
152
211
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_89511:FunctionDef_L2_C0", "label": "__rope_start_everything", "type": "function", "loc": [2, 207], "level": 0, "parent": null, "vector": [2, 0, 0.4953, 0.9763, 0, 0.66, 0.0, 940, 0, 0, 1, 0, 0, 0, 84], "semantic": {"name": "__rope_start_everything", "arg_names": [], "im...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_89511:FunctionDef_L2_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89511:Import_L3_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89511:FunctionDef_L2_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89511:Import_L4_C4"}, {"f": "ajibawa-2023/Python-Code-L...
"""Rope object analysis and inference package Rope makes some simplifying assumptions about a python program. It assumes that a program only performs assignments and function calls. Tracking assignments is simple and `PyName` objects handle that. The main problem is function calls. Rope uses these two approaches fo...
ajibawa-2023/Python-Code-Large/train/row_89512
1
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_89512:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 38], "level": 0, "parent": null, "vector": [8, 0, 0.5132, 1.0, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotatio...
[]
from rope.base.oi import objectdb class MemoryDB(objectdb.FileDict): def __init__(self, project, persist=None): self.project = project self._persist = persist self.files = self self._load_files() self.project.data_files.add_write_hook(self.write) def _load_files(self)...
ajibawa-2023/Python-Code-Large/train/row_89513
67
106
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_89513:ImportFrom_L1_C0", "label": "from rope.base.oi import objectdb", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0094, 0.0094, 0, 0.66, 0.0, 897, 0, 1, 0, 0, 897, 0, 0], "semantic": {"name": "rope.base.oi", "arg_names": [], "import_...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_89513:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89513:FunctionDef_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89513:FunctionDef_L6_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_89513:Assign_L7_C8"}, {"f": "ajibawa-2023/Python-Code...
import warnings from rope.base import exceptions, resourceobserver from rope.base.oi import objectdb, memorydb, transform class ObjectInfoManager(object): """Stores object information It uses an instance of `objectdb.ObjectDB` for storing information. """ def __init__(self, project): s...
ajibawa-2023/Python-Code-Large/train/row_89514
174
232
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_89514:Import_L1_C0", "label": "warnings import warnings", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0043, 0.0043, 0, 0.66, 0.0, 358, 0, 1, 0, 0, 358, 0, 0], "semantic": {"name": "warnings", "arg_names": [], "import_names": ["warning...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_89514:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89514:Expr_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89514:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89514:FunctionDef_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
import rope.base.ast import rope.base.oi.soi import rope.base.pynames from rope.base import pyobjects, evaluate, astutils, arguments def analyze_module(pycore, pymodule, should_analyze, search_subscopes, followed_calls): """Analyze `pymodule` for static object inference Analyzes scopes for...
ajibawa-2023/Python-Code-Large/train/row_89516
97
136
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_89516:Import_L1_C0", "label": "rope.base.ast import rope.base.ast", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0074, 0.0074, 0, 0.66, 0.0, 442, 0, 1, 0, 0, 442, 0, 0], "semantic": {"name": "rope.base.ast", "arg_names": [], "import_na...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_89516:FunctionDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89516:Expr_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89516:FunctionDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89516:Expr_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Larg...
# The default ``config.py`` def set_prefs(prefs): """This function is called before opening the project""" # Specify which files and folders to ignore in the project. # Changes to ignored resources are not added to the history and # VCSs. Also they are not returned in `Project.get_files()`. # No...
ajibawa-2023/Python-Code-Large/train/row_89517
19
85
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_89517:FunctionDef_L4_C0", "label": "set_prefs", "type": "function", "loc": [4, 80], "level": 0, "parent": null, "vector": [2, 0, 0.4941, 0.9059, 0, 0.66, 0.0, 770, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "set_prefs", "arg_names": ["prefs"], "import_names": [], "rhs_c...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_89517:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89517:Expr_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89517:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89517:Assign_L16_C4"}, {"f": "ajibawa-2023/Python-Code-La...
from rope.base import ast def get_name_levels(node): """Return a list of ``(name, level)`` tuples for assigned names The `level` is `None` for simple assignments and is a list of numbers for tuple assignments for example in:: a, (b, c) = x The levels for for `a` is ``[0]``, for `b` is ``[1, 0...
ajibawa-2023/Python-Code-Large/train/row_89518
37
61
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_89518:ImportFrom_L1_C0", "label": "from rope.base import ast", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0164, 0.0164, 0, 0.66, 0.0, 632, 0, 1, 0, 0, 632, 0, 0], "semantic": {"name": "rope.base", "arg_names": [], "import_names": ["a...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_89518:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89518:Expr_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89518:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89518:Assign_L16_C4"}, {"f": "ajibawa-2023/Python-Code-La...
"""A module to ease code analysis This module is here to help source code analysis. """ import re from rope.base import codeanalyze, utils @utils.cached(7) def real_code(source): """Simplify `source` for analysis It replaces: * comments with spaces * strs with a new str filled with spaces * im...
ajibawa-2023/Python-Code-Large/train/row_89519
28
55
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_89519:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0455, 0.0727, 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_89519:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89519:Expr_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89519:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89519:Assign_L24_C4"}, {"f": "ajibawa-2023/Python-Code...
"""Project file system commands. This modules implements file system operations used by rope. Different version control systems can be supported by implementing the interface provided by `FileSystemCommands` class. See `SubversionCommands` and `MercurialCommands` for example. """ import os import shutil import subp...
ajibawa-2023/Python-Code-Large/train/row_89520
173
267
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_89520:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 8], "level": 0, "parent": null, "vector": [8, 0, 0.0169, 0.03, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotatio...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_89520:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89520:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89520:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89520:Assign_L16_C4"}, {"f": "ajibawa-2023/Python-Co...
from rope.base.fscommands import _decode_data from rope.base import ast, exceptions, utils class PyObject(object): def __init__(self, type_): if type_ is None: type_ = self self.type = type_ def get_attributes(self): if self.type is self: return {} ret...
ajibawa-2023/Python-Code-Large/train/row_89521
182
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_89521:ImportFrom_L1_C0", "label": "from rope.base.fscommands import _decode_data", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0032, 0.0032, 0, 0.66, 0.0, 851, 0, 1, 0, 0, 851, 0, 0], "semantic": {"name": "rope.base.fscommands", "arg_...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_89521:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89521:FunctionDef_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89521:FunctionDef_L7_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_89521:If_L8_C8"}, {"f": "ajibawa-2023/Python-Code-Lar...
import os class ResourceObserver(object): """Provides the interface for observing resources `ResourceObserver`\s can be registered using `Project. add_observer()`. But most of the time `FilteredResourceObserver` should be used. `ResourceObserver`\s report all changes passed to them and they don...
ajibawa-2023/Python-Code-Large/train/row_89522
180
271
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_89522:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0037, 0.0037, 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_89522:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89522:Expr_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89522:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89522:FunctionDef_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
"""A few useful functions for using rope as a library""" import os.path import rope.base.project import rope.base.pycore from rope.base import taskhandle def path_to_resource(project, path, type=None): """Get the resource at path You only need to specify `type` if `path` does not exist. It can be eithe...
ajibawa-2023/Python-Code-Large/train/row_89523
42
65
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_89523:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0154, 0.0154, 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_89523:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89523:Expr_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89523:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89523:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-L...
import rope.base.evaluate from rope.base import ast class Arguments(object): """A class for evaluating parameters passed to a function You can use the `create_arguments` factory. It handles implicit first arguments. """ def __init__(self, args, scope): self.args = args self.sco...
ajibawa-2023/Python-Code-Large/train/row_89524
74
109
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_89524:Import_L1_C0", "label": "rope.base.evaluate import rope.base.evaluate", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0092, 0.0092, 0, 0.66, 0.0, 790, 0, 1, 0, 0, 790, 0, 0], "semantic": {"name": "rope.base.evaluate", "arg_names":...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_89524:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89524:Expr_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89524:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89524:FunctionDef_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Lar...
import os import sys from rope.base import utils def _stdlib_path(): import distutils.sysconfig return distutils.sysconfig.get_python_lib(standard_lib=True) @utils.cached(1) def standard_modules(): return python_modules() | dynload_modules() @utils.cached(1) def python_modules(): result = set() ...
ajibawa-2023/Python-Code-Large/train/row_89526
30
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_89526:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.025, 0.025, 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_89526:FunctionDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89526:Import_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89526:FunctionDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89526:Return_L9_C4"}, {"f": "ajibawa-2023/Python-Code-L...
import warnings from rope.base import exceptions class TaskHandle(object): def __init__(self, name='Task', interrupts=True): """Construct a TaskHandle If `interrupts` is `False` the task won't be interrupted by calling `TaskHandle.stop()`. """ self.name = name s...
ajibawa-2023/Python-Code-Large/train/row_89527
76
133
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_89527:Import_L1_C0", "label": "warnings import warnings", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0075, 0.0075, 0, 0.66, 0.0, 358, 0, 1, 0, 0, 358, 0, 0], "semantic": {"name": "warnings", "arg_names": [], "import_names": ["warning...
[{"f": "ajibawa-2023/Python-Code-Large/train/row_89527:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89527:FunctionDef_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89527:FunctionDef_L8_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_89527:Expr_L9_C8"}, {"f": "ajibawa-2023/Python-Code-L...
"""This module trys to support builtin types and functions.""" import inspect import rope.base.evaluate from rope.base import pynames, pyobjects, arguments, utils, ast class BuiltinModule(pyobjects.AbstractModule): def __init__(self, name, pycore=None, initial={}): super(BuiltinModule, self).__init__() ...
ajibawa-2023/Python-Code-Large/train/row_89528
511
767
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_89528:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0013, 0.0013, 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_89528:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89528:FunctionDef_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89528:FunctionDef_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_89528:Expr_L11_C8"}, {"f": "ajibawa-2023/Python-Cod...