code stringlengths 1 1.49M | vector listlengths 0 7.38k | snippet listlengths 0 7.38k |
|---|---|---|
def test():
print "OK"
x = test
x()
| [
[
2,
0,
0.375,
0.5,
0,
0.66,
0,
224,
0,
0,
0,
0,
0,
0,
1
],
[
8,
1,
0.5,
0.25,
1,
0.84,
0,
535,
3,
1,
0,
0,
0,
0,
1
],
[
14,
0,
0.75,
0.25,
0,
0.66,
0.5,
19... | [
"def test():\n print(\"OK\")",
" print(\"OK\")",
"x = test",
"x()"
] |
print ord('X')
| [
[
8,
0,
1,
1,
0,
0.66,
0,
535,
3,
1,
0,
0,
0,
0,
2
]
] | [
"print(ord('X'))"
] |
def test():
def fnc():
print "OK"
fnc()
test()
| [
[
2,
0,
0.5,
0.8,
0,
0.66,
0,
224,
0,
0,
0,
0,
0,
0,
2
],
[
2,
1,
0.5,
0.4,
1,
0.96,
0,
499,
0,
0,
0,
0,
0,
0,
1
],
[
8,
2,
0.6,
0.2,
2,
0.02,
0,
535,
3... | [
"def test():\n def fnc():\n print(\"OK\")\n fnc()",
" def fnc():\n print(\"OK\")",
" print(\"OK\")",
" fnc()",
"test()"
] |
a = range(4)
del a[::2]
print a
| [
[
14,
0,
0.3333,
0.3333,
0,
0.66,
0,
475,
3,
1,
0,
0,
816,
10,
1
],
[
8,
0,
1,
0.3333,
0,
0.66,
2,
535,
3,
1,
0,
0,
0,
0,
1
]
] | [
"a = range(4)",
"print(a)"
] |
def f(n):
i = 0
while i < n:
yield i
i = 100
yield i
i += 1
for i in f(50):
print i
| [
[
2,
0,
0.4,
0.7,
0,
0.66,
0,
899,
0,
1,
0,
0,
0,
0,
0
],
[
14,
1,
0.2,
0.1,
1,
0.53,
0,
826,
1,
0,
0,
0,
0,
1,
0
],
[
5,
1,
0.5,
0.5,
1,
0.53,
1,
0,
0,... | [
"def f(n):\n i = 0\n while i < n:\n yield i\n i = 100\n yield i\n i += 1",
" i = 0",
" while i < n:\n yield i\n i = 100\n yield i\n i += 1",
" yield i",
" i = 100",
" yield i",
"for i in f(50):\n print(i)",
" ... |
print {(1,3):'OK'}[(1,3)]
| [
[
8,
0,
1,
1,
0,
0.66,
0,
535,
3,
1,
0,
0,
0,
0,
1
]
] | [
"print({(1,3):'OK'}[(1,3)])"
] |
class Stuff:
def __init__(self):
print "OK"
"""
weewaa
"""
Stuff()
| [
[
3,
0,
0.5,
0.875,
0,
0.66,
0,
710,
0,
1,
0,
0,
0,
0,
1
],
[
2,
1,
0.3125,
0.25,
1,
0.31,
0,
555,
0,
1,
0,
0,
0,
0,
1
],
[
8,
2,
0.375,
0.125,
2,
0.1,
0,
5... | [
"class Stuff:\n def __init__(self):\n print(\"OK\")\n \"\"\"\n weewaa\n\n \"\"\"",
" def __init__(self):\n print(\"OK\")",
" print(\"OK\")",
" \"\"\"\n weewaa\n\n \"\"\"",
"Stuff()"
] |
print {1:'stuff', 'ok':4}
| [
[
8,
0,
1,
1,
0,
0.66,
0,
535,
3,
1,
0,
0,
0,
0,
1
]
] | [
"print({1:'stuff', 'ok':4})"
] |
class x():
pass
def f(x): return x
x.hi = f
print x.hi
| [
[
3,
0,
0.25,
0.3333,
0,
0.66,
0,
190,
0,
0,
0,
0,
0,
0,
0
],
[
2,
0,
0.6667,
0.1667,
0,
0.66,
0.3333,
899,
0,
1,
1,
0,
0,
0,
0
],
[
13,
1,
0.6667,
0.1667,
1,
0.73,... | [
"class x():\n pass",
"def f(x): return x",
"def f(x): return x",
"x.hi = f",
"print(x.hi)"
] |
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))
| [
[
8,
0,
0.0833,
0.0833,
0,
0.66,
0,
535,
3,
1,
0,
0,
0,
0,
1
],
[
8,
0,
0.1667,
0.0833,
0,
0.66,
0.1,
535,
3,
1,
0,
0,
0,
0,
2
],
[
8,
0,
0.25,
0.0833,
0,
0.66,
... | [
"print(int)",
"print(str(int))",
"print(repr(int))",
"class X:\n pass",
"x = X()",
"print(str(x))",
"print(repr(x))",
"print(str(x.__class__))",
"print(repr(x.__class__))",
"print(str(X))",
"print(repr(X))"
] |
a = 1,2,3
print a
| [
[
14,
0,
0.5,
0.5,
0,
0.66,
0,
475,
0,
0,
0,
0,
0,
8,
0
],
[
8,
0,
1,
0.5,
0,
0.66,
1,
535,
3,
1,
0,
0,
0,
0,
1
]
] | [
"a = 1,2,3",
"print(a)"
] |
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()... | [
[
3,
0,
0.0641,
0.1026,
0,
0.66,
0,
710,
0,
1,
0,
0,
186,
0,
1
],
[
2,
1,
0.0769,
0.0769,
1,
0.49,
0,
271,
0,
2,
1,
0,
0,
0,
1
],
[
8,
2,
0.0769,
0.0256,
2,
0.87,
... | [
"class Stuff(object):\n def __cmp__(self, rhs):\n print(\"stuff cmp\")\n return 0",
" def __cmp__(self, rhs):\n print(\"stuff cmp\")\n return 0",
" print(\"stuff cmp\")",
" return 0",
"class Things(object):\n def __cmp__(self, rhs):\n print(\"things ... |
a = (1,2,3,4,5,6,7,8)
print a[5::-4]
| [
[
14,
0,
0.5,
0.5,
0,
0.66,
0,
475,
0,
0,
0,
0,
0,
8,
0
],
[
8,
0,
1,
0.5,
0,
0.66,
1,
535,
3,
1,
0,
0,
0,
0,
1
]
] | [
"a = (1,2,3,4,5,6,7,8)",
"print(a[5::-4])"
] |
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
| [
[
14,
0,
0.1111,
0.1111,
0,
0.66,
0,
553,
3,
1,
0,
0,
21,
10,
1
],
[
14,
0,
0.2222,
0.1111,
0,
0.66,
0.1429,
505,
3,
0,
0,
0,
739,
10,
1
],
[
14,
0,
0.3333,
0.1111,
0,
... | [
"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)"
] |
def funky():
print "cheese"
def gen():
i = 0
funky()
yield 1
i += 1
g = gen()
print g.next()
| [
[
2,
0,
0.1364,
0.1818,
0,
0.66,
0,
700,
0,
0,
0,
0,
0,
0,
1
],
[
8,
1,
0.1818,
0.0909,
1,
0.72,
0,
535,
3,
1,
0,
0,
0,
0,
1
],
[
2,
0,
0.5455,
0.4545,
0,
0.66,
... | [
"def funky():\n print(\"cheese\")",
" print(\"cheese\")",
"def gen():\n i = 0\n funky()\n yield 1\n i += 1",
" i = 0",
" funky()",
" yield 1",
"g = gen()",
"print(g.next())"
] |
x = 1
t = 0
while x<=5:
t = t+x
x = x+1
print t
| [
[
14,
0,
0.1667,
0.1667,
0,
0.66,
0,
190,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.3333,
0.1667,
0,
0.66,
0.3333,
15,
1,
0,
0,
0,
0,
1,
0
],
[
5,
0,
0.6667,
0.5,
0,
0.66,
... | [
"x = 1",
"t = 0",
"while x<=5:\n t = t+x\n x = x+1",
" t = t+x",
" x = x+1",
"print(t)"
] |
for k in {'OK':0}: print k
| [] | [] |
for i in range(10): print i
| [] | [] |
def f(**kw):
print kw
f(a=4, b=5)
| [
[
2,
0,
0.375,
0.5,
0,
0.66,
0,
899,
0,
1,
0,
0,
0,
0,
1
],
[
8,
1,
0.5,
0.25,
1,
0.03,
0,
535,
3,
1,
0,
0,
0,
0,
1
],
[
8,
0,
1,
0.25,
0,
0.66,
1,
899,
... | [
"def f(**kw):\n print(kw)",
" print(kw)",
"f(a=4, b=5)"
] |
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 "-----... | [
[
8,
0,
0.04,
0.04,
0,
0.66,
0,
535,
3,
1,
0,
0,
0,
0,
1
],
[
8,
0,
0.08,
0.04,
0,
0.66,
0.0417,
535,
3,
1,
0,
0,
0,
0,
1
],
[
8,
0,
0.12,
0.04,
0,
0.66,
0.0833... | [
"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 a... |
# Test that min & max work on dicts
d = {'foo':2, 'bar':3}
print d
print min(d)
print max(d)
| [
[
14,
0,
0.4,
0.2,
0,
0.66,
0,
355,
0,
0,
0,
0,
0,
6,
0
],
[
8,
0,
0.6,
0.2,
0,
0.66,
0.3333,
535,
3,
1,
0,
0,
0,
0,
1
],
[
8,
0,
0.8,
0.2,
0,
0.66,
0.6667,
... | [
"d = {'foo':2, 'bar':3}",
"print(d)",
"print(min(d))",
"print(max(d))"
] |
class X:
pass
y = X()
print "OK"
| [
[
3,
0,
0.375,
0.5,
0,
0.66,
0,
783,
0,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.75,
0.25,
0,
0.66,
0.5,
304,
3,
0,
0,
0,
783,
10,
1
],
[
8,
0,
1,
0.25,
0,
0.66,
1,
5... | [
"class X:\n pass",
"y = X()",
"print(\"OK\")"
] |
a = [1,2,3,4,5,6]
b = [9,9,9]
a[2] = b
print a
| [
[
14,
0,
0.25,
0.25,
0,
0.66,
0,
475,
0,
0,
0,
0,
0,
5,
0
],
[
14,
0,
0.5,
0.25,
0,
0.66,
0.3333,
756,
0,
0,
0,
0,
0,
5,
0
],
[
14,
0,
0.75,
0.25,
0,
0.66,
0.66... | [
"a = [1,2,3,4,5,6]",
"b = [9,9,9]",
"a[2] = b",
"print(a)"
] |
class Stuff:
def __init__(self):
def tmp():
self.things()
self.x = tmp
def things(self):
print "OK"
y = Stuff()
y.x()
| [
[
3,
0,
0.4444,
0.7778,
0,
0.66,
0,
710,
0,
3,
0,
0,
0,
0,
2
],
[
2,
1,
0.3889,
0.4444,
1,
0.18,
0,
555,
0,
1,
0,
0,
0,
0,
1
],
[
2,
2,
0.3889,
0.2222,
2,
0.56,
... | [
"class Stuff:\n def __init__(self):\n def tmp():\n self.things()\n self.x = tmp\n def things(self):\n print(\"OK\")",
" def __init__(self):\n def tmp():\n self.things()\n self.x = tmp",
" def tmp():\n self.things()",
" ... |
x = (1,3)
print {x:'OK'}[x]
| [
[
14,
0,
0.5,
0.5,
0,
0.66,
0,
190,
0,
0,
0,
0,
0,
8,
0
],
[
8,
0,
1,
0.5,
0,
0.66,
1,
535,
3,
1,
0,
0,
0,
0,
1
]
] | [
"x = (1,3)",
"print({x:'OK'}[x])"
] |
import sys
print [x.replace("\\", "/") for x in sys.argv]
| [
[
1,
0,
0.5,
0.5,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
8,
0,
1,
0.5,
0,
0.66,
1,
535,
3,
1,
0,
0,
0,
0,
2
]
] | [
"import sys",
"print([x.replace(\"\\\\\", \"/\") for x in sys.argv])"
] |
# 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)
| [
[
14,
0,
0.1429,
0.0714,
0,
0.66,
0,
810,
0,
0,
0,
0,
0,
5,
0
],
[
14,
0,
0.2143,
0.0714,
0,
0.66,
0.0833,
711,
0,
0,
0,
0,
0,
5,
0
],
[
8,
0,
0.2857,
0.0714,
0,
0.... | [
"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))"
] |
a = [1,2,3,4,5,6]
b = [9,10,11]
a[::2] = b
print a
| [
[
14,
0,
0.25,
0.25,
0,
0.66,
0,
475,
0,
0,
0,
0,
0,
5,
0
],
[
14,
0,
0.5,
0.25,
0,
0.66,
0.3333,
756,
0,
0,
0,
0,
0,
5,
0
],
[
14,
0,
0.75,
0.25,
0,
0.66,
0.66... | [
"a = [1,2,3,4,5,6]",
"b = [9,10,11]",
"a[::2] = b",
"print(a)"
] |
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 ... | [
[
2,
0,
0.0952,
0.0476,
0,
0.66,
0,
822,
0,
0,
0,
0,
0,
0,
0
],
[
2,
0,
0.1429,
0.0476,
0,
0.66,
0.1111,
198,
0,
0,
0,
0,
0,
0,
0
],
[
2,
0,
0.1905,
0.0476,
0,
0.66... | [
"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():\n loc = 4\n gbl = 42\n cell = 19\n instanceof = gbl * cell\n static = instanceof\n print(loc, gbl, cell, i... |
print "aa..bbb...ccc".replace("..", "X")
| [
[
8,
0,
1,
1,
0,
0.66,
0,
535,
3,
1,
0,
0,
0,
0,
2
]
] | [
"print(\"aa..bbb...ccc\".replace(\"..\", \"X\"))"
] |
class X:
def __init__(self):
print "wee"
x = X()
print repr(x)
| [
[
3,
0,
0.4,
0.6,
0,
0.66,
0,
783,
0,
1,
0,
0,
0,
0,
1
],
[
2,
1,
0.5,
0.4,
1,
0.69,
0,
555,
0,
1,
0,
0,
0,
0,
1
],
[
8,
2,
0.6,
0.2,
2,
0,
0,
535,
3,
... | [
"class X:\n def __init__(self):\n print(\"wee\")",
" def __init__(self):\n print(\"wee\")",
" print(\"wee\")",
"x = X()",
"print(repr(x))"
] |
a = [1,2,3,4,5]
print a[::-1]
| [
[
14,
0,
0.5,
0.5,
0,
0.66,
0,
475,
0,
0,
0,
0,
0,
5,
0
],
[
8,
0,
1,
0.5,
0,
0.66,
1,
535,
3,
1,
0,
0,
0,
0,
1
]
] | [
"a = [1,2,3,4,5]",
"print(a[::-1])"
] |
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])
| [
[
14,
0,
0.125,
0.125,
0,
0.66,
0,
553,
3,
1,
0,
0,
21,
10,
1
],
[
14,
0,
0.25,
0.125,
0,
0.66,
0.1429,
15,
3,
1,
0,
0,
21,
10,
1
],
[
8,
0,
0.375,
0.125,
0,
0.66,
... | [
"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]))"
] |
x = {"hi": "there", "yo": "I'm a dawg"}
print x.items()
print x.keys()
print x.values()
| [
[
14,
0,
0.25,
0.25,
0,
0.66,
0,
190,
0,
0,
0,
0,
0,
6,
0
],
[
8,
0,
0.5,
0.25,
0,
0.66,
0.3333,
535,
3,
1,
0,
0,
0,
0,
2
],
[
8,
0,
0.75,
0.25,
0,
0.66,
0.6667... | [
"x = {\"hi\": \"there\", \"yo\": \"I'm a dawg\"}",
"print(x.items())",
"print(x.keys())",
"print(x.values())"
] |
def x():
y = lambda x,y,z: x*y+z
print y(5, 10, 15)
x()
| [
[
2,
0,
0.5,
0.75,
0,
0.66,
0,
190,
0,
0,
0,
0,
0,
0,
2
],
[
14,
1,
0.5,
0.25,
1,
0.46,
0,
304,
9,
0,
0,
0,
0,
0,
0
],
[
8,
1,
0.75,
0.25,
1,
0.46,
1,
535,
... | [
"def x():\n y = lambda x,y,z: x*y+z\n print(y(5, 10, 15))",
" y = lambda x,y,z: x*y+z",
" print(y(5, 10, 15))",
"x()"
] |
print [y for x in range(10) for y in range(x)]
| [
[
8,
0,
1,
1,
0,
0.66,
0,
535,
3,
1,
0,
0,
0,
0,
3
]
] | [
"print([y for x in range(10) for y in range(x)])"
] |
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()
| [
[
2,
0,
0.4615,
0.8462,
0,
0.66,
0,
899,
0,
0,
0,
0,
0,
0,
6
],
[
14,
1,
0.1538,
0.0769,
1,
0.33,
0,
475,
1,
0,
0,
0,
0,
3,
0
],
[
8,
1,
0.2308,
0.0769,
1,
0.33,
... | [
"def f():\n a = \"dog\"\n print(\"f\", a)\n def g():\n a = \"cat\"\n print(\"g\", a)\n g()\n print(\"f2\", a)",
" a = \"dog\"",
" print(\"f\", a)",
" def g():\n a = \"cat\"\n print(\"g\", a)",
" a = \"cat\"",
" print(\"g\", a)",
" g()"... |
v = [3,2,1]
v.sort()
print v[0]
| [
[
14,
0,
0.3333,
0.3333,
0,
0.66,
0,
553,
0,
0,
0,
0,
0,
5,
0
],
[
8,
0,
0.6667,
0.3333,
0,
0.66,
0.5,
489,
3,
0,
0,
0,
0,
0,
1
],
[
8,
0,
1,
0.3333,
0,
0.66,
1... | [
"v = [3,2,1]",
"v.sort()",
"print(v[0])"
] |
def yrange(n):
for i in range(n):
yield i
def zrange(n):
for y in yrange(n):
yield y
print list(zrange(5))
| [
[
2,
0,
0.2222,
0.3333,
0,
0.66,
0,
187,
0,
1,
0,
0,
0,
0,
1
],
[
6,
1,
0.2778,
0.2222,
1,
0.06,
0,
826,
3,
0,
0,
0,
0,
0,
1
],
[
8,
2,
0.3333,
0.1111,
2,
0.28,
... | [
"def yrange(n):\n for i in range(n):\n yield i",
" for i in range(n):\n yield i",
" yield i",
"def zrange(n):\n for y in yrange(n):\n yield y",
" for y in yrange(n):\n yield y",
" yield y",
"print(list(zrange(5)))"
] |
def test(): pass
x = 1
print test()
| [
[
2,
0,
0.3333,
0.3333,
0,
0.66,
0,
224,
0,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.6667,
0.3333,
0,
0.66,
0.5,
190,
1,
0,
0,
0,
0,
1,
0
],
[
8,
0,
1,
0.3333,
0,
0.66,
1... | [
"def test(): pass",
"x = 1",
"print(test())"
] |
# 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... | [
[
14,
0,
0.0645,
0.0323,
0,
0.66,
0,
810,
0,
0,
0,
0,
0,
5,
0
],
[
8,
0,
0.0968,
0.0323,
0,
0.66,
0.0385,
535,
3,
1,
0,
0,
0,
0,
1
],
[
14,
0,
0.129,
0.0323,
0,
0.6... | [
"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... |
def xyz(): pass
print xyz
class X:
def abc(self): pass
print X.abc
print X().abc
| [
[
2,
0,
0.125,
0.125,
0,
0.66,
0,
164,
0,
0,
0,
0,
0,
0,
0
],
[
8,
0,
0.25,
0.125,
0,
0.66,
0.25,
535,
3,
1,
0,
0,
0,
0,
1
],
[
3,
0,
0.5625,
0.25,
0,
0.66,
0.5... | [
"def xyz(): pass",
"print(xyz)",
"class X:\n def abc(self): pass",
" def abc(self): pass",
"print(X.abc)",
"print(X().abc)"
] |
X = "OK"
def test(): print(X)
test()
| [
[
14,
0,
0.3333,
0.3333,
0,
0.66,
0,
783,
1,
0,
0,
0,
0,
3,
0
],
[
2,
0,
0.6667,
0.3333,
0,
0.66,
0.5,
224,
0,
0,
0,
0,
0,
0,
1
],
[
8,
1,
0.6667,
0.3333,
1,
0.51,
... | [
"X = \"OK\"",
"def test(): print(X)",
"def test(): print(X)",
"test()"
] |
print {'a':[1,2,3], 'b':(5,6,7), 999: {'ok':1, 'stuff':2}}
| [
[
8,
0,
1,
1,
0,
0.66,
0,
535,
3,
1,
0,
0,
0,
0,
1
]
] | [
"print({'a':[1,2,3], 'b':(5,6,7), 999: {'ok':1, 'stuff':2}})"
] |
x = [1,2,]
print x[1]
| [
[
14,
0,
0.5,
0.5,
0,
0.66,
0,
190,
0,
0,
0,
0,
0,
5,
0
],
[
8,
0,
1,
0.5,
0,
0.66,
1,
535,
3,
1,
0,
0,
0,
0,
1
]
] | [
"x = [1,2,]",
"print(x[1])"
] |
print max(3,8,2,6)
| [
[
8,
0,
1,
1,
0,
0.66,
0,
535,
3,
1,
0,
0,
0,
0,
2
]
] | [
"print(max(3,8,2,6))"
] |
x = (1,3)
y = (1,3)
print {x:'OK'}[y]
| [
[
14,
0,
0.3333,
0.3333,
0,
0.66,
0,
190,
0,
0,
0,
0,
0,
8,
0
],
[
14,
0,
0.6667,
0.3333,
0,
0.66,
0.5,
304,
0,
0,
0,
0,
0,
8,
0
],
[
8,
0,
1,
0.3333,
0,
0.66,
... | [
"x = (1,3)",
"y = (1,3)",
"print({x:'OK'}[y])"
] |
print 2**3
| [
[
8,
0,
1,
1,
0,
0.66,
0,
535,
3,
1,
0,
0,
0,
0,
1
]
] | [
"print(2**3)"
] |
x = [10] * 5
x[:3] += 100,100
print x
| [
[
14,
0,
0.2,
0.2,
0,
0.66,
0,
190,
4,
0,
0,
0,
0,
0,
0
],
[
8,
0,
1,
0.2,
0,
0.66,
2,
535,
3,
1,
0,
0,
0,
0,
1
]
] | [
"x = [10] * 5",
"print(x)"
] |
print str(range(4))[:5]
print len(range(4))
print range(4)[0]
print range(4)[1]
print range(4)[-1]
| [
[
8,
0,
0.2,
0.2,
0,
0.66,
0,
535,
3,
1,
0,
0,
0,
0,
3
],
[
8,
0,
0.4,
0.2,
0,
0.66,
0.25,
535,
3,
1,
0,
0,
0,
0,
3
],
[
8,
0,
0.6,
0.2,
0,
0.66,
0.5,
535,
... | [
"print(str(range(4))[:5])",
"print(len(range(4)))",
"print(range(4)[0])",
"print(range(4)[1])",
"print(range(4)[-1])"
] |
# Test that min & max work on sets
s = set([1,2,3])
print s
print min(s)
print max(s)
| [
[
14,
0,
0.4,
0.2,
0,
0.66,
0,
553,
3,
1,
0,
0,
21,
10,
1
],
[
8,
0,
0.6,
0.2,
0,
0.66,
0.3333,
535,
3,
1,
0,
0,
0,
0,
1
],
[
8,
0,
0.8,
0.2,
0,
0.66,
0.6667,
... | [
"s = set([1,2,3])",
"print(s)",
"print(min(s))",
"print(max(s))"
] |
print 1 in {1:2}
| [
[
8,
0,
1,
1,
0,
0.66,
0,
535,
3,
1,
0,
0,
0,
0,
1
]
] | [
"print(1 in {1:2})"
] |
a = [1,2,3,4,5,6]
b = [9,9,9]
a[1:5] = b
print a
| [
[
14,
0,
0.25,
0.25,
0,
0.66,
0,
475,
0,
0,
0,
0,
0,
5,
0
],
[
14,
0,
0.5,
0.25,
0,
0.66,
0.3333,
756,
0,
0,
0,
0,
0,
5,
0
],
[
14,
0,
0.75,
0.25,
0,
0.66,
0.66... | [
"a = [1,2,3,4,5,6]",
"b = [9,9,9]",
"a[1:5] = b",
"print(a)"
] |
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")
| [
[
2,
0,
0.1667,
0.2222,
0,
0.66,
0,
48,
0,
3,
0,
0,
0,
0,
1
],
[
8,
1,
0.2222,
0.1111,
1,
0.19,
0,
535,
3,
4,
0,
0,
0,
0,
1
],
[
8,
0,
0.4444,
0.1111,
0,
0.66,
... | [
"def wee(waa, woo=False, wii=True):\n print(\"OK\", waa, woo, wii)",
" 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=\"bl... |
z = 0
for x in [1,2,3]:
z += x
print z
| [
[
14,
0,
0.25,
0.25,
0,
0.66,
0,
859,
1,
0,
0,
0,
0,
1,
0
],
[
6,
0,
0.625,
0.5,
0,
0.66,
0.5,
190,
0,
0,
0,
0,
0,
0,
0
],
[
8,
0,
1,
0.25,
0,
0.66,
1,
535,... | [
"z = 0",
"for x in [1,2,3]:\n z += x",
"print(z)"
] |
def f():
for i in 1,2,3,4,5:
if i == 4: return
yield i
print list(f())
| [
[
2,
0,
0.5,
0.8,
0,
0.66,
0,
899,
0,
0,
0,
0,
0,
0,
0
],
[
6,
1,
0.6,
0.6,
1,
0.22,
0,
826,
0,
0,
0,
0,
0,
0,
0
],
[
4,
2,
0.6,
0.2,
2,
0.67,
0,
0,
0,
... | [
"def f():\n for i in 1,2,3,4,5:\n if i == 4: return\n yield i",
" for i in 1,2,3,4,5:\n if i == 4: return\n yield i",
" if i == 4: return",
" if i == 4: return",
" yield i",
"print(list(f()))"
] |
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
| [
[
2,
0,
0.2,
0.3333,
0,
0.66,
0,
56,
0,
1,
0,
0,
0,
0,
3
],
[
6,
1,
0.2333,
0.2667,
1,
0.49,
0,
826,
3,
0,
0,
0,
0,
0,
3
],
[
8,
2,
0.2,
0.0667,
2,
0.71,
0,
... | [
"def mygen(upto):\n for i in range(0, upto):\n print('i',i)\n got = yield i\n print('got',got)",
" for i in range(0, upto):\n print('i',i)\n got = yield i\n print('got',got)",
" print('i',i)",
" got = yield i",
" print('got',got)",
"handle = mygen(... |
x = [1]
x.extend([2,3])
print(x[1])
| [
[
14,
0,
0.3333,
0.3333,
0,
0.66,
0,
190,
0,
0,
0,
0,
0,
5,
0
],
[
8,
0,
0.6667,
0.3333,
0,
0.66,
0.5,
660,
3,
1,
0,
0,
0,
0,
1
],
[
8,
0,
1,
0.3333,
0,
0.66,
1... | [
"x = [1]",
"x.extend([2,3])",
"print(x[1])"
] |
print 2^7
| [
[
8,
0,
1,
1,
0,
0.66,
0,
535,
3,
1,
0,
0,
0,
0,
1
]
] | [
"print(2^7)"
] |
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()
| [
[
2,
0,
0.1667,
0.25,
0,
0.66,
0,
899,
0,
1,
0,
0,
0,
0,
0
],
[
6,
1,
0.2083,
0.1667,
1,
0.08,
0,
826,
0,
0,
0,
0,
0,
0,
0
],
[
8,
2,
0.25,
0.0833,
2,
0.34,
0,
... | [
"def f(l):\n for i in 1,2,3,4,5:\n yield l, i",
" for i in 1,2,3,4,5:\n yield l, i",
" 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())",
"prin... |
print 7^2&2
| [
[
8,
0,
1,
1,
0,
0.66,
0,
535,
3,
1,
0,
0,
0,
0,
1
]
] | [
"print(7^2&2)"
] |
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
| [
[
14,
0,
0.1111,
0.1111,
0,
0.66,
0,
190,
1,
0,
0,
0,
0,
1,
0
],
[
8,
0,
0.2222,
0.1111,
0,
0.66,
0.125,
535,
3,
1,
0,
0,
0,
0,
1
],
[
8,
0,
0.3333,
0.1111,
0,
0.66... | [
"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)"
] |
print [c for c in "asdf"]
| [
[
8,
0,
1,
1,
0,
0.66,
0,
535,
3,
1,
0,
0,
0,
0,
1
]
] | [
"print([c for c in \"asdf\"])"
] |
print "1234"[1:3]
| [
[
8,
0,
1,
1,
0,
0.66,
0,
535,
3,
1,
0,
0,
0,
0,
1
]
] | [
"print(\"1234\"[1:3])"
] |
print " hello ".partition("x")
print " hello ".rpartition("x")
| [
[
8,
0,
0.5,
0.5,
0,
0.66,
0,
535,
3,
1,
0,
0,
0,
0,
2
],
[
8,
0,
1,
0.5,
0,
0.66,
1,
535,
3,
1,
0,
0,
0,
0,
2
]
] | [
"print(\" hello \".partition(\"x\"))",
"print(\" hello \".rpartition(\"x\"))"
] |
print True and True
| [
[
8,
0,
1,
1,
0,
0.66,
0,
535,
3,
1,
0,
0,
0,
0,
1
]
] | [
"print(True and True)"
] |
print [x for x in range(1,10) if False] or ["hello" for x in range(1,10) if True]
| [
[
8,
0,
1,
1,
0,
0.66,
0,
535,
3,
1,
0,
0,
0,
0,
3
]
] | [
"print([x for x in range(1,10) if False] or [\"hello\" for x in range(1,10) if True])"
] |
s = 'abcd'
print s[::-1]
| [
[
14,
0,
0.5,
0.5,
0,
0.66,
0,
553,
1,
0,
0,
0,
0,
3,
0
],
[
8,
0,
1,
0.5,
0,
0.66,
1,
535,
3,
1,
0,
0,
0,
0,
1
]
] | [
"s = 'abcd'",
"print(s[::-1])"
] |
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... | [
[
8,
0,
0.0526,
0.0526,
0,
0.66,
0,
535,
3,
1,
0,
0,
0,
0,
2
],
[
8,
0,
0.1053,
0.0526,
0,
0.66,
0.0556,
535,
3,
1,
0,
0,
0,
0,
2
],
[
8,
0,
0.1579,
0.0526,
0,
0.66... | [
"print(int(3))",
"print(int(3.2))",
"print(int(3.8))",
"print(int(-3.2))",
"print(int(-3.8))",
"print(int(0x13))",
"print(\"------\")",
"print(int(\"3\"))",
"print(int(\"013\"))",
"print(\"------\")",
"print(int(\"13\", 8))",
"print(int(\"013\", 8))",
"print(\"------\")",
"print(int(\"13\"... |
print "".join(["O"]+["K"])
| [
[
8,
0,
1,
1,
0,
0.66,
0,
535,
3,
1,
0,
0,
0,
0,
2
]
] | [
"print(\"\".join([\"O\"]+[\"K\"]))"
] |
print "-".join(["O","K"])
| [
[
8,
0,
1,
1,
0,
0.66,
0,
535,
3,
1,
0,
0,
0,
0,
2
]
] | [
"print(\"-\".join([\"O\",\"K\"]))"
] |
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()
| [
[
6,
0,
0.0882,
0.1176,
0,
0.66,
0,
798,
0,
0,
0,
0,
0,
0,
1
],
[
8,
1,
0.1176,
0.0588,
1,
0.57,
0,
535,
3,
1,
0,
0,
0,
0,
1
],
[
2,
0,
0.5882,
0.7647,
0,
0.66,
... | [
"for const in (1,2,3):\n print(const)",
" print(const)",
"def f():\n for const in (1,2,3):\n print(const)\n for object in (1,2,3):\n print(object)\n instanceof = 5\n void = 6\n var = 7",
" for const in (1,2,3):\n print(const)",
" print(const)",
" for ... |
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()
| [
[
2,
0,
0.25,
0.375,
0,
0.66,
0,
899,
0,
1,
0,
0,
0,
0,
1
],
[
6,
1,
0.3125,
0.25,
1,
0.63,
0,
826,
3,
0,
0,
0,
0,
0,
1
],
[
8,
2,
0.375,
0.125,
2,
0.66,
0,
... | [
"def f(n):\n for i in range(n):\n yield i",
" for i in range(n):\n yield i",
" yield i",
"g = f(5)",
"print(g.next())",
"print(g.next())",
"print(g.next())",
"print(g.next())"
] |
print slice(1,2)
| [
[
8,
0,
1,
1,
0,
0.66,
0,
535,
3,
1,
0,
0,
0,
0,
2
]
] | [
"print(slice(1,2))"
] |
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()
| [
[
3,
0,
0.2222,
0.3889,
0,
0.66,
0,
56,
0,
2,
0,
0,
186,
0,
3
],
[
2,
1,
0.1389,
0.1111,
1,
0.58,
0,
993,
0,
1,
0,
0,
0,
0,
1
],
[
8,
2,
0.1667,
0.0556,
2,
0.01,
... | [
"class Base(object):\n def myfunc(self):\n print(\"Base.myfunc\")\n\n def stuff(self):\n print(\"Base.stuff\")\n self.myfunc()",
" def myfunc(self):\n print(\"Base.myfunc\")",
" print(\"Base.myfunc\")",
" def stuff(self):\n print(\"Base.stuff\")\n s... |
x=2
x+=3
print x
| [
[
14,
0,
0.3333,
0.3333,
0,
0.66,
0,
190,
1,
0,
0,
0,
0,
1,
0
],
[
8,
0,
1,
0.3333,
0,
0.66,
2,
535,
3,
1,
0,
0,
0,
0,
1
]
] | [
"x=2",
"print(x)"
] |
print str(range(-4))[:5]
print len(range(-4))
| [
[
8,
0,
0.5,
0.5,
0,
0.66,
0,
535,
3,
1,
0,
0,
0,
0,
3
],
[
8,
0,
1,
0.5,
0,
0.66,
1,
535,
3,
1,
0,
0,
0,
0,
3
]
] | [
"print(str(range(-4))[:5])",
"print(len(range(-4)))"
] |
# 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()()
| [
[
14,
0,
0.2143,
0.0714,
0,
0.66,
0,
411,
1,
0,
0,
0,
0,
3,
0
],
[
2,
0,
0.6071,
0.7143,
0,
0.66,
0.5,
190,
0,
0,
1,
0,
0,
0,
3
],
[
14,
1,
0.3571,
0.0714,
1,
0.96,... | [
"c = \"squirrel\"",
"def x():\n b = \"dog\"\n print(b, c)\n def y():\n a = \"cat\"\n print(a,b)\n def z():\n return a,b,c",
" b = \"dog\"",
" print(b, c)",
" def y():\n a = \"cat\"\n print(a,b)\n def z():\n return a,b,c\n ... |
print float('inf')
print float('-inf')
| [
[
8,
0,
0.5,
0.5,
0,
0.66,
0,
535,
3,
1,
0,
0,
0,
0,
2
],
[
8,
0,
1,
0.5,
0,
0.66,
1,
535,
3,
1,
0,
0,
0,
0,
2
]
] | [
"print(float('inf'))",
"print(float('-inf'))"
] |
def f():
for i in 1,2,3,4,5:
if i % 2 == 0: continue
yield i
print list(f())
| [
[
2,
0,
0.4167,
0.6667,
0,
0.66,
0,
899,
0,
0,
0,
0,
0,
0,
0
],
[
6,
1,
0.5,
0.5,
1,
0.47,
0,
826,
0,
0,
0,
0,
0,
0,
0
],
[
4,
2,
0.5,
0.1667,
2,
0.17,
0,
0... | [
"def f():\n for i in 1,2,3,4,5:\n if i % 2 == 0: continue\n yield i",
" for i in 1,2,3,4,5:\n if i % 2 == 0: continue\n yield i",
" if i % 2 == 0: continue",
" yield i",
"print(list(f()))"
] |
for i in (i*2 for i in range(3)):
print i
| [
[
6,
0,
0.75,
1,
0,
0.66,
0,
826,
5,
0,
0,
0,
0,
0,
2
],
[
8,
1,
1,
0.5,
1,
0.85,
0,
535,
3,
1,
0,
0,
0,
0,
1
]
] | [
"for i in (i*2 for i in range(3)):\n print(i)",
" print(i)"
] |
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])
| [
[
14,
0,
0.05,
0.05,
0,
0.66,
0,
553,
3,
1,
0,
0,
21,
10,
1
],
[
14,
0,
0.1,
0.05,
0,
0.66,
0.0714,
15,
3,
1,
0,
0,
21,
10,
1
],
[
14,
0,
0.15,
0.05,
0,
0.66,
0... | [
"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 ==... |
print False == 0
print True == 1
print True == 2
| [
[
8,
0,
0.3333,
0.3333,
0,
0.66,
0,
535,
3,
1,
0,
0,
0,
0,
1
],
[
8,
0,
0.6667,
0.3333,
0,
0.66,
0.5,
535,
3,
1,
0,
0,
0,
0,
1
],
[
8,
0,
1,
0.3333,
0,
0.66,
1,... | [
"print(False == 0)",
"print(True == 1)",
"print(True == 2)"
] |
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... | [
[
2,
0,
0.75,
1,
0,
0.66,
0,
245,
0,
2,
0,
0,
0,
0,
1
],
[
8,
1,
1,
0.5,
1,
0.21,
0,
535,
3,
1,
0,
0,
0,
0,
1
]
] | [
"def do(fmt, val):\n print(fmt % val)",
" print(fmt % val)"
] |
print 7^2|4
| [
[
8,
0,
1,
1,
0,
0.66,
0,
535,
3,
1,
0,
0,
0,
0,
1
]
] | [
"print(7^2|4)"
] |
z = 0
for x in range(1,4):
z += x
print z
| [
[
14,
0,
0.25,
0.25,
0,
0.66,
0,
859,
1,
0,
0,
0,
0,
1,
0
],
[
6,
0,
0.625,
0.5,
0,
0.66,
0.5,
190,
3,
0,
0,
0,
0,
0,
1
],
[
8,
0,
1,
0.25,
0,
0.66,
1,
535,... | [
"z = 0",
"for x in range(1,4):\n z += x",
"print(z)"
] |
class X:
def __init__(self):
self.px = 3
def y(self):
l = "xyz"
if len(l) == self.px:
print "OK"
x = X()
x.y()
| [
[
3,
0,
0.4444,
0.7778,
0,
0.66,
0,
783,
0,
2,
0,
0,
0,
0,
2
],
[
2,
1,
0.2778,
0.2222,
1,
0.37,
0,
555,
0,
1,
0,
0,
0,
0,
0
],
[
14,
2,
0.3333,
0.1111,
2,
0.25,
... | [
"class X:\n def __init__(self):\n self.px = 3\n def y(self):\n l = \"xyz\"\n if len(l) == self.px:\n print(\"OK\")",
" def __init__(self):\n self.px = 3",
" self.px = 3",
" def y(self):\n l = \"xyz\"\n if len(l) == self.px:\n p... |
x = {1:2}
del x[1]
print len(x)
| [
[
14,
0,
0.3333,
0.3333,
0,
0.66,
0,
190,
0,
0,
0,
0,
0,
6,
0
],
[
8,
0,
1,
0.3333,
0,
0.66,
2,
535,
3,
1,
0,
0,
0,
0,
2
]
] | [
"x = {1:2}",
"print(len(x))"
] |
a = 4
def test(z):
for i in range(0,a):
z += i
return z
print test(1)
| [
[
14,
0,
0.1667,
0.1667,
0,
0.66,
0,
475,
1,
0,
0,
0,
0,
1,
0
],
[
2,
0,
0.5833,
0.6667,
0,
0.66,
0.5,
224,
0,
1,
1,
0,
0,
0,
1
],
[
6,
1,
0.5833,
0.3333,
1,
0.6,
... | [
"a = 4",
"def test(z):\n for i in range(0,a):\n z += i\n return z",
" for i in range(0,a):\n z += i",
" return z",
"print(test(1))"
] |
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"... | [
[
14,
0,
0.0455,
0.0455,
0,
0.66,
0,
411,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.0909,
0.0455,
0,
0.66,
0.25,
654,
1,
0,
0,
0,
0,
1,
0
],
[
2,
0,
0.4773,
0.7273,
0,
0.66... | [
"c = \"squirrel\"",
"time = 0",
"def x():\n global time\n time += 1\n if time == 1:\n b = \"dog\"\n else:\n b = \"banana\"\n print(b, c)",
" if time == 1:\n b = \"dog\"\n else:\n b = \"banana\"",
" b = \"dog\"",
" b = \"banana\"",
" print... |
a = [1,2,3,4,5,6]
b = [9,9,9]
a[1:2] = b
print a
| [
[
14,
0,
0.25,
0.25,
0,
0.66,
0,
475,
0,
0,
0,
0,
0,
5,
0
],
[
14,
0,
0.5,
0.25,
0,
0.66,
0.3333,
756,
0,
0,
0,
0,
0,
5,
0
],
[
14,
0,
0.75,
0.25,
0,
0.66,
0.66... | [
"a = [1,2,3,4,5,6]",
"b = [9,9,9]",
"a[1:2] = b",
"print(a)"
] |
import this
| [
[
1,
0,
1,
1,
0,
0.66,
0,
324,
0,
1,
0,
0,
324,
0,
0
]
] | [
"import this"
] |
class X:
def stuff(self):
pass
x = X()
f = getattr(x, "stuff")
print f
fu = getattr(X, "stuff")
print fu
| [
[
3,
0,
0.25,
0.375,
0,
0.66,
0,
783,
0,
1,
0,
0,
0,
0,
0
],
[
2,
1,
0.3125,
0.25,
1,
0.75,
0,
686,
0,
1,
0,
0,
0,
0,
0
],
[
14,
0,
0.5,
0.125,
0,
0.66,
0.2,
... | [
"class X:\n def stuff(self):\n pass",
" def stuff(self):\n pass",
"x = X()",
"f = getattr(x, \"stuff\")",
"print(f)",
"fu = getattr(X, \"stuff\")",
"print(fu)"
] |
def test(x):
return x
y = test(1)*2 + test(3)*4 + test(5)*6
print y
| [
[
2,
0,
0.375,
0.5,
0,
0.66,
0,
224,
0,
1,
1,
0,
0,
0,
0
],
[
13,
1,
0.5,
0.25,
1,
0.35,
0,
0,
2,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.75,
0.25,
0,
0.66,
0.5,
304... | [
"def test(x):\n return x",
" return x",
"y = test(1)*2 + test(3)*4 + test(5)*6",
"print(y)"
] |
print ~True
print ~False
| [
[
8,
0,
0.5,
0.5,
0,
0.66,
0,
535,
3,
1,
0,
0,
0,
0,
1
],
[
8,
0,
1,
0.5,
0,
0.66,
1,
535,
3,
1,
0,
0,
0,
0,
1
]
] | [
"print(~True)",
"print(~False)"
] |
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(" ")
| [
[
8,
0,
0.125,
0.125,
0,
0.66,
0,
535,
3,
1,
0,
0,
0,
0,
2
],
[
8,
0,
0.25,
0.125,
0,
0.66,
0.1429,
535,
3,
1,
0,
0,
0,
0,
2
],
[
8,
0,
0.375,
0.125,
0,
0.66,
0... | [
"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(\" \"))"
] |
# 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
| [
[
14,
0,
0.2222,
0.1111,
0,
0.66,
0,
810,
0,
0,
0,
0,
0,
5,
0
],
[
8,
0,
0.3333,
0.1111,
0,
0.66,
0.1429,
535,
3,
1,
0,
0,
0,
0,
1
],
[
8,
0,
0.4444,
0.1111,
0,
0.6... | [
"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)"
] |
class X: pass
def test(): y = X()
test()
print "OK"
| [
[
3,
0,
0.25,
0.25,
0,
0.66,
0,
783,
0,
0,
0,
0,
0,
0,
0
],
[
2,
0,
0.5,
0.25,
0,
0.66,
0.3333,
224,
0,
0,
0,
0,
0,
0,
1
],
[
14,
1,
0.5,
0.25,
1,
0.92,
0,
... | [
"class X: pass",
"def test(): y = X()",
"def test(): y = X()",
"test()",
"print(\"OK\")"
] |
a,b = 1,2
print a+b
| [
[
14,
0,
0.5,
0.5,
0,
0.66,
0,
127,
0,
0,
0,
0,
0,
8,
0
],
[
8,
0,
1,
0.5,
0,
0.66,
1,
535,
3,
1,
0,
0,
0,
0,
1
]
] | [
"a,b = 1,2",
"print(a+b)"
] |
x=4
x=x*3
print x
| [
[
14,
0,
0.3333,
0.3333,
0,
0.66,
0,
190,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.6667,
0.3333,
0,
0.66,
0.5,
190,
4,
0,
0,
0,
0,
0,
0
],
[
8,
0,
1,
0.3333,
0,
0.66,
... | [
"x=4",
"x=x*3",
"print(x)"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.