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 |
|---|---|---|---|---|---|---|---|
print slice(1,2,3)
| ajibawa-2023/Python-Code-Large/train/row_97052 | 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_97052: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... | [] |
class Stuff(object):
def __cmp__(self, rhs):
print "stuff cmp"
return 0
class Things(object):
def __cmp__(self, rhs):
print "things cmp"
return 0
class Other(object): pass
Stuff() < Things()
Stuff() <= Things()
Stuff() > Things()
Stuff() >= Things()
Stuff() == Things()
Stuff()... | ajibawa-2023/Python-Code-Large/train/row_97053 | 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_97053:ClassDef_L1_C0", "label": "Stuff", "type": "class", "loc": [1, 4], "level": 0, "parent": null, "vector": [3, 0, 0.0641, 0.1026, 0, 0.66, 0.0, 710, 0, 1, 0, 0, 186, 0, 1], "semantic": {"name": "Stuff", "arg_names": [], "import_names": [], "rhs_call_name": "", "anno... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97053:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97053:FunctionDef_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97053:FunctionDef_L2_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97053:Expr_L3_C8"}, {"f": "ajibawa-2023/Python-Code-L... |
print 2**3
| ajibawa-2023/Python-Code-Large/train/row_97054 | 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_97054: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 yrange(n):
for i in range(n):
yield i
print list(yrange(5))
| ajibawa-2023/Python-Code-Large/train/row_97055 | 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_97055:FunctionDef_L1_C0", "label": "yrange", "type": "function", "loc": [1, 3], "level": 0, "parent": null, "vector": [2, 0, 0.5, 0.75, 0, 0.66, 0.0, 187, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "yrange", "arg_names": ["n"], "import_names": [], "rhs_call_name": "", "... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97055:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97055:For_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97055:For_L2_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97055:Expr_L3_C8"}] |
print 2^7
| ajibawa-2023/Python-Code-Large/train/row_97056 | 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_97056: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... | [] |
class X: pass
print repr(X())
print str(X())
| ajibawa-2023/Python-Code-Large/train/row_97057 | 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_97057:ClassDef_L1_C0", "label": "X", "type": "class", "loc": [1, 1], "level": 0, "parent": null, "vector": [3, 0, 0.3333, 0.3333, 0, 0.66, 0.0, 783, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "X", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": "... | [] |
print ord(chr(128))
| ajibawa-2023/Python-Code-Large/train/row_97058 | 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_97058: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, 3], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "anno... | [] |
class O(object): pass
class F(O): pass
class E(O): pass
class D(O): pass
class C(D,F): pass
class B(E,D): pass
class A(B,C): pass
print A.__mro__
| ajibawa-2023/Python-Code-Large/train/row_97059 | 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_97059:ClassDef_L1_C0", "label": "O", "type": "class", "loc": [1, 1], "level": 0, "parent": null, "vector": [3, 0, 0.125, 0.125, 0, 0.66, 0.0, 720, 0, 0, 0, 0, 186, 0, 0], "semantic": {"name": "O", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": "... | [] |
print int(3)
print int(3.2)
print int(3.8)
print int(-3.2)
print int(-3.8)
print int(013)
print int(0x13)
print "------"
print int("3")
print int("013")
print "------"
print int("13", 8)
print int("013", 8)
print "------"
print int("13", 0)
print int("013", 0)
print int("0x13", 0)
print "------"
print int("13", 16)
pri... | ajibawa-2023/Python-Code-Large/train/row_97060 | 19 | 19 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97060:Expr_L1_C0", "label": "print()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0526, 0.0526, 0, 0.66, 0.0, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print",... | [] |
x = ["hello"]
y = list(x)
x[0] = "hi"
print y[0]
| ajibawa-2023/Python-Code-Large/train/row_97061 | 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_97061:Assign_L1_C0", "label": "x =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.25, 0.25, 0, 0.66, 0.0, 190, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annot... | [] |
print ord('X')
| ajibawa-2023/Python-Code-Large/train/row_97062 | 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_97062: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 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_97063 | 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_97063: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 [x for x in range(1,10) if False] or ["hello" for x in range(1,10) if True]
| ajibawa-2023/Python-Code-Large/train/row_97064 | 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_97064: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, 3], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "anno... | [] |
x="OK";print x
| ajibawa-2023/Python-Code-Large/train/row_97065 | 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 test(x,y):
return x+y
r = test(3,5)
print r
| ajibawa-2023/Python-Code-Large/train/row_97066 | 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_97066:FunctionDef_L1_C0", "label": "test", "type": "function", "loc": [1, 2], "level": 0, "parent": null, "vector": [2, 0, 0.375, 0.5, 0, 0.66, 0.0, 224, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "test", "arg_names": ["x", "y"], "import_names": [], "rhs_call_name": "",... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97066:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97066:Return_L2_C4"}] |
def default_outside(x=[]):
return x
a = default_outside()
a.append(1)
print a
b = default_outside()
b.append(2)
print b
| ajibawa-2023/Python-Code-Large/train/row_97067 | 8 | 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_97067:FunctionDef_L1_C0", "label": "default_outside", "type": "function", "loc": [1, 2], "level": 0, "parent": null, "vector": [2, 0, 0.1667, 0.2222, 0, 0.66, 0.0, 862, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "default_outside", "arg_names": ["x"], "import_names": [],... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97067:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97067:Return_L2_C4"}] |
def func():
return "dog"
def wee():
assert 1 != 2
assert "dog" == func()
wee()
| ajibawa-2023/Python-Code-Large/train/row_97068 | 4 | 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_97068:FunctionDef_L1_C0", "label": "func", "type": "function", "loc": [1, 2], "level": 0, "parent": null, "vector": [2, 0, 0.2143, 0.2857, 0, 0.66, 0.0, 856, 0, 0, 1, 0, 0, 0, 0], "semantic": {"name": "func", "arg_names": [], "import_names": [], "rhs_call_name": "", "an... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97068:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97068:Return_L2_C4"}] |
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_97069 | 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_97069: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",... | [] |
def a():
x = "OK"
print x
del x
print "after"
a()
| ajibawa-2023/Python-Code-Large/train/row_97070 | 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_97070:FunctionDef_L1_C0", "label": "a", "type": "function", "loc": [1, 5], "level": 0, "parent": null, "vector": [2, 0, 0.5, 0.8333, 0, 0.66, 0.0, 475, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "a", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97070:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97070:Assign_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97070:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97070:Expr_L3_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
import sys
print [x.replace("\\", "/") for x in sys.argv]
| ajibawa-2023/Python-Code-Large/train/row_97071 | 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_97071:Import_L1_C0", "label": "sys import sys", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.5, 0.5, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", ... | [] |
print range(10)[slice(0, 5, 2)]
| ajibawa-2023/Python-Code-Large/train/row_97072 | 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_97072: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, 3], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "anno... | [] |
print [y for x in range(10) for y in range(x)]
| ajibawa-2023/Python-Code-Large/train/row_97073 | 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_97073: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, 3], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "anno... | [] |
print [x*y for x in range(1,10) for y in range(1,x) if y%2 == 0]
| ajibawa-2023/Python-Code-Large/train/row_97074 | 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_97074: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, 3], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "anno... | [] |
class Stuff:
def __init__(self):
self.x = lambda: self.things()
def things(self):
print "OK"
y = Stuff()
y.x()
| ajibawa-2023/Python-Code-Large/train/row_97075 | 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_97075:ClassDef_L1_C0", "label": "Stuff", "type": "class", "loc": [1, 5], "level": 0, "parent": null, "vector": [3, 0, 0.4286, 0.7143, 0, 0.66, 0.0, 710, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "Stuff", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97075:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97075:FunctionDef_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97075:FunctionDef_L2_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97075:Assign_L3_C8"}, {"f": "ajibawa-2023/Python-Code... |
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_97076 | 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_97076: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... | [] |
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_97077 | 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_97077: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... | [] |
s = set([2,3,4])
t = set([3,4,5])
u = set([1,3,5])
print s
s.intersection_update(t)
u.intersection_update(t)
print s
print u
print s == set([3, 4])
print u == set([3, 5])
t.intersection_update(s, u)
print t
print t == set([3])
| ajibawa-2023/Python-Code-Large/train/row_97078 | 13 | 19 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97078:Assign_L1_C0", "label": "s = set()", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.0526, 0.0526, 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_97079 | 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"] | [] | [] |
a = 4
def test(z):
for i in range(0,a):
z += i
return z
print test(1)
| ajibawa-2023/Python-Code-Large/train/row_97080 | 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_97080: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, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "a", "arg_names": [], "import_names": [], "rhs_call_name": "", "a... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97080:FunctionDef_L2_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97080:For_L3_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97080:FunctionDef_L2_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97080:Return_L5_C4"}] |
print 123456
print 12345678987654321567
print repr(12345678987654321567)
| ajibawa-2023/Python-Code-Large/train/row_97081 | 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_97081: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",... | [] |
class X: pass
x = X()
print getattr(x, 'wee', 14)
print getattr(X, 'doggy', 'OK')
| ajibawa-2023/Python-Code-Large/train/row_97082 | 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_97082:ClassDef_L1_C0", "label": "X", "type": "class", "loc": [1, 1], "level": 0, "parent": null, "vector": [3, 0, 0.25, 0.25, 0, 0.66, 0.0, 783, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "X", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, ... | [] |
x=4
x|=1
print x
| ajibawa-2023/Python-Code-Large/train/row_97083 | 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_97083: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... | [] |
# Test the comparison of sets
print '# actual super & subsets'
sup = set([1,2,3,4,100])
print sup
sub = set([2,3,4])
print sub
print '# forwards'
print sup.isdisjoint(sub)
print sup > sub
print sup.issuperset(sub)
print sup >= sub
print sup == sub
print sup != sub
print sup.issubset(sub)
print sup <= sub
print sup ... | ajibawa-2023/Python-Code-Large/train/row_97084 | 25 | 30 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97084:Expr_L3_C0", "label": "print()", "type": "expression", "loc": [3, 3], "level": 0, "parent": null, "vector": [8, 0, 0.1, 0.0333, 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... | [] |
class X:
x = 4
x = X()
stuff = x.x
print stuff
things = X.x
print things
| ajibawa-2023/Python-Code-Large/train/row_97085 | 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_97085:ClassDef_L1_C0", "label": "X", "type": "class", "loc": [1, 2], "level": 0, "parent": null, "vector": [3, 0, 0.1875, 0.25, 0, 0.66, 0.0, 783, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "X", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97085:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97085:Assign_L2_C4"}] |
print type(4)
print type(444444444444444444444)
print type(4.5)
| ajibawa-2023/Python-Code-Large/train/row_97086 | 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_97086: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, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print",... | [] |
x = 1
while x < 3:
break
x = x + 1
print x
| ajibawa-2023/Python-Code-Large/train/row_97087 | 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_97087: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_97087:While_L2_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97087:Assign_L4_C4"}] |
x=4
x=x*3
print x
| ajibawa-2023/Python-Code-Large/train/row_97088 | 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_97088: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... | [] |
s = set([2,3,4])
t = set([3,4,5])
u = set([1,3,5])
a = s.intersection(t)
b = u.intersection(s)
c = u.intersection(t)
print a
print b
print c
print a == set([3, 4])
print b == set([3])
print c == set([3, 5])
d = s.intersection(t, u)
print d
print d == set([3])
| ajibawa-2023/Python-Code-Large/train/row_97089 | 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_97089:Assign_L1_C0", "label": "s = set()", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.05, 0.05, 0, 0.66, 0.0, 553, 3, 1, 0, 0, 21, 10, 1], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name": "s... | [] |
print "imported modc"
stuff = 942
things = "squirrel"
| ajibawa-2023/Python-Code-Large/train/row_97090 | 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_97090: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",... | [] |
print 2e9
print 2e10
print 1e9
print 1e10
print 1e8
print 1e7
| ajibawa-2023/Python-Code-Large/train/row_97091 | 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_97091: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",... | [] |
print str(range(-8,-4))[:5]
print len(range(-8,-4))
print range(-8,-4)[0]
print range(-8,-4)[1]
print range(-8,-4)[-1]
| ajibawa-2023/Python-Code-Large/train/row_97092 | 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_97092: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... | [] |
class A: pass
a = A()
print isinstance([], list)
print isinstance([], dict)
print isinstance([], str)
print isinstance([], tuple)
print isinstance([], A)
print "---"
print isinstance({}, list)
print isinstance({}, dict)
print isinstance({}, str)
print isinstance({}, tuple)
print isinstance({}, A)
print "---"
print i... | ajibawa-2023/Python-Code-Large/train/row_97093 | 32 | 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_97093:ClassDef_L1_C0", "label": "A", "type": "class", "loc": [1, 1], "level": 0, "parent": null, "vector": [3, 0, 0.027, 0.027, 0, 0.66, 0.0, 429, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "A", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}... | [] |
x = ('OK',)
print(x[0])
| ajibawa-2023/Python-Code-Large/train/row_97094 | 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_97094: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... | [] |
def test(y='K',x='Z'): print(x+y)
test('O')
| ajibawa-2023/Python-Code-Large/train/row_97095 | 3 | 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_97095:FunctionDef_L1_C0", "label": "test", "type": "function", "loc": [1, 1], "level": 0, "parent": null, "vector": [2, 0, 0.5, 0.5, 0, 0.66, 0.0, 224, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "test", "arg_names": ["y", "x"], "import_names": [], "rhs_call_name": "", "... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97095:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97095:Expr_L1_C23"}] |
print 7^2|4
| ajibawa-2023/Python-Code-Large/train/row_97096 | 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_97096: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... | [] |
x = 'OK',
print x[0]
| ajibawa-2023/Python-Code-Large/train/row_97097 | 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_97097: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... | [] |
x = {'a':'OK'}
print x['a']
| ajibawa-2023/Python-Code-Large/train/row_97098 | 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_97098: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... | [] |
a = ()
print a
| ajibawa-2023/Python-Code-Large/train/row_97099 | 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_97099: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... | [] |
a = 1,
print a
| ajibawa-2023/Python-Code-Large/train/row_97100 | 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_97100: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... | [] |
print "abc"[1.5]
| ajibawa-2023/Python-Code-Large/train/row_97101 | 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_97101: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... | [] |
class Stuff:
def __init__(self):
def tmp():
self.things()
self.x = tmp
def things(self):
print "OK"
y = Stuff()
y.x()
| ajibawa-2023/Python-Code-Large/train/row_97102 | 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_97102:ClassDef_L1_C0", "label": "Stuff", "type": "class", "loc": [1, 7], "level": 0, "parent": null, "vector": [3, 0, 0.4444, 0.7778, 0, 0.66, 0.0, 710, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "Stuff", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97102:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97102:FunctionDef_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97102:FunctionDef_L2_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97102:FunctionDef_L3_C8"}, {"f": "ajibawa-2023/Python... |
print "1,2,3".split(",").index("3")
| ajibawa-2023/Python-Code-Large/train/row_97103 | 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_97103: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, 3], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "anno... | [] |
n = 0
for x in range(0,10,2):
n += 1
print n
| ajibawa-2023/Python-Code-Large/train/row_97104 | 3 | 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_97104:Assign_L1_C0", "label": "n =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.25, 0.25, 0, 0.66, 0.0, 773, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "n", "arg_names": [], "import_names": [], "rhs_call_name": "", "annot... | [] |
# to avoid constant-izing in python compiler
def doadd(a,b):
return a+b
def dosub(a,b):
return a-b
print doadd(123, 12345678987654321)
print doadd(-123, 12345678987654321)
print doadd(-123, -12345678987654321)
print doadd(123, -12345678987654321)
print dosub(123, 12345678987654321)
print dosub(12345678987654321... | ajibawa-2023/Python-Code-Large/train/row_97105 | 12 | 13 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97105:FunctionDef_L2_C0", "label": "doadd", "type": "function", "loc": [2, 3], "level": 0, "parent": null, "vector": [2, 0, 0.1923, 0.1538, 0, 0.66, 0.0, 313, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "doadd", "arg_names": ["a", "b"], "import_names": [], "rhs_call_name... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97105:FunctionDef_L2_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97105:Return_L3_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97105:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97105:Return_L5_C4"}] |
print 3,4,5
| ajibawa-2023/Python-Code-Large/train/row_97106 | 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_97106: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, 3, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "anno... | [] |
print False == None
if not None:
print "This statement evaluates to True."
if None:
print "This statement evaluates to False."
| ajibawa-2023/Python-Code-Large/train/row_97107 | 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_97107: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",... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97107:If_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97107:Expr_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97107:If_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97107:Expr_L6_C4"}] |
# Test the behaviour of sets
l = [1,2,3,4,1,1]
print l
s = set(l)
print s
# Test the addition and removal of items of a clone set
t = set(s)
print len(t), t
print len(s), s
t.add(100)
print len(t), t
print len(s), s
t.discard(2)
print len(t), t
print len(s), s
| ajibawa-2023/Python-Code-Large/train/row_97108 | 13 | 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_97108:Assign_L2_C0", "label": "l =", "type": "assigned_variable", "loc": [2, 2], "level": 0, "parent": null, "vector": [14, 0, 0.125, 0.0625, 0, 0.66, 0.0, 810, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "l", "arg_names": [], "import_names": [], "rhs_call_name": "", "an... | [] |
# test list comparisons
l = [1,2,3,1]
print l
print l > l
print l >= l
print l == l
print l != l
print l <= l
print l < l
| ajibawa-2023/Python-Code-Large/train/row_97109 | 8 | 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_97109:Assign_L2_C0", "label": "l =", "type": "assigned_variable", "loc": [2, 2], "level": 0, "parent": null, "vector": [14, 0, 0.2222, 0.1111, 0, 0.66, 0.0, 810, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "l", "arg_names": [], "import_names": [], "rhs_call_name": "", "a... | [] |
x = (1,3)
y = (1,3)
print {x:'OK'}[y]
| ajibawa-2023/Python-Code-Large/train/row_97110 | 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_97110: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, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "a... | [] |
x = 2
x ^= 7
print x
| ajibawa-2023/Python-Code-Large/train/row_97111 | 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_97111: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... | [] |
# 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_97112 | 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_97112: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"... | [] |
def foo(x):
yield len(x)
yield len(x)
g = foo(range(5))
print g.next()
len = lambda y: 8
print g.next()
| ajibawa-2023/Python-Code-Large/train/row_97113 | 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_97113:FunctionDef_L1_C0", "label": "foo", "type": "function", "loc": [1, 3], "level": 0, "parent": null, "vector": [2, 0, 0.25, 0.375, 0, 0.66, 0.0, 528, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "foo", "arg_names": ["x"], "import_names": [], "rhs_call_name": "", "anno... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97113:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97113:Expr_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97113:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97113:Expr_L3_C4"}] |
# Test that min & max work on dicts
d = {'foo':2, 'bar':3}
print d
print min(d)
print max(d)
| ajibawa-2023/Python-Code-Large/train/row_97114 | 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_97114:Assign_L2_C0", "label": "d =", "type": "assigned_variable", "loc": [2, 2], "level": 0, "parent": null, "vector": [14, 0, 0.4, 0.2, 0, 0.66, 0.0, 355, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat... | [] |
print [x*x for x in range(10) if x % 2 == 0]
| ajibawa-2023/Python-Code-Large/train/row_97115 | 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_97115: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... | [] |
# Test the comparison of sets
l = [1,2,3,4,1,1]
print l
s = set(l)
print s
# Test the comparison of sets
print '# self'
print '# forwards'
print s.isdisjoint(s)
print s > s
print s.issuperset(s)
print s >= s
print s == s
print s != s
print s.issubset(s)
print s <= s
print s < s
print '# backwards'
print s.isdisjoint(... | ajibawa-2023/Python-Code-Large/train/row_97116 | 25 | 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_97116:Assign_L2_C0", "label": "l =", "type": "assigned_variable", "loc": [2, 2], "level": 0, "parent": null, "vector": [14, 0, 0.069, 0.0345, 0, 0.66, 0.0, 810, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "l", "arg_names": [], "import_names": [], "rhs_call_name": "", "an... | [] |
class X:
def stuff(self):
pass
x = X()
f = getattr(x, "stuff")
print f
fu = getattr(X, "stuff")
print fu
| ajibawa-2023/Python-Code-Large/train/row_97118 | 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_97118:ClassDef_L1_C0", "label": "X", "type": "class", "loc": [1, 3], "level": 0, "parent": null, "vector": [3, 0, 0.25, 0.375, 0, 0.66, 0.0, 783, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "X", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""},... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97118:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97118:FunctionDef_L2_C4"}] |
def wee(waa, woo=False, wii=True):
print "OK", waa, woo, wii
wee("stuff")
wee("stuff", "dog")
wee("stuff", "dog", "cat")
wee("stuff", wii="lamma")
wee(wii="lamma", waa="pocky")
wee(wii="lamma", waa="pocky", woo="blorp")
| ajibawa-2023/Python-Code-Large/train/row_97119 | 8 | 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_97119:FunctionDef_L1_C0", "label": "wee", "type": "function", "loc": [1, 2], "level": 0, "parent": null, "vector": [2, 0, 0.1667, 0.2222, 0, 0.66, 0.0, 48, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "wee", "arg_names": ["waa", "woo", "wii"], "import_names": [], "rhs_cal... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97119:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97119:Expr_L2_C4"}] |
if not "?" in "xyz": print "OK"
| ajibawa-2023/Python-Code-Large/train/row_97120 | 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 7 in [1,2,3]
| ajibawa-2023/Python-Code-Large/train/row_97121 | 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_97121: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... | [] |
x = 4
print 1 != x < 9
print 1 != x > 9
print 4 != x < 9
print 4 == x > 9
print 4 == x < 9
print 4 == x < 9 < 14
print 4 == x < 9 < 14 > 10
print 4 == x < 9 < 14 < 10
| ajibawa-2023/Python-Code-Large/train/row_97122 | 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_97122:Assign_L1_C0", "label": "x =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.1111, 0.1111, 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 [1,2,"OK",4][-3:3][1]
| ajibawa-2023/Python-Code-Large/train/row_97123 | 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_97123:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 1.0, 1.0, 0, 0.66, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ... | [] |
def f():
yield 1
yield 2
g = f()
print g.next()
print g.next()
for i in f():
print i
| ajibawa-2023/Python-Code-Large/train/row_97124 | 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_97124:FunctionDef_L1_C0", "label": "f", "type": "function", "loc": [1, 3], "level": 0, "parent": null, "vector": [2, 0, 0.25, 0.375, 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_97124:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97124:Expr_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97124:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97124:Expr_L3_C4"}, {"f": "ajibawa-2023/Python-Code-Large... |
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_97125 | 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_97125: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_97125:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97125:Expr_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97125:FunctionDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97125:Expr_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large... |
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_97126 | 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_97126: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_97126:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97126:For_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97126:For_L2_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97126:If_L3_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_... |
def test():
global x
x = "OK"
test()
print x
| ajibawa-2023/Python-Code-Large/train/row_97127 | 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_97127: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_97127:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97127:Assign_L3_C4"}] |
a = [100,101,102,103,104,105,106,107]
del a[:]
print a
| ajibawa-2023/Python-Code-Large/train/row_97128 | 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_97128:Assign_L1_C0", "label": "a =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.3333, 0.3333, 0, 0.66, 0.0, 475, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "a", "arg_names": [], "import_names": [], "rhs_call_name": "", "a... | [] |
print 5&7
| ajibawa-2023/Python-Code-Large/train/row_97129 | 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_97129: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 len({'a':1, 'b':2})
| ajibawa-2023/Python-Code-Large/train/row_97130 | 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_97130: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 [1,2,3].index(3)
| ajibawa-2023/Python-Code-Large/train/row_97131 | 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_97131:Expr_L1_C0", "label": "index()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 1.0, 1.0, 0, 0.66, 0.0, 780, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "index", "arg_names": [], "import_names": [], "rhs_call_name": "index", "anno... | [] |
# Test that min & max work on sets
s = set([1,2,3])
print s
print min(s)
print max(s)
| ajibawa-2023/Python-Code-Large/train/row_97132 | 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_97132:Assign_L2_C0", "label": "s = set()", "type": "assigned_variable", "loc": [2, 2], "level": 0, "parent": null, "vector": [14, 0, 0.4, 0.2, 0, 0.66, 0.0, 553, 3, 1, 0, 0, 21, 10, 1], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name": "set... | [] |
a = 3
print a
| ajibawa-2023/Python-Code-Large/train/row_97133 | 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_97133: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, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "a", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat... | [] |
import sys
sys.x = 4
sys.y = ["stuff"]
sys.z = {'things': sys.x}
print sys.x, sys.y, sys.z
| ajibawa-2023/Python-Code-Large/train/row_97134 | 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_97134:Import_L1_C0", "label": "sys import sys", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.2, 0.2, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", ... | [] |
a,b,d = [0],2,"OK"
print d
| ajibawa-2023/Python-Code-Large/train/row_97135 | 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_97135:Assign_L1_C0", "label": "a, b, d =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.5, 0.5, 0, 0.66, 0.0, 51, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "a, b, d", "arg_names": [], "import_names": [], "rhs_call_name": "... | [] |
def test(): return
x = 1
print test()
| ajibawa-2023/Python-Code-Large/train/row_97136 | 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_97136: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_97136:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97136:Return_L1_C12"}] |
def f():
for i in 1,2,3,4,5:
if i == 4: return
yield i
print list(f())
| ajibawa-2023/Python-Code-Large/train/row_97137 | 6 | 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_97137: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_97137:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97137:For_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97137:For_L2_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97137:If_L3_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_... |
print 2 in {1:2}
| ajibawa-2023/Python-Code-Large/train/row_97138 | 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_97138: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):
i = 0
yield i
i += 1
j = i
yield i
yield j
j *= 100
i += j
yield j
yield i
yield n + i
for i in f(10): # i to conflict with body
j = 999
print i
| ajibawa-2023/Python-Code-Large/train/row_97139 | 12 | 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_97139:FunctionDef_L1_C0", "label": "f", "type": "function", "loc": [1, 12], "level": 0, "parent": null, "vector": [2, 0, 0.4062, 0.75, 0, 0.66, 0.0, 899, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "f", "arg_names": ["n"], "import_names": [], "rhs_call_name": "", "annota... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97139:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97139:Assign_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97139:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97139:Expr_L3_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
a = [100,101,102,103,104,105,106,107]
del a[0]
print a
| ajibawa-2023/Python-Code-Large/train/row_97140 | 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_97140:Assign_L1_C0", "label": "a =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.3333, 0.3333, 0, 0.66, 0.0, 475, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "a", "arg_names": [], "import_names": [], "rhs_call_name": "", "a... | [] |
class x():
pass
def f(x): return x
x.hi = f
print x.hi
| ajibawa-2023/Python-Code-Large/train/row_97141 | 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_97141:ClassDef_L1_C0", "label": "x", "type": "class", "loc": [1, 2], "level": 0, "parent": null, "vector": [3, 0, 0.25, 0.3333, 0, 0.66, 0.0, 190, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97141:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97141:Return_L4_C10"}] |
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_97142 | 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_97142: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... | [] |
x = [2,4,6]
print x[1]
| ajibawa-2023/Python-Code-Large/train/row_97143 | 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_97143: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, 5, 0], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat... | [] |
a = [1,2,3,4,5,6]
b = [9,9,9]
a[1:2] = b
print a
| ajibawa-2023/Python-Code-Large/train/row_97144 | 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_97144: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, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "a", "arg_names": [], "import_names": [], "rhs_call_name": "", "annot... | [] |
x = (1,3)
print {x:'OK'}[x]
| ajibawa-2023/Python-Code-Large/train/row_97145 | 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_97145: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 7^2&2
| ajibawa-2023/Python-Code-Large/train/row_97146 | 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_97146: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... | [] |
# nl continuation
x = "stuff \
and \
things"
print x
| ajibawa-2023/Python-Code-Large/train/row_97147 | 2 | 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_97147:Assign_L3_C0", "label": "x =", "type": "assigned_variable", "loc": [3, 5], "level": 0, "parent": null, "vector": [14, 0, 0.6667, 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": "", "anno... | [] |
def test(x):
return x
y = test(1)*2 + test(3)*4 + test(5)*6
print y
| ajibawa-2023/Python-Code-Large/train/row_97148 | 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_97148:FunctionDef_L1_C0", "label": "test", "type": "function", "loc": [1, 2], "level": 0, "parent": null, "vector": [2, 0, 0.375, 0.5, 0, 0.66, 0.0, 224, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "test", "arg_names": ["x"], "import_names": [], "rhs_call_name": "", "ann... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97148:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97148:Return_L2_C4"}] |
class Stuff:
def __init__(self):
print "OK"
"""
weewaa
"""
Stuff()
| ajibawa-2023/Python-Code-Large/train/row_97149 | 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_97149:ClassDef_L1_C0", "label": "Stuff", "type": "class", "loc": [1, 7], "level": 0, "parent": null, "vector": [3, 0, 0.5, 0.875, 0, 0.66, 0.0, 710, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "Stuff", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97149:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97149:FunctionDef_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97149:FunctionDef_L2_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_97149:Expr_L3_C8"}, {"f": "ajibawa-2023/Python-Code-L... |
print min(3,8,2,6)
| ajibawa-2023/Python-Code-Large/train/row_97150 | 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_97150: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... | [] |
def mygen(upto):
for i in range(0, upto):
print 'i',i
got = yield i
print 'got',got
handle = mygen(3)
first = True
for num in handle:
print 'num',num
if first:
print 'signalling'
foo = handle.send('sig')
print 'foo', foo
first = False
| ajibawa-2023/Python-Code-Large/train/row_97151 | 14 | 15 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97151:FunctionDef_L1_C0", "label": "mygen", "type": "function", "loc": [1, 5], "level": 0, "parent": null, "vector": [2, 0, 0.2, 0.3333, 0, 0.66, 0.0, 56, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "mygen", "arg_names": ["upto"], "import_names": [], "rhs_call_name": "",... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97151:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97151:For_L2_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97151:For_L2_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_97151:Expr_L3_C7"}, {"f": "ajibawa-2023/Python-Code-Large/train/ro... |
def funky():
print "cheese"
def gen():
i = 0
funky()
yield 1
i += 1
g = gen()
print g.next()
| ajibawa-2023/Python-Code-Large/train/row_97152 | 8 | 11 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_97152:FunctionDef_L1_C0", "label": "funky", "type": "function", "loc": [1, 2], "level": 0, "parent": null, "vector": [2, 0, 0.1364, 0.1818, 0, 0.66, 0.0, 700, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "funky", "arg_names": [], "import_names": [], "rhs_call_name": "", "... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_97152:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97152:Expr_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_97152:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_97152:Assign_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.