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 |
|---|---|---|---|---|---|---|---|
z = 0
for x in [1,2,3]:
z += x
print z
| ajibawa-2023/Python-Code-Large/train/row_89317 | 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_89317:Assign_L1_C0", "label": "z =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.25, 0.25, 0, 0.66, 0.0, 859, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annot... | [] |
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_89318 | 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_89318: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_89318:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89318:For_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89318:For_L2_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_89318:If_L3_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_... |
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_89319 | 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_89319: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_89319:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89319:For_L2_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89319:For_L2_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_89319:Expr_L3_C7"}, {"f": "ajibawa-2023/Python-Code-Large/train/ro... |
x = [1]
x.extend([2,3])
print(x[1])
| ajibawa-2023/Python-Code-Large/train/row_89320 | 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_89320: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, 5, 0], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "a... | [] |
print 2^7
| ajibawa-2023/Python-Code-Large/train/row_89321 | 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_89321: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(l):
for i in 1,2,3,4,5:
yield l, i
a, b = f("a"), f("b")
print a.next()
print a.next()
print b.next()
print b.next()
print b.next()
print a.next()
print b.next()
print a.next()
| ajibawa-2023/Python-Code-Large/train/row_89322 | 12 | 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_89322:FunctionDef_L1_C0", "label": "f", "type": "function", "loc": [1, 3], "level": 0, "parent": null, "vector": [2, 0, 0.1667, 0.25, 0, 0.66, 0.0, 899, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "f", "arg_names": ["l"], "import_names": [], "rhs_call_name": "", "annotat... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_89322:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89322:For_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89322:For_L2_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_89322:Expr_L3_C8"}] |
print 7^2&2
| ajibawa-2023/Python-Code-Large/train/row_89323 | 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_89323: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_89324 | 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_89324: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 [c for c in "asdf"]
| ajibawa-2023/Python-Code-Large/train/row_89325 | 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_89325: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 "1234"[1:3]
| ajibawa-2023/Python-Code-Large/train/row_89326 | 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_89326: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 " hello ".partition("x")
print " hello ".rpartition("x")
| ajibawa-2023/Python-Code-Large/train/row_89327 | 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_89327: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, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "anno... | [] |
print True and True
| ajibawa-2023/Python-Code-Large/train/row_89328 | 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_89328: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 [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_89329 | 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_89329: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... | [] |
s = 'abcd'
print s[::-1]
| ajibawa-2023/Python-Code-Large/train/row_89330 | 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_89330: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 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_89331 | 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_89331: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",... | [] |
print "".join(["O"]+["K"])
| ajibawa-2023/Python-Code-Large/train/row_89332 | 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_89332: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 "-".join(["O","K"])
| ajibawa-2023/Python-Code-Large/train/row_89333 | 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_89333: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... | [] |
for const in (1,2,3):
print const
def f():
for const in (1,2,3):
print const
for object in (1,2,3):
print object
instanceof = 5
void = 6
var = 7
delete = 8
switch = 9
default = 10
catch = 11
print instanceof, void, var, delete, switch, default, catch
f()
| ajibawa-2023/Python-Code-Large/train/row_89334 | 16 | 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_89334:For_L1_C0", "label": "for const", "type": "for", "loc": [1, 2], "level": 0, "parent": null, "vector": [6, 0, 0.0882, 0.1176, 0, 0.66, 0.0, 798, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "const", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotatio... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_89334:For_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89334:Expr_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89334:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89334:For_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/ro... |
def f(n):
for i in range(n):
yield i
g = f(5)
print g.next()
print g.next()
print g.next()
print g.next()
| ajibawa-2023/Python-Code-Large/train/row_89335 | 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_89335: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, 1, 0, 0, 0, 0, 1], "semantic": {"name": "f", "arg_names": ["n"], "import_names": [], "rhs_call_name": "", "annotati... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_89335:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89335:For_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89335:For_L2_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_89335:Expr_L3_C8"}] |
print slice(1,2)
| ajibawa-2023/Python-Code-Large/train/row_89336 | 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_89336: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 Base(object):
def myfunc(self):
print "Base.myfunc"
def stuff(self):
print "Base.stuff"
self.myfunc()
class Derived(Base):
def myfunc(self):
Base.myfunc(self)
print "Derived.myfunc"
d = Derived()
d.myfunc()
b = Derived()
b.stuff()
| ajibawa-2023/Python-Code-Large/train/row_89337 | 14 | 18 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_89337:ClassDef_L1_C0", "label": "Base", "type": "class", "loc": [1, 7], "level": 0, "parent": null, "vector": [3, 0, 0.2222, 0.3889, 0, 0.66, 0.0, 56, 0, 2, 0, 0, 186, 0, 3], "semantic": {"name": "Base", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_89337:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89337:FunctionDef_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89337:FunctionDef_L2_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_89337:Expr_L3_C8"}, {"f": "ajibawa-2023/Python-Code-L... |
x=2
x+=3
print x
| ajibawa-2023/Python-Code-Large/train/row_89338 | 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_89338: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 str(range(-4))[:5]
print len(range(-4))
| ajibawa-2023/Python-Code-Large/train/row_89339 | 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_89339: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, 3], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "anno... | [] |
# free and cell vars in y
c = "squirrel"
def x():
b = "dog"
print b, c
def y():
a = "cat"
print a,b
def z():
return a,b,c
return z
return y()
print x()()
| ajibawa-2023/Python-Code-Large/train/row_89340 | 12 | 14 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_89340:Assign_L3_C0", "label": "c =", "type": "assigned_variable", "loc": [3, 3], "level": 0, "parent": null, "vector": [14, 0, 0.2143, 0.0714, 0, 0.66, 0.0, 411, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "c", "arg_names": [], "import_names": [], "rhs_call_name": "", "a... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_89340:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89340:Assign_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89340:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89340:Expr_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
print float('inf')
print float('-inf')
| ajibawa-2023/Python-Code-Large/train/row_89341 | 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_89341: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, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "anno... | [] |
def f():
for i in 1,2,3,4,5:
if i % 2 == 0: continue
yield i
print list(f())
| ajibawa-2023/Python-Code-Large/train/row_89342 | 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_89342: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, 0], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotati... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_89342:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89342:For_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89342:For_L2_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_89342:If_L3_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_... |
for i in (i*2 for i in range(3)):
print i
| ajibawa-2023/Python-Code-Large/train/row_89343 | 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_89343:For_L1_C0", "label": "for i", "type": "for", "loc": [1, 2], "level": 0, "parent": null, "vector": [6, 0, 0.75, 1.0, 0, 0.66, 0.0, 826, 5, 0, 0, 0, 0, 0, 2], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "sni... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_89343:For_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89343:Expr_L2_C4"}] |
s = set([2,3,4])
t = set([3,4,5])
u = set([1,3,5])
a = s.difference(t)
b = u.difference(s)
c = u.difference(t)
print a
print b
print c
print a == set([2])
print b == set([1,5])
print c == set([1])
d = s.difference(t, u)
print d
print d == set([2])
| ajibawa-2023/Python-Code-Large/train/row_89344 | 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_89344: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 False == 0
print True == 1
print True == 2
| ajibawa-2023/Python-Code-Large/train/row_89345 | 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_89345: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",... | [] |
def do(fmt, val):
print fmt % val
# Some small ints
do("%d", 42)
do("%d", -42)
do("%d", 42L)
do("%d", -42L)
do("%d", 42.0)
do("%#x", 1)
do("%#x", 1L)
do("%#X", 1)
do("%#X", 1L)
do("%#x", 1.0)
do("%#o", 1)
do("%#o", 1L)
do("%#o", 0)
do("%#o", 0L)
do("%o", 0)
do("%o", 0L)
do("%d", 0)
do("%d", 0L)
do("%#x", 0)
do("%#x... | ajibawa-2023/Python-Code-Large/train/row_89346 | 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_89346:FunctionDef_L1_C0", "label": "do", "type": "function", "loc": [1, 2], "level": 0, "parent": null, "vector": [2, 0, 0.75, 1.0, 0, 0.66, 0.0, 245, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "do", "arg_names": ["fmt", "val"], "import_names": [], "rhs_call_name": "", ... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_89346:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89346:Expr_L2_C4"}] |
print 7^2|4
| ajibawa-2023/Python-Code-Large/train/row_89347 | 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_89347: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... | [] |
z = 0
for x in range(1,4):
z += x
print z
| ajibawa-2023/Python-Code-Large/train/row_89348 | 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_89348:Assign_L1_C0", "label": "z =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.25, 0.25, 0, 0.66, 0.0, 859, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annot... | [] |
class X:
def __init__(self):
self.px = 3
def y(self):
l = "xyz"
if len(l) == self.px:
print "OK"
x = X()
x.y()
| ajibawa-2023/Python-Code-Large/train/row_89349 | 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_89349:ClassDef_L1_C0", "label": "X", "type": "class", "loc": [1, 7], "level": 0, "parent": null, "vector": [3, 0, 0.4444, 0.7778, 0, 0.66, 0.0, 783, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "X", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": "... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_89349:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89349:FunctionDef_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89349:FunctionDef_L2_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_89349:Assign_L3_C8"}, {"f": "ajibawa-2023/Python-Code... |
x = {1:2}
del x[1]
print len(x)
| ajibawa-2023/Python-Code-Large/train/row_89350 | 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_89350: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, 6, 0], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "a... | [] |
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_89351 | 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_89351: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_89351:FunctionDef_L2_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89351:For_L3_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89351:FunctionDef_L2_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89351:Return_L5_C4"}] |
c = "squirrel"
time = 0
def x():
global time
time += 1
if time == 1:
b = "dog"
else:
b = "banana"
print b, c
def y(d):
a = "cat"
print a,b,d
def z():
for i in range(10*time):
yield i,a,b,c,d
return z
return y("blorp"... | ajibawa-2023/Python-Code-Large/train/row_89352 | 19 | 22 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_89352:Assign_L1_C0", "label": "c =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.0455, 0.0455, 0, 0.66, 0.0, 411, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "c", "arg_names": [], "import_names": [], "rhs_call_name": "", "a... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_89352:FunctionDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89352:If_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89352:If_L6_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_89352:Assign_L7_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/ro... |
a = [1,2,3,4,5,6]
b = [9,9,9]
a[1:2] = b
print a
| ajibawa-2023/Python-Code-Large/train/row_89353 | 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_89353: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... | [] |
import this
| ajibawa-2023/Python-Code-Large/train/row_89354 | 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_89354:Import_L1_C0", "label": "this import this", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 1.0, 1.0, 0, 0.66, 0.0, 324, 0, 1, 0, 0, 324, 0, 0], "semantic": {"name": "this", "arg_names": [], "import_names": ["this"], "rhs_call_name": ... | [] |
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_89355 | 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_89355: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_89355:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89355:FunctionDef_L2_C4"}] |
def test(x):
return x
y = test(1)*2 + test(3)*4 + test(5)*6
print y
| ajibawa-2023/Python-Code-Large/train/row_89356 | 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_89356: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_89356:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89356:Return_L2_C4"}] |
print ~True
print ~False
| ajibawa-2023/Python-Code-Large/train/row_89357 | 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_89357: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 " hello ".strip()
print " hello ".lstrip()
print " hello ".rstrip()
print " hello ".partition("l")
print " hello ".rpartition("l")
print " HELlo ".lower()
print " heLLO ".upper()
print "hi there".split(" ")
| ajibawa-2023/Python-Code-Large/train/row_89358 | 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_89358: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, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "... | [] |
# 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_89359 | 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_89359: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... | [] |
class X: pass
def test(): y = X()
test()
print "OK"
| ajibawa-2023/Python-Code-Large/train/row_89360 | 5 | 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_89360: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": ""}, ... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_89360:FunctionDef_L2_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89360:Assign_L2_C12"}] |
a,b = 1,2
print a+b
| ajibawa-2023/Python-Code-Large/train/row_89361 | 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_89361:Assign_L1_C0", "label": "a, b =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.5, 0.5, 0, 0.66, 0.0, 127, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "a, b", "arg_names": [], "import_names": [], "rhs_call_name": "", "a... | [] |
x=4
x=x*3
print x
| ajibawa-2023/Python-Code-Large/train/row_89362 | 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_89362: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 f(a, b):
print a, b
f(1, 2)
f(*[1, 2])
f(*(1, 2))
def g(a, b, *c):
print a, b, c
g(1, 2, 3)
g(1, 2, 3, 4, 5, 6)
g(*[1, 2])
g(*[1, 2, 3, 4])
g(*[1, 2, 3, 4, 5, 6, 7])
g(*(1, 2, 3, 4, 5, 6, 7))
g(1, *[7])
g(1, *[7, 8, 9])
g(1, 2, *(7,))
g(1, 2, 3, *(7, 8, 9))
| ajibawa-2023/Python-Code-Large/train/row_89363 | 17 | 20 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_89363:FunctionDef_L1_C0", "label": "f", "type": "function", "loc": [1, 2], "level": 0, "parent": null, "vector": [2, 0, 0.075, 0.1, 0, 0.66, 0.0, 899, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "f", "arg_names": ["a", "b"], "import_names": [], "rhs_call_name": "", "anno... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_89363:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89363:Expr_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89363:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89363:Expr_L9_C4"}] |
a = [100,101,102,103,104,105,106,107]
del a[2:6]
print a
| ajibawa-2023/Python-Code-Large/train/row_89364 | 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_89364: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(abs(-5))
| ajibawa-2023/Python-Code-Large/train/row_89365 | 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_89365: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 str((1,2,3))
print str([1,2,3])
print str({1:'ok', 2:'stuff'})
print str("weewaa")
| ajibawa-2023/Python-Code-Large/train/row_89366 | 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_89366: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... | [] |
x = []
x.append(x)
print x<x
| ajibawa-2023/Python-Code-Large/train/row_89367 | 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_89367: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, 5, 0], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "a... | [] |
print "a"*15
print "dog"*19
print 40*"weee"
| ajibawa-2023/Python-Code-Large/train/row_89368 | 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_89368: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 "..bbb..".replace("..", "X")
| ajibawa-2023/Python-Code-Large/train/row_89369 | 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_89369: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 4-1
| ajibawa-2023/Python-Code-Large/train/row_89370 | 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_89370: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 = 2,'OK',
print len(x)
| ajibawa-2023/Python-Code-Large/train/row_89371 | 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_89371: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({1:"OK"}[1])
| ajibawa-2023/Python-Code-Large/train/row_89372 | 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_89372: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_89373 | 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_89373: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_89373:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89373:Assign_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89373:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89373:Expr_L3_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
print str(range(5,0,-3))[:5]
print len(range(5,0,-3))
print range(5,0,-3)[0]
print range(5,0,-3)[1]
print range(5,0,-3)[-1]
| ajibawa-2023/Python-Code-Large/train/row_89374 | 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_89374: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 "Yes" if True else "No"
print "Yes" if False else "No"
| ajibawa-2023/Python-Code-Large/train/row_89375 | 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_89375: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... | [] |
a = ()
print a
| ajibawa-2023/Python-Code-Large/train/row_89376 | 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_89376: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... | [] |
# nl continuation
x = "stuff \
and \
things"
print x
| ajibawa-2023/Python-Code-Large/train/row_89378 | 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_89378: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... | [] |
print range(10)[slice(0, 5, 2)]
| ajibawa-2023/Python-Code-Large/train/row_89379 | 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_89379: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... | [] |
def f():
if 1 == 2:
yield -1
elif 1 == 1:
yield 3
else:
yield -1
print list(f())
| ajibawa-2023/Python-Code-Large/train/row_89380 | 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_89380:FunctionDef_L1_C0", "label": "f", "type": "function", "loc": [1, 7], "level": 0, "parent": null, "vector": [2, 0, 0.4444, 0.7778, 0, 0.66, 0.0, 899, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotati... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_89380:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89380:If_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89380:If_L2_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_89380:Expr_L3_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_... |
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_89381 | 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_89381: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_89381:If_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89381:Expr_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89381:If_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89381:Expr_L6_C4"}] |
# empty set creation
print set()
| ajibawa-2023/Python-Code-Large/train/row_89382 | 1 | 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_89382:Expr_L2_C0", "label": "print()", "type": "expression", "loc": [2, 2], "level": 0, "parent": null, "vector": [8, 0, 1.0, 0.5, 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 f(a, b, c):
print a, b, c
args = [5, 6, 7]
f(*args)
| ajibawa-2023/Python-Code-Large/train/row_89383 | 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_89383:FunctionDef_L1_C0", "label": "f", "type": "function", "loc": [1, 2], "level": 0, "parent": null, "vector": [2, 0, 0.3, 0.4, 0, 0.66, 0.0, 899, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "f", "arg_names": ["a", "b", "c"], "import_names": [], "rhs_call_name": "", "a... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_89383:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89383:Expr_L2_C4"}] |
print "1,2,3".split(",").index("3")
| ajibawa-2023/Python-Code-Large/train/row_89384 | 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_89384: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... | [] |
longvalue = 9999999999999L
print "%3ld" % 42
print "%d" % 42
print "%d" % 42.0
print "%d" % longvalue
print "%07.2f" % 42
print "%07.2F" % 42
print "%(foo)s" % { 'foo': 'bar' }
#print "%((foo))s" % { '(foo)': 'bar' }
print "%sx" % (103*'a')
| ajibawa-2023/Python-Code-Large/train/row_89385 | 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_89385:Expr_L1_C0", "label": "print()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.1111, 0.1111, 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 7 in [1,2,3]
| ajibawa-2023/Python-Code-Large/train/row_89386 | 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_89386: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
def creator():
r = yrange(5)
print "creator", r.next()
return r
def caller():
r = creator()
for i in r:
print "caller", i
caller()
| ajibawa-2023/Python-Code-Large/train/row_89387 | 12 | 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_89387:FunctionDef_L1_C0", "label": "yrange", "type": "function", "loc": [1, 3], "level": 0, "parent": null, "vector": [2, 0, 0.1333, 0.2, 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_89387:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89387:For_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89387:For_L2_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_89387:Expr_L3_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/ro... |
import t221_sub
print t221_sub.x
print t221_sub.f("wee")
| ajibawa-2023/Python-Code-Large/train/row_89388 | 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_89388:Import_L1_C0", "label": "t221_sub import t221_sub", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.3333, 0.3333, 0, 0.66, 0.0, 801, 0, 1, 0, 0, 801, 0, 0], "semantic": {"name": "t221_sub", "arg_names": [], "import_names": ["t221_su... | [] |
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_89389 | 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_89389: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"... | [] |
a = [1,2,3,4,5,6]
b = [9,10,11]
a[::-2] = b
print a
| ajibawa-2023/Python-Code-Large/train/row_89390 | 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_89390: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... | [] |
class X: pass
print type(X)
x = X()
print type(x)
print x
class Y(object): pass
print type(Y)
y = Y()
print type(y)
print y
| ajibawa-2023/Python-Code-Large/train/row_89391 | 10 | 10 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_89391:ClassDef_L1_C0", "label": "X", "type": "class", "loc": [1, 1], "level": 0, "parent": null, "vector": [3, 0, 0.1, 0.1, 0, 0.66, 0.0, 783, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "X", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "s... | [] |
s = set([2,3,4])
t = set([3,4,5])
u = set([1,3,5])
print s
s.difference_update(t)
u.difference_update(t)
print s
print u
print s == set([2])
print u == set([1])
s = set([2,3,4])
t = set([3,4,5])
t.difference_update(s, u)
print t
print t == set([5])
| ajibawa-2023/Python-Code-Large/train/row_89392 | 15 | 22 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_89392:Assign_L1_C0", "label": "s = set()", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.0455, 0.0455, 0, 0.66, 0.0, 553, 3, 1, 0, 0, 21, 10, 1], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name"... | [] |
X = "OK"
def test():
X = 4
print(X)
test()
print X
| ajibawa-2023/Python-Code-Large/train/row_89393 | 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_89393:Assign_L1_C0", "label": "X =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.1667, 0.1667, 0, 0.66, 0.0, 783, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "X", "arg_names": [], "import_names": [], "rhs_call_name": "", "a... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_89393:FunctionDef_L2_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89393:Assign_L3_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89393:FunctionDef_L2_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89393:Expr_L4_C4"}] |
x = "abcdefghjijk"
print x[:0]
print x[0:]
| ajibawa-2023/Python-Code-Large/train/row_89394 | 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_89394: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, 3, 0], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "a... | [] |
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_89395 | 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_89395: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_89395:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89395:Return_L2_C4"}] |
def f(n):
i = 0
while i < n:
yield i
yield i * 10
i += 1
for i in f(10):
print i
| ajibawa-2023/Python-Code-Large/train/row_89396 | 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_89396:FunctionDef_L1_C0", "label": "f", "type": "function", "loc": [1, 6], "level": 0, "parent": null, "vector": [2, 0, 0.3889, 0.6667, 0, 0.66, 0.0, 899, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "f", "arg_names": ["n"], "import_names": [], "rhs_call_name": "", "annot... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_89396:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89396:Assign_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89396:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89396:While_L3_C4"}, {"f": "ajibawa-2023/Python-Code-La... |
x = [2,4,6]
print x[1]
| ajibawa-2023/Python-Code-Large/train/row_89397 | 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_89397: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... | [] |
print "imported modc"
stuff = 942
things = "squirrel"
| ajibawa-2023/Python-Code-Large/train/row_89398 | 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_89398: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 [x*x for x in range(10) if x % 2 == 0]
| ajibawa-2023/Python-Code-Large/train/row_89399 | 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_89399: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 "OKx"[:-1]
| ajibawa-2023/Python-Code-Large/train/row_89400 | 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_89400: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 "1234"[-3:3]
| ajibawa-2023/Python-Code-Large/train/row_89401 | 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_89401: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 'Hello';
print "stuff"; print "things"
| ajibawa-2023/Python-Code-Large/train/row_89402 | 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 Test:
def __init__(self, v):
self.value = v
def __call__(self):
print self.value
x = Test('OK')
x()
| ajibawa-2023/Python-Code-Large/train/row_89403 | 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_89403:ClassDef_L1_C0", "label": "Test", "type": "class", "loc": [1, 5], "level": 0, "parent": null, "vector": [3, 0, 0.4286, 0.7143, 0, 0.66, 0.0, 786, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "Test", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotati... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_89403:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89403:FunctionDef_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89403:FunctionDef_L2_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_89403:Assign_L3_C8"}, {"f": "ajibawa-2023/Python-Code... |
print len([1,2,3])
| ajibawa-2023/Python-Code-Large/train/row_89405 | 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_89405: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,b = "OK"
print a+b
| ajibawa-2023/Python-Code-Large/train/row_89407 | 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_89407:Assign_L1_C0", "label": "a, b =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.5, 0.5, 0, 0.66, 0.0, 127, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "a, b", "arg_names": [], "import_names": [], "rhs_call_name": "", "a... | [] |
def test(x,y):
print x
return y
test('a', 1) or test('b', 1) and test('c', 0)
| ajibawa-2023/Python-Code-Large/train/row_89408 | 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_89408: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, 2, 1, 0, 0, 0, 1], "semantic": {"name": "test", "arg_names": ["x", "y"], "import_names": [], "rhs_call_name": "", ... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_89408:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89408:Expr_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89408:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89408:Return_L3_C4"}] |
def foo(value = None):
for i in [-1,0,1,2,3,4]:
if i < 0:
continue
elif i == 0:
yield 0
elif i == 1:
yield 1
yield value
yield 2
else:
yield i
print list(foo())
| ajibawa-2023/Python-Code-Large/train/row_89409 | 11 | 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_89409:FunctionDef_L1_C0", "label": "foo", "type": "function", "loc": [1, 12], "level": 0, "parent": null, "vector": [2, 0, 0.5, 0.9231, 0, 0.66, 0.0, 528, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "foo", "arg_names": ["value"], "import_names": [], "rhs_call_name": "", ... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_89409:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89409:For_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89409:For_L2_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_89409:If_L3_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_... |
z = lambda x: x
print z(4)
print z("stuff")
| ajibawa-2023/Python-Code-Large/train/row_89410 | 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_89410:Assign_L1_C0", "label": "z =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.3333, 0.3333, 0, 0.66, 0.0, 859, 9, 0, 0, 0, 0, 0, 0], "semantic": {"name": "z", "arg_names": [], "import_names": [], "rhs_call_name": "", "a... | [] |
a = [100,101,102,103,104,105,106,107]
del a[:]
print a
| ajibawa-2023/Python-Code-Large/train/row_89411 | 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_89411: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... | [] |
def gen():
i = 0
funky()
yield 1
i += 1
def funky():
print "cheese"
g = gen()
print g.next()
| ajibawa-2023/Python-Code-Large/train/row_89412 | 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_89412:FunctionDef_L1_C0", "label": "gen", "type": "function", "loc": [1, 5], "level": 0, "parent": null, "vector": [2, 0, 0.2727, 0.4545, 0, 0.66, 0.0, 728, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "gen", "arg_names": [], "import_names": [], "rhs_call_name": "", "anno... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_89412:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89412:Assign_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89412:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89412:Expr_L3_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
a = range(30)
print a[19::-7]
| ajibawa-2023/Python-Code-Large/train/row_89413 | 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_89413:Assign_L1_C0", "label": "a = range()", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.5, 0.5, 0, 0.66, 0.0, 475, 3, 1, 0, 0, 816, 10, 1], "semantic": {"name": "a", "arg_names": [], "import_names": [], "rhs_call_name": "... | [] |
print slice(1,2,3)
| ajibawa-2023/Python-Code-Large/train/row_89414 | 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_89414: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 = range(30)
print a[-10::5]
print a[-10::-6]
a = tuple(range(30))
print a[-10::5]
print a[-10::-6]
| ajibawa-2023/Python-Code-Large/train/row_89415 | 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_89415:Assign_L1_C0", "label": "a = range()", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.1667, 0.1667, 0, 0.66, 0.0, 475, 3, 1, 0, 0, 816, 10, 1], "semantic": {"name": "a", "arg_names": [], "import_names": [], "rhs_call_na... | [] |
s = set([1,2,3])
t = set([3,4,5])
a = s.symmetric_difference(t)
b = t.symmetric_difference(s)
print a
print a == b
print a == set([1,2,4,5])
| ajibawa-2023/Python-Code-Large/train/row_89416 | 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_89416:Assign_L1_C0", "label": "s = set()", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.1429, 0.1429, 0, 0.66, 0.0, 553, 3, 1, 0, 0, 21, 10, 1], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name"... | [] |
# 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_89417 | 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_89417: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... | [] |
a = 3
print a
| ajibawa-2023/Python-Code-Large/train/row_89418 | 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_89418: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... | [] |
y = "\n\
The \"quick\"\n\
brown fox\n\
jumps over\n\
the 'lazy' dog.\n\
"
print y
| ajibawa-2023/Python-Code-Large/train/row_89419 | 2 | 7 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_89419:Assign_L1_C0", "label": "y =", "type": "assigned_variable", "loc": [1, 6], "level": 0, "parent": null, "vector": [14, 0, 0.5, 0.8571, 0, 0.66, 0.0, 304, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "y", "arg_names": [], "import_names": [], "rhs_call_name": "", "anno... | [] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.