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 |
|---|---|---|---|---|---|---|---|
d = {}
d["__proto__"]="testing"
print d
| ajibawa-2023/Python-Code-Large/train/row_89216 | 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_89216:Assign_L1_C0", "label": "d =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.3333, 0.3333, 0, 0.66, 0.0, 355, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "a... | [] |
# Test the creation of sets
l = [1,2,3,4,1,1]
print l
s = set(l)
print s
print len(s)
| ajibawa-2023/Python-Code-Large/train/row_89217 | 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_89217:Assign_L2_C0", "label": "l =", "type": "assigned_variable", "loc": [2, 2], "level": 0, "parent": null, "vector": [14, 0, 0.3333, 0.1667, 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="OK";print x
| ajibawa-2023/Python-Code-Large/train/row_89218 | 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 str(range(-8,-4,-1))[:5]
print len(range(-8,-4,-1))
| ajibawa-2023/Python-Code-Large/train/row_89219 | 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_89219: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... | [] |
def f(*a):
print a
def g(x, *a):
print x, a
def h(x, y, *a):
print x, y, a
def i(x, y=4, *a):
print x, y, a
f()
f(1)
f(1, 2, 3)
g(1)
g(1, 2, 3)
h(1, 2)
h(1, 2, 3)
h(1, 2, 3, 4)
i(1)
i(1, 2, 3)
i(1, 2, 3, 4)
| ajibawa-2023/Python-Code-Large/train/row_89220 | 19 | 23 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_89220:FunctionDef_L1_C0", "label": "f", "type": "function", "loc": [1, 2], "level": 0, "parent": null, "vector": [2, 0, 0.0652, 0.087, 0, 0.66, 0.0, 899, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "f", "arg_names": ["a"], "import_names": [], "rhs_call_name": "", "annota... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_89220:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89220:Expr_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89220:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89220:Expr_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large... |
print (2 < 3 < 9)
print (2 < (3 < 9))
| ajibawa-2023/Python-Code-Large/train/row_89221 | 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_89221: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... | [] |
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_89222 | 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_89222: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_89222:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89222:Expr_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89222:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89222:Expr_L3_C4"}, {"f": "ajibawa-2023/Python-Code-Large... |
print "234".replace("\r\n", "\n")
| ajibawa-2023/Python-Code-Large/train/row_89223 | 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_89223: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 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_89224 | 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_89224: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": ""}... | [] |
def f():
print "in f"
return 10
def g():
print "in g"
return 20
retval = True
def h():
global retval
retval = not retval
return retval
for i in range(3):
print f() if h() else g()
| ajibawa-2023/Python-Code-Large/train/row_89225 | 12 | 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_89225:FunctionDef_L1_C0", "label": "f", "type": "function", "loc": [1, 3], "level": 0, "parent": null, "vector": [2, 0, 0.1176, 0.1765, 0, 0.66, 0.0, 899, 0, 0, 1, 0, 0, 0, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotati... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_89225:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89225:Expr_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89225:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89225:Return_L3_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
import pkga.pkgb.modc
import pkga.pkgb.modc # only one print
print "a name", pkga.__name__
print "a.b name", pkga.pkgb.__name__
print "a.b.c name", pkga.pkgb.modc.__name__
print "stuff", pkga.pkgb.modc.stuff
print "things", pkga.pkgb.modc.things
| ajibawa-2023/Python-Code-Large/train/row_89226 | 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_89226:Import_L1_C0", "label": "pkga.pkgb.modc import pkga.pkgb.modc", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.125, 0.125, 0, 0.66, 0.0, 812, 0, 1, 0, 0, 812, 0, 0], "semantic": {"name": "pkga.pkgb.modc", "arg_names": [], "import_n... | [] |
x = [v*v for v in range(0,5)]
print x[3]
| ajibawa-2023/Python-Code-Large/train/row_89227 | 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_89227: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, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat... | [] |
print 5&7
| ajibawa-2023/Python-Code-Large/train/row_89228 | 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_89228:Expr_L1_C0", "label": "print()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 1.0, 1.0, 0, 0.66, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "anno... | [] |
from pkga.pkgb.modc import stuff as mystuff
from pkga.pkgb.modc import things as mythings
print mystuff, mythings
| ajibawa-2023/Python-Code-Large/train/row_89229 | 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_89229:ImportFrom_L1_C0", "label": "from pkga.pkgb.modc import mystuff", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.25, 0.25, 0, 0.66, 0.0, 812, 0, 1, 0, 0, 812, 0, 0], "semantic": {"name": "pkga.pkgb.modc", "arg_names": [], "import_n... | [] |
print [1,2,"OK",4][-3:3][1]
| ajibawa-2023/Python-Code-Large/train/row_89230 | 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_89230: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": ... | [] |
class A: pass
class B: pass
class C: pass
class D(A): pass
class E(A,B): pass
class F(E,C): pass
a,b,c,d,e,f = A(),B(),C(),D(),E(),F()
print isinstance(a, A)
print isinstance(a, B)
print isinstance(a, C)
print isinstance(a, D)
print isinstance(a, E)
print isinstance(a, F)
print "---"
print isinstance(b, A)
print isin... | ajibawa-2023/Python-Code-Large/train/row_89231 | 49 | 51 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_89231:ClassDef_L1_C0", "label": "A", "type": "class", "loc": [1, 1], "level": 0, "parent": null, "vector": [3, 0, 0.0196, 0.0196, 0, 0.66, 0.0, 429, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "A", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": "... | [] |
print 2*3**2
| ajibawa-2023/Python-Code-Large/train/row_89232 | 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_89232: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... | [] |
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_89233 | 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_89233: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 2 in {1:2}
| ajibawa-2023/Python-Code-Large/train/row_89234 | 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_89234: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... | [] |
# Test that a clone of a list really is distinct
l = [1,2,3]
print l
m = list(l)
print m
m.pop()
print l
print m
| ajibawa-2023/Python-Code-Large/train/row_89235 | 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_89235:Assign_L2_C0", "label": "l =", "type": "assigned_variable", "loc": [2, 2], "level": 0, "parent": null, "vector": [14, 0, 0.25, 0.125, 0, 0.66, 0.0, 810, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "l", "arg_names": [], "import_names": [], "rhs_call_name": "", "anno... | [] |
if "a" is "a":
print "OK"
| ajibawa-2023/Python-Code-Large/train/row_89236 | 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_89236:If_L1_C0", "label": "if", "type": "if", "loc": [1, 2], "level": 0, "parent": null, "vector": [4, 0, 0.75, 1.0, 0, 0.66, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_89236:If_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89236:Expr_L2_C4"}] |
print type(4)
print type(444444444444444444444)
print type(4.5)
| ajibawa-2023/Python-Code-Large/train/row_89237 | 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_89237: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 = {}
x['y'] = "test"
print x['y']
| ajibawa-2023/Python-Code-Large/train/row_89238 | 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_89238: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... | [] |
print len("\\0")
| ajibawa-2023/Python-Code-Large/train/row_89239 | 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_89239: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 Wee:
def __init__(self):
self.called = False
def __iter__(self):
return self
def next(self):
print "in next"
if not self.called:
self.called = True
return "dog"
raise StopIteration
for i in Wee():
print i
| ajibawa-2023/Python-Code-Large/train/row_89240 | 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_89240:ClassDef_L1_C0", "label": "Wee", "type": "class", "loc": [1, 11], "level": 0, "parent": null, "vector": [3, 0, 0.4286, 0.7857, 0, 0.66, 0.0, 410, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Wee", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotatio... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_89240:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89240:FunctionDef_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89240:FunctionDef_L2_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_89240:Assign_L3_C8"}, {"f": "ajibawa-2023/Python-Code... |
def f(iter):
for v in iter:
print v
f(x*y for x in range(10) for y in range(x))
| ajibawa-2023/Python-Code-Large/train/row_89241 | 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_89241:FunctionDef_L1_C0", "label": "f", "type": "function", "loc": [1, 3], "level": 0, "parent": null, "vector": [2, 0, 0.5, 0.75, 0, 0.66, 0.0, 899, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "f", "arg_names": ["iter"], "import_names": [], "rhs_call_name": "", "annotat... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_89241:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89241:For_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89241:For_L2_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_89241:Expr_L3_C8"}] |
print "hello world"
| ajibawa-2023/Python-Code-Large/train/row_89242 | 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_89242:Expr_L1_C0", "label": "print()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 1.0, 1.0, 0, 0.66, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "anno... | [] |
import 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_89243 | 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_89243: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": "", ... | [] |
print("X-OK-Y".split("-")[1])
| ajibawa-2023/Python-Code-Large/train/row_89244 | 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_89244: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... | [] |
n = 0
for x in range(0,10,2):
n += 1
print n
| ajibawa-2023/Python-Code-Large/train/row_89245 | 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_89245: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... | [] |
print len({'a':1, 'b':2})
| ajibawa-2023/Python-Code-Large/train/row_89246 | 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_89246: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 f(a,b,c=10,d=20,*e,**f):
sortf = [(x,y) for x,y in f.items()]
sortf.sort()
print a,b,c,d,e,sortf
f(1,2)
f(1,2,3)
f(1,2,3,5)
f(1,2,d=3,c=5)
f(1,2,e=['x','y','z'])
f(1,2,d=3,c=5,e=['x','y','z'])
f(1,2,3,5,['x','y','z'])
f(1,2,3,5,['x','y','z'],z=5,y=9)
f(1,2,3,5,['x','y','z'],'blorp','wee',z=5,y=9)
| ajibawa-2023/Python-Code-Large/train/row_89247 | 13 | 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_89247:FunctionDef_L1_C0", "label": "f", "type": "function", "loc": [1, 4], "level": 0, "parent": null, "vector": [2, 0, 0.1786, 0.2857, 0, 0.66, 0.0, 899, 0, 6, 0, 0, 0, 0, 3], "semantic": {"name": "f", "arg_names": ["a", "b", "c", "d", "e", "f"], "import_names": [], "r... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_89247:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89247:Assign_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89247:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89247:Expr_L3_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
def f(n):
yield 1
a, b = n, n + 1
yield 2
yield a
yield b
a = 9999
b = 9999
for i in f(20):
print i
| ajibawa-2023/Python-Code-Large/train/row_89248 | 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_89248:FunctionDef_L1_C0", "label": "f", "type": "function", "loc": [1, 6], "level": 0, "parent": null, "vector": [2, 0, 0.35, 0.6, 0, 0.66, 0.0, 899, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "f", "arg_names": ["n"], "import_names": [], "rhs_call_name": "", "annotation... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_89248:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89248:Expr_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89248:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89248:Assign_L3_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
print 1|2|3|4|5|6|0x80
| ajibawa-2023/Python-Code-Large/train/row_89249 | 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_89249: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... | [] |
a,b,d = [0],2,"OK"
print d
| ajibawa-2023/Python-Code-Large/train/row_89250 | 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_89250: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": "... | [] |
if "a" is not "b":
print "OK"
| ajibawa-2023/Python-Code-Large/train/row_89251 | 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_89251:If_L1_C0", "label": "if", "type": "if", "loc": [1, 2], "level": 0, "parent": null, "vector": [4, 0, 0.75, 1.0, 0, 0.66, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_89251:If_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89251:Expr_L2_C4"}] |
a = [100,101,102,103,104,105,106,107]
del a[0]
print a
| ajibawa-2023/Python-Code-Large/train/row_89252 | 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_89252: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... | [] |
x = 444
def f(arg):
return "OK: " + arg + ", " + str(x)
| ajibawa-2023/Python-Code-Large/train/row_89253 | 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_89253:Assign_L1_C0", "label": "x =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.3333, 0.3333, 0, 0.66, 0.0, 190, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "a... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_89253:FunctionDef_L2_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89253:Return_L3_C4"}] |
class X: pass
x = X()
methodName = "wee"
try:
stuff = getattr(x, methodName)
except AttributeError:
raise ValueError, "no such method in %s: %s" % (x.__class__, methodName)
| ajibawa-2023/Python-Code-Large/train/row_89254 | 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_89254:ClassDef_L1_C0", "label": "X", "type": "class", "loc": [1, 1], "level": 0, "parent": null, "vector": [3, 0, 1.0, 1.0, 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... | [] |
# 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_89255 | 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_89255: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... | [] |
def test(y='K',x='Z'): print(x+y)
test('O')
| ajibawa-2023/Python-Code-Large/train/row_89256 | 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_89256: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_89256:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89256:Expr_L1_C23"}] |
wee = lambda waa, woo=False, wii=True: ("OK", waa, woo, wii)
print wee("stuff")
print wee("stuff", "dog")
print wee("stuff", "dog", "cat")
print wee("stuff", wii="lamma")
print wee(wii="lamma", waa="pocky")
print wee(wii="lamma", waa="pocky", woo="blorp")
| ajibawa-2023/Python-Code-Large/train/row_89257 | 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_89257:Assign_L1_C0", "label": "wee =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.125, 0.125, 0, 0.66, 0.0, 48, 9, 0, 0, 0, 0, 0, 0], "semantic": {"name": "wee", "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_89258 | 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_89258: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_89258:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89258:Expr_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89258:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89258:Expr_L3_C4"}] |
class Stuff:
def __init__(self):
self.a = 0
self.b = 'b'
self.c = [1,2,3]
self.d = 100000000000000
def doit(self):
self.a += 10
self.b += 'dog'
self.c += [9,10]
self.d += 10000
s = Stuff()
s.doit()
print s.a
print s.b
print s.c
print s.d
| ajibawa-2023/Python-Code-Large/train/row_89260 | 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_89260:ClassDef_L1_C0", "label": "Stuff", "type": "class", "loc": [1, 11], "level": 0, "parent": null, "vector": [3, 0, 0.3158, 0.5789, 0, 0.66, 0.0, 710, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "Stuff", "arg_names": [], "import_names": [], "rhs_call_name": "", "annot... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_89260:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89260:FunctionDef_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89260:FunctionDef_L2_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_89260:Assign_L3_C8"}, {"f": "ajibawa-2023/Python-Code... |
def test():
print "OK"
x = [1,test,2]
x[1]()
| ajibawa-2023/Python-Code-Large/train/row_89261 | 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_89261: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, 0, 0, 0, 0, 0, 1], "semantic": {"name": "test", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_89261:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89261:Expr_L2_C4"}] |
print 234
| ajibawa-2023/Python-Code-Large/train/row_89262 | 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_89262:Expr_L1_C0", "label": "print()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 1.0, 1.0, 0, 0.66, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "anno... | [] |
def test():
print "OK"
x = test
x()
| ajibawa-2023/Python-Code-Large/train/row_89263 | 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_89263: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, 0, 0, 0, 0, 0, 1], "semantic": {"name": "test", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_89263:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89263:Expr_L2_C4"}] |
print ord('X')
| ajibawa-2023/Python-Code-Large/train/row_89264 | 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_89264: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 test():
def fnc():
print "OK"
fnc()
test()
| ajibawa-2023/Python-Code-Large/train/row_89265 | 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_89265:FunctionDef_L1_C0", "label": "test", "type": "function", "loc": [1, 4], "level": 0, "parent": null, "vector": [2, 0, 0.5, 0.8, 0, 0.66, 0.0, 224, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "test", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotati... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_89265:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89265:FunctionDef_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89265:FunctionDef_L2_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_89265:Expr_L3_C8"}, {"f": "ajibawa-2023/Python-Cod... |
a = range(4)
del a[::2]
print a
| ajibawa-2023/Python-Code-Large/train/row_89266 | 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_89266:Assign_L1_C0", "label": "a = range()", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.3333, 0.3333, 0, 0.66, 0.0, 475, 3, 1, 0, 0, 816, 10, 1], "semantic": {"name": "a", "arg_names": [], "import_names": [], "rhs_call_na... | [] |
def f(n):
i = 0
while i < n:
yield i
i = 100
yield i
i += 1
for i in f(50):
print i
| ajibawa-2023/Python-Code-Large/train/row_89267 | 8 | 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_89267:FunctionDef_L1_C0", "label": "f", "type": "function", "loc": [1, 7], "level": 0, "parent": null, "vector": [2, 0, 0.4, 0.7, 0, 0.66, 0.0, 899, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "f", "arg_names": ["n"], "import_names": [], "rhs_call_name": "", "annotation"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_89267:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89267:Assign_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89267:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89267:While_L3_C4"}, {"f": "ajibawa-2023/Python-Code-La... |
print {(1,3):'OK'}[(1,3)]
| ajibawa-2023/Python-Code-Large/train/row_89268 | 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_89268: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):
print "OK"
"""
weewaa
"""
Stuff()
| ajibawa-2023/Python-Code-Large/train/row_89269 | 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_89269: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_89269:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89269:FunctionDef_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89269:FunctionDef_L2_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_89269:Expr_L3_C8"}, {"f": "ajibawa-2023/Python-Code-L... |
print {1:'stuff', 'ok':4}
| ajibawa-2023/Python-Code-Large/train/row_89270 | 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_89270: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
def f(x): return x
x.hi = f
print x.hi
| ajibawa-2023/Python-Code-Large/train/row_89271 | 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_89271: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_89271:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89271:Return_L4_C10"}] |
print(int)
print(str(int))
print(repr(int))
class X:
pass
x = X()
print(str(x))
print(repr(x))
print(str(x.__class__))
print(repr(x.__class__))
print(str(X))
print(repr(X))
| ajibawa-2023/Python-Code-Large/train/row_89272 | 11 | 12 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_89272:Expr_L1_C0", "label": "print()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0833, 0.0833, 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 = 1,2,3
print a
| ajibawa-2023/Python-Code-Large/train/row_89273 | 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_89273: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... | [] |
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_89274 | 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_89274: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_89274:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89274:FunctionDef_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89274:FunctionDef_L2_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_89274:Expr_L3_C8"}, {"f": "ajibawa-2023/Python-Code-L... |
a = (1,2,3,4,5,6,7,8)
print a[5::-4]
| ajibawa-2023/Python-Code-Large/train/row_89275 | 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_89275: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... | [] |
s = set([1,2,3])
copy_s = s.copy()
new_s = set(s)
copy_s.add(42)
new_s.add(13)
print s
print copy_s
print new_s
| ajibawa-2023/Python-Code-Large/train/row_89276 | 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_89276:Assign_L1_C0", "label": "s = set()", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.1111, 0.1111, 0, 0.66, 0.0, 553, 3, 1, 0, 0, 21, 10, 1], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name"... | [] |
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_89277 | 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_89277: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_89277:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89277:Expr_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89277:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89277:Assign_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
x = 1
t = 0
while x<=5:
t = t+x
x = x+1
print t
| ajibawa-2023/Python-Code-Large/train/row_89278 | 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_89278: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, 190, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "a... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_89278:While_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89278:Assign_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89278:While_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89278:Assign_L5_C4"}] |
for k in {'OK':0}: print k
| ajibawa-2023/Python-Code-Large/train/row_89279 | 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"] | [] | [] |
for i in range(10): print i
| ajibawa-2023/Python-Code-Large/train/row_89280 | 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 f(**kw):
print kw
f(a=4, b=5)
| ajibawa-2023/Python-Code-Large/train/row_89281 | 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_89281:FunctionDef_L1_C0", "label": "f", "type": "function", "loc": [1, 2], "level": 0, "parent": null, "vector": [2, 0, 0.375, 0.5, 0, 0.66, 0.0, 899, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "f", "arg_names": ["kw"], "import_names": [], "rhs_call_name": "", "annotati... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_89281:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89281:Expr_L2_C4"}] |
print "-----"
print [] and 5
print {} and 5
print False and 5
print True and 5
print "-----"
print [] or 5
print {} or 5
print False or 5
print True or 5
print "-----"
print 5 and []
print 5 and {}
print 5 and False
print 5 and True
print "-----"
print 5 or []
print 5 or {}
print 5 or False
print 5 or True
print "-----... | ajibawa-2023/Python-Code-Large/train/row_89282 | 25 | 25 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_89282:Expr_L1_C0", "label": "print()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.04, 0.04, 0, 0.66, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "an... | [] |
# 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_89283 | 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_89283: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... | [] |
class X:
pass
y = X()
print "OK"
| ajibawa-2023/Python-Code-Large/train/row_89284 | 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_89284:ClassDef_L1_C0", "label": "X", "type": "class", "loc": [1, 2], "level": 0, "parent": null, "vector": [3, 0, 0.375, 0.5, 0, 0.66, 0.0, 783, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "X", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, ... | [] |
a = [1,2,3,4,5,6]
b = [9,9,9]
a[2] = b
print a
| ajibawa-2023/Python-Code-Large/train/row_89285 | 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_89285: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 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_89286 | 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_89286: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_89286:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89286:FunctionDef_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89286:FunctionDef_L2_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_89286:FunctionDef_L3_C8"}, {"f": "ajibawa-2023/Python... |
x = (1,3)
print {x:'OK'}[x]
| ajibawa-2023/Python-Code-Large/train/row_89287 | 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_89287: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... | [] |
import sys
print [x.replace("\\", "/") for x in sys.argv]
| ajibawa-2023/Python-Code-Large/train/row_89288 | 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_89288: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": "", ... | [] |
# Test behaviour of min() and max() on lists and tuples
l = ['b','a','d','c']
m = ['1','0','4','3']
print l
print m
print min(l), max(l)
print min(m), max(m)
print min(l,m), max(l,m)
t = tuple(l)
u = tuple(m)
print t
print min(t), max(t)
print min(u), max(u)
print min(t,u), max(t,u)
| ajibawa-2023/Python-Code-Large/train/row_89289 | 13 | 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_89289:Assign_L2_C0", "label": "l =", "type": "assigned_variable", "loc": [2, 2], "level": 0, "parent": null, "vector": [14, 0, 0.1429, 0.0714, 0, 0.66, 0.0, 810, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "l", "arg_names": [], "import_names": [], "rhs_call_name": "", "a... | [] |
a = [1,2,3,4,5,6]
b = [9,10,11]
a[::2] = b
print a
| ajibawa-2023/Python-Code-Large/train/row_89290 | 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_89290: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... | [] |
def loc(): pass
def gbl(): pass
def free(): pass
def cell(): pass
def gen(): pass
def true(): pass
def var(): pass
def volatile(): pass
def package():
loc = 4
gbl = 42
cell = 19
instanceof = gbl * cell
static = instanceof
print loc, gbl, cell, instanceof, static
print true == var
print ... | ajibawa-2023/Python-Code-Large/train/row_89291 | 18 | 21 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_89291:FunctionDef_L2_C0", "label": "loc", "type": "function", "loc": [2, 2], "level": 0, "parent": null, "vector": [2, 0, 0.0952, 0.0476, 0, 0.66, 0.0, 822, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "loc", "arg_names": [], "import_names": [], "rhs_call_name": "", "anno... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_89291:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89291:Assign_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89291:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89291:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Co... |
print "aa..bbb...ccc".replace("..", "X")
| ajibawa-2023/Python-Code-Large/train/row_89292 | 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_89292: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 X:
def __init__(self):
print "wee"
x = X()
print repr(x)
| ajibawa-2023/Python-Code-Large/train/row_89293 | 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_89293:ClassDef_L1_C0", "label": "X", "type": "class", "loc": [1, 3], "level": 0, "parent": null, "vector": [3, 0, 0.4, 0.6, 0, 0.66, 0.0, 783, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "X", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "s... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_89293:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89293:FunctionDef_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89293:FunctionDef_L2_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_89293:Expr_L3_C8"}] |
a = [1,2,3,4,5]
print a[::-1]
| ajibawa-2023/Python-Code-Large/train/row_89294 | 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_89294: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, 5, 0], "semantic": {"name": "a", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat... | [] |
s = set([1,2,3])
t = set([3,4,5])
s.symmetric_difference_update(t)
t.symmetric_difference_update(s)
print s
print s == t
print s == set([1,2,4,5])
print s == set([1,2,3])
| ajibawa-2023/Python-Code-Large/train/row_89295 | 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_89295:Assign_L1_C0", "label": "s = set()", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.125, 0.125, 0, 0.66, 0.0, 553, 3, 1, 0, 0, 21, 10, 1], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name": ... | [] |
x = {"hi": "there", "yo": "I'm a dawg"}
print x.items()
print x.keys()
print x.values()
| ajibawa-2023/Python-Code-Large/train/row_89296 | 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_89296: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, 6, 0], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annot... | [] |
def x():
y = lambda x,y,z: x*y+z
print y(5, 10, 15)
x()
| ajibawa-2023/Python-Code-Large/train/row_89297 | 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_89297:FunctionDef_L1_C0", "label": "x", "type": "function", "loc": [1, 3], "level": 0, "parent": null, "vector": [2, 0, 0.5, 0.75, 0, 0.66, 0.0, 190, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_89297:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89297:Assign_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89297:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89297:Expr_L3_C4"}] |
print [y for x in range(10) for y in range(x)]
| ajibawa-2023/Python-Code-Large/train/row_89298 | 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_89298: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():
a = "dog"
print "f", a
def g():
a = "cat"
print "g", a
g()
print "f2", a
def h():
print "h",a
h()
f()
| ajibawa-2023/Python-Code-Large/train/row_89299 | 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_89299:FunctionDef_L1_C0", "label": "f", "type": "function", "loc": [1, 11], "level": 0, "parent": null, "vector": [2, 0, 0.4615, 0.8462, 0, 0.66, 0.0, 899, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_89299:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89299:Assign_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89299:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89299:Expr_L3_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
v = [3,2,1]
v.sort()
print v[0]
| ajibawa-2023/Python-Code-Large/train/row_89300 | 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_89300:Assign_L1_C0", "label": "v =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.3333, 0.3333, 0, 0.66, 0.0, 553, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "v", "arg_names": [], "import_names": [], "rhs_call_name": "", "a... | [] |
def yrange(n):
for i in range(n):
yield i
def zrange(n):
for y in yrange(n):
yield y
print list(zrange(5))
| ajibawa-2023/Python-Code-Large/train/row_89301 | 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_89301:FunctionDef_L1_C0", "label": "yrange", "type": "function", "loc": [1, 3], "level": 0, "parent": null, "vector": [2, 0, 0.2222, 0.3333, 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_89301:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89301:For_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_89301:For_L2_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_89301:Expr_L3_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/ro... |
def test(): pass
x = 1
print test()
| ajibawa-2023/Python-Code-Large/train/row_89302 | 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_89302: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... | [] |
# Test the comparison of sets
l = [1,2,3,4,1,1]
print l
s = set(l)
print s
print '# equal'
eq = set(l)
print eq
print '# forwards'
print s.isdisjoint(eq)
print s > eq
print s.issuperset(eq)
print s >= eq
print s == eq
print s != eq
print s.issubset(eq)
print s <= eq
print s < eq
print '# backwards'
print eq.isdisjoi... | ajibawa-2023/Python-Code-Large/train/row_89303 | 27 | 31 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_89303:Assign_L2_C0", "label": "l =", "type": "assigned_variable", "loc": [2, 2], "level": 0, "parent": null, "vector": [14, 0, 0.0645, 0.0323, 0, 0.66, 0.0, 810, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "l", "arg_names": [], "import_names": [], "rhs_call_name": "", "a... | [] |
def xyz(): pass
print xyz
class X:
def abc(self): pass
print X.abc
print X().abc
| ajibawa-2023/Python-Code-Large/train/row_89304 | 6 | 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_89304:FunctionDef_L1_C0", "label": "xyz", "type": "function", "loc": [1, 1], "level": 0, "parent": null, "vector": [2, 0, 0.125, 0.125, 0, 0.66, 0.0, 164, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "xyz", "arg_names": [], "import_names": [], "rhs_call_name": "", "annota... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_89304:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89304:FunctionDef_L5_C4"}] |
X = "OK"
def test(): print(X)
test()
| ajibawa-2023/Python-Code-Large/train/row_89305 | 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_89305: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, 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_89305:FunctionDef_L2_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89305:Expr_L2_C12"}] |
print {'a':[1,2,3], 'b':(5,6,7), 999: {'ok':1, 'stuff':2}}
| ajibawa-2023/Python-Code-Large/train/row_89306 | 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_89306: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 = [1,2,]
print x[1]
| ajibawa-2023/Python-Code-Large/train/row_89307 | 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_89307: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 max(3,8,2,6)
| ajibawa-2023/Python-Code-Large/train/row_89308 | 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_89308: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... | [] |
x = (1,3)
y = (1,3)
print {x:'OK'}[y]
| ajibawa-2023/Python-Code-Large/train/row_89309 | 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_89309: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... | [] |
print 2**3
| ajibawa-2023/Python-Code-Large/train/row_89310 | 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_89310: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 = [10] * 5
x[:3] += 100,100
print x
| ajibawa-2023/Python-Code-Large/train/row_89311 | 2 | 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_89311: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, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotat... | [] |
print str(range(4))[:5]
print len(range(4))
print range(4)[0]
print range(4)[1]
print range(4)[-1]
| ajibawa-2023/Python-Code-Large/train/row_89312 | 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_89312: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... | [] |
# 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_89313 | 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_89313: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... | [] |
print 1 in {1:2}
| ajibawa-2023/Python-Code-Large/train/row_89314 | 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_89314: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... | [] |
a = [1,2,3,4,5,6]
b = [9,9,9]
a[1:5] = b
print a
| ajibawa-2023/Python-Code-Large/train/row_89315 | 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_89315: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... | [] |
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_89316 | 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_89316: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_89316:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_89316:Expr_L2_C4"}] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.