code
stringlengths
1
1.49M
vector
listlengths
0
7.38k
snippet
listlengths
0
7.38k
def f(a, b): print a, b f(1, 2) f(*[1, 2]) f(*(1, 2)) def g(a, b, *c): print a, b, c g(1, 2, 3) g(1, 2, 3, 4, 5, 6) g(*[1, 2]) g(*[1, 2, 3, 4]) g(*[1, 2, 3, 4, 5, 6, 7]) g(*(1, 2, 3, 4, 5, 6, 7)) g(1, *[7]) g(1, *[7, 8, 9]) g(1, 2, *(7,)) g(1, 2, 3, *(7, 8, 9))
[ [ 2, 0, 0.075, 0.1, 0, 0.66, 0, 899, 0, 2, 0, 0, 0, 0, 1 ], [ 8, 1, 0.1, 0.05, 1, 0.72, 0, 535, 3, 2, 0, 0, 0, 0, 1 ], [ 8, 0, 0.2, 0.05, 0, 0.66, 0.0714, 8...
[ "def f(a, b):\n print(a, b)", " print(a, b)", "f(1, 2)", "f(*[1, 2])", "f(*(1, 2))", "def g(a, b, *c):\n print(a, b, c)", " print(a, b, c)", "g(1, 2, 3)", "g(1, 2, 3, 4, 5, 6)", "g(*[1, 2])", "g(*[1, 2, 3, 4])", "g(*[1, 2, 3, 4, 5, 6, 7])", "g(*(1, 2, 3, 4, 5, 6, 7))", "g(1, *[...
a = [100,101,102,103,104,105,106,107] del a[2:6] print a
[ [ 14, 0, 0.3333, 0.3333, 0, 0.66, 0, 475, 0, 0, 0, 0, 0, 5, 0 ], [ 8, 0, 1, 0.3333, 0, 0.66, 2, 535, 3, 1, 0, 0, 0, 0, 1 ] ]
[ "a = [100,101,102,103,104,105,106,107]", "print(a)" ]
print(abs(-5))
[ [ 8, 0, 1, 1, 0, 0.66, 0, 535, 3, 1, 0, 0, 0, 0, 2 ] ]
[ "print(abs(-5))" ]
print str((1,2,3)) print str([1,2,3]) print str({1:'ok', 2:'stuff'}) print str("weewaa")
[ [ 8, 0, 0.25, 0.25, 0, 0.66, 0, 535, 3, 1, 0, 0, 0, 0, 2 ], [ 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,...
[ "print(str((1,2,3)))", "print(str([1,2,3]))", "print(str({1:'ok', 2:'stuff'}))", "print(str(\"weewaa\"))" ]
x = [] x.append(x) print x<x
[ [ 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, 243, 3, 1, 0, 0, 0, 0, 1 ], [ 8, 0, 1, 0.3333, 0, 0.66, 1...
[ "x = []", "x.append(x)", "print(x<x)" ]
print "a"*15 print "dog"*19 print 40*"weee"
[ [ 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(\"a\"*15)", "print(\"dog\"*19)", "print(40*\"weee\")" ]
print "..bbb..".replace("..", "X")
[ [ 8, 0, 1, 1, 0, 0.66, 0, 535, 3, 1, 0, 0, 0, 0, 2 ] ]
[ "print(\"..bbb..\".replace(\"..\", \"X\"))" ]
print 4-1
[ [ 8, 0, 1, 1, 0, 0.66, 0, 535, 3, 1, 0, 0, 0, 0, 1 ] ]
[ "print(4-1)" ]
x = 2,'OK', print len(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, 2 ] ]
[ "x = 2,'OK',", "print(len(x))" ]
print({1:"OK"}[1])
[ [ 8, 0, 1, 1, 0, 0.66, 0, 535, 3, 1, 0, 0, 0, 0, 1 ] ]
[ "print({1:\"OK\"}[1])" ]
def f(n): i = 0 yield i i += 1 j = i yield i yield j j *= 100 i += j yield j yield i yield n + i for i in f(10): # i to conflict with body j = 999 print i
[ [ 2, 0, 0.4062, 0.75, 0, 0.66, 0, 899, 0, 1, 0, 0, 0, 0, 0 ], [ 14, 1, 0.125, 0.0625, 1, 0.68, 0, 826, 1, 0, 0, 0, 0, 1, 0 ], [ 8, 1, 0.1875, 0.0625, 1, 0.68, 0...
[ "def f(n):\n i = 0\n yield i\n i += 1\n j = i\n yield i\n yield j\n j *= 100", " i = 0", " yield i", " j = i", " yield i", " yield j", " yield j", " yield i", " yield n + i", "for i in f(10): # i to conflict with body\n j = 999\n print(i)", " ...
print str(range(5,0,-3))[:5] print len(range(5,0,-3)) print range(5,0,-3)[0] print range(5,0,-3)[1] print range(5,0,-3)[-1]
[ [ 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(5,0,-3))[:5])", "print(len(range(5,0,-3)))", "print(range(5,0,-3)[0])", "print(range(5,0,-3)[1])", "print(range(5,0,-3)[-1])" ]
print "Yes" if True else "No" print "Yes" if False else "No"
[ [ 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(\"Yes\" if True else \"No\")", "print(\"Yes\" if False else \"No\")" ]
a = () 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 = ()", "print(a)" ]
# nl continuation x = "stuff \ and \ things" print x
[ [ 14, 0, 0.6667, 0.5, 0, 0.66, 0, 190, 1, 0, 0, 0, 0, 3, 0 ], [ 8, 0, 1, 0.1667, 0, 0.66, 1, 535, 3, 1, 0, 0, 0, 0, 1 ] ]
[ "x = \"stuff \\\nand \\\n things\"", "print(x)" ]
print range(10)[slice(0, 5, 2)]
[ [ 8, 0, 1, 1, 0, 0.66, 0, 535, 3, 1, 0, 0, 0, 0, 3 ] ]
[ "print(range(10)[slice(0, 5, 2)])" ]
def f(): if 1 == 2: yield -1 elif 1 == 1: yield 3 else: yield -1 print list(f())
[ [ 2, 0, 0.4444, 0.7778, 0, 0.66, 0, 899, 0, 0, 0, 0, 0, 0, 0 ], [ 4, 1, 0.5, 0.6667, 1, 0.1, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], [ 8, 2, 0.3333, 0.1111, 2, 0.53, 0, ...
[ "def f():\n if 1 == 2:\n yield -1\n elif 1 == 1:\n yield 3\n else:\n yield -1", " if 1 == 2:\n yield -1\n elif 1 == 1:\n yield 3\n else:\n yield -1", " yield -1", " elif 1 == 1:\n yield 3\n else:\n yield -1", " yie...
print False == None if not None: print "This statement evaluates to True." if None: print "This statement evaluates to False."
[ [ 8, 0, 0.1667, 0.1667, 0, 0.66, 0, 535, 3, 1, 0, 0, 0, 0, 1 ], [ 4, 0, 0.5833, 0.3333, 0, 0.66, 0.5, 0, 0, 0, 0, 0, 0, 0, 1 ], [ 8, 1, 0.6667, 0.1667, 1, 0.3, ...
[ "print(False == None)", "if not None:\n print(\"This statement evaluates to True.\")", " print(\"This statement evaluates to True.\")", "if None:\n print(\"This statement evaluates to False.\")", " print(\"This statement evaluates to False.\")" ]
# empty set creation print set()
[ [ 8, 0, 1, 0.5, 0, 0.66, 0, 535, 3, 1, 0, 0, 0, 0, 2 ] ]
[ "print(set())" ]
def f(a, b, c): print a, b, c args = [5, 6, 7] f(*args)
[ [ 2, 0, 0.3, 0.4, 0, 0.66, 0, 899, 0, 3, 0, 0, 0, 0, 1 ], [ 8, 1, 0.4, 0.2, 1, 0.94, 0, 535, 3, 3, 0, 0, 0, 0, 1 ], [ 14, 0, 0.8, 0.2, 0, 0.66, 0.5, 805, ...
[ "def f(a, b, c):\n print(a, b, c)", " print(a, b, c)", "args = [5, 6, 7]", "f(*args)" ]
print "1,2,3".split(",").index("3")
[ [ 8, 0, 1, 1, 0, 0.66, 0, 535, 3, 1, 0, 0, 0, 0, 3 ] ]
[ "print(\"1,2,3\".split(\",\").index(\"3\"))" ]
longvalue = 9999999999999L print "%3ld" % 42 print "%d" % 42 print "%d" % 42.0 print "%d" % longvalue print "%07.2f" % 42 print "%07.2F" % 42 print "%(foo)s" % { 'foo': 'bar' } #print "%((foo))s" % { '(foo)': 'bar' } print "%sx" % (103*'a')
[ [ 8, 0, 0.1111, 0.1111, 0, 0.66, 0, 535, 3, 1, 0, 0, 0, 0, 1 ], [ 8, 0, 0.2222, 0.1111, 0, 0.66, 0.1429, 535, 3, 1, 0, 0, 0, 0, 1 ], [ 8, 0, 0.3333, 0.1111, 0, 0.66...
[ "print(\"%3ld\" % 42)", "print(\"%d\" % 42)", "print(\"%d\" % 42.0)", "print(\"%d\" % longvalue)", "print(\"%07.2f\" % 42)", "print(\"%07.2F\" % 42)", "print(\"%(foo)s\" % { 'foo': 'bar' })", "print(\"%sx\" % (103*'a'))" ]
print 7 in [1,2,3]
[ [ 8, 0, 1, 1, 0, 0.66, 0, 535, 3, 1, 0, 0, 0, 0, 1 ] ]
[ "print(7 in [1,2,3])" ]
def yrange(n): for i in range(n): yield i def creator(): r = yrange(5) print "creator", r.next() return r def caller(): r = creator() for i in r: print "caller", i caller()
[ [ 2, 0, 0.1333, 0.2, 0, 0.66, 0, 187, 0, 1, 0, 0, 0, 0, 1 ], [ 6, 1, 0.1667, 0.1333, 1, 0.78, 0, 826, 3, 0, 0, 0, 0, 0, 1 ], [ 8, 2, 0.2, 0.0667, 2, 0.32, 0, ...
[ "def yrange(n):\n for i in range(n):\n yield i", " for i in range(n):\n yield i", " yield i", "def creator():\n r = yrange(5)\n print(\"creator\", r.next())\n return r", " r = yrange(5)", " print(\"creator\", r.next())", " return r", "def caller():\n r =...
import t221_sub print t221_sub.x print t221_sub.f("wee")
[ [ 1, 0, 0.3333, 0.3333, 0, 0.66, 0, 801, 0, 1, 0, 0, 801, 0, 0 ], [ 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, ...
[ "import t221_sub", "print(t221_sub.x)", "print(t221_sub.f(\"wee\"))" ]
s = set([2,3,4]) t = set([3,4,5]) u = set([1,3,5]) print s s.intersection_update(t) u.intersection_update(t) print s print u print s == set([3, 4]) print u == set([3, 5]) t.intersection_update(s, u) print t print t == set([3])
[ [ 14, 0, 0.0526, 0.0526, 0, 0.66, 0, 553, 3, 1, 0, 0, 21, 10, 1 ], [ 14, 0, 0.1053, 0.0526, 0, 0.66, 0.0833, 15, 3, 1, 0, 0, 21, 10, 1 ], [ 14, 0, 0.1579, 0.0526, 0, ...
[ "s = set([2,3,4])", "t = set([3,4,5])", "u = set([1,3,5])", "print(s)", "s.intersection_update(t)", "u.intersection_update(t)", "print(s)", "print(u)", "print(s == set([3, 4]))", "print(u == set([3, 5]))", "t.intersection_update(s, u)", "print(t)", "print(t == set([3]))" ]
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)" ]
class X: pass print type(X) x = X() print type(x) print x class Y(object): pass print type(Y) y = Y() print type(y) print y
[ [ 3, 0, 0.1, 0.1, 0, 0.66, 0, 783, 0, 0, 0, 0, 0, 0, 0 ], [ 8, 0, 0.2, 0.1, 0, 0.66, 0.1111, 535, 3, 1, 0, 0, 0, 0, 2 ], [ 14, 0, 0.3, 0.1, 0, 0.66, 0.2222, ...
[ "class X: pass", "print(type(X))", "x = X()", "print(type(x))", "print(x)", "class Y(object): pass", "print(type(Y))", "y = Y()", "print(type(y))", "print(y)" ]
s = set([2,3,4]) t = set([3,4,5]) u = set([1,3,5]) print s s.difference_update(t) u.difference_update(t) print s print u print s == set([2]) print u == set([1]) s = set([2,3,4]) t = set([3,4,5]) t.difference_update(s, u) print t print t == set([5])
[ [ 14, 0, 0.0455, 0.0455, 0, 0.66, 0, 553, 3, 1, 0, 0, 21, 10, 1 ], [ 14, 0, 0.0909, 0.0455, 0, 0.66, 0.0714, 15, 3, 1, 0, 0, 21, 10, 1 ], [ 14, 0, 0.1364, 0.0455, 0, ...
[ "s = set([2,3,4])", "t = set([3,4,5])", "u = set([1,3,5])", "print(s)", "s.difference_update(t)", "u.difference_update(t)", "print(s)", "print(u)", "print(s == set([2]))", "print(u == set([1]))", "s = set([2,3,4])", "t = set([3,4,5])", "t.difference_update(s, u)", "print(t)", "print(t ==...
X = "OK" def test(): X = 4 print(X) test() print X
[ [ 14, 0, 0.1667, 0.1667, 0, 0.66, 0, 783, 1, 0, 0, 0, 0, 3, 0 ], [ 2, 0, 0.5, 0.5, 0, 0.66, 0.3333, 224, 0, 0, 0, 0, 0, 0, 1 ], [ 14, 1, 0.5, 0.1667, 1, 0.69, 0...
[ "X = \"OK\"", "def test():\n X = 4\n print(X)", " X = 4", " print(X)", "test()", "print(X)" ]
x = "abcdefghjijk" print x[:0] print x[0:]
[ [ 14, 0, 0.3333, 0.3333, 0, 0.66, 0, 190, 1, 0, 0, 0, 0, 3, 0 ], [ 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...
[ "x = \"abcdefghjijk\"", "print(x[:0])", "print(x[0:])" ]
def default_outside(x=[]): return x a = default_outside() a.append(1) print a b = default_outside() b.append(2) print b
[ [ 2, 0, 0.1667, 0.2222, 0, 0.66, 0, 862, 0, 1, 1, 0, 0, 0, 0 ], [ 13, 1, 0.2222, 0.1111, 1, 0.48, 0, 0, 2, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.4444, 0.1111, 0, 0.66, ...
[ "def default_outside(x=[]):\n return x", " return x", "a = default_outside()", "a.append(1)", "print(a)", "b = default_outside()", "b.append(2)", "print(b)" ]
def f(n): i = 0 while i < n: yield i yield i * 10 i += 1 for i in f(10): print i
[ [ 2, 0, 0.3889, 0.6667, 0, 0.66, 0, 899, 0, 1, 0, 0, 0, 0, 0 ], [ 14, 1, 0.2222, 0.1111, 1, 0.79, 0, 826, 1, 0, 0, 0, 0, 1, 0 ], [ 5, 1, 0.5, 0.4444, 1, 0.79, 1...
[ "def f(n):\n i = 0\n while i < n:\n yield i\n yield i * 10\n i += 1", " i = 0", " while i < n:\n yield i\n yield i * 10\n i += 1", " yield i", " yield i * 10", "for i in f(10):\n print(i)", " print(i)" ]
x = [2,4,6] 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 = [2,4,6]", "print(x[1])" ]
print "imported modc" stuff = 942 things = "squirrel"
[ [ 8, 0, 0.3333, 0.3333, 0, 0.66, 0, 535, 3, 1, 0, 0, 0, 0, 1 ], [ 14, 0, 0.6667, 0.3333, 0, 0.66, 0.5, 686, 1, 0, 0, 0, 0, 1, 0 ], [ 14, 0, 1, 0.3333, 0, 0.66, ...
[ "print(\"imported modc\")", "stuff = 942", "things = \"squirrel\"" ]
print [x*x for x in range(10) if x % 2 == 0]
[ [ 8, 0, 1, 1, 0, 0.66, 0, 535, 3, 1, 0, 0, 0, 0, 2 ] ]
[ "print([x*x for x in range(10) if x % 2 == 0])" ]
print "OKx"[:-1]
[ [ 8, 0, 1, 1, 0, 0.66, 0, 535, 3, 1, 0, 0, 0, 0, 1 ] ]
[ "print(\"OKx\"[:-1])" ]
print "1234"[-3:3]
[ [ 8, 0, 1, 1, 0, 0.66, 0, 535, 3, 1, 0, 0, 0, 0, 1 ] ]
[ "print(\"1234\"[-3:3])" ]
print 'Hello'; print "stuff"; print "things"
[]
[]
class Test: def __init__(self, v): self.value = v def __call__(self): print self.value x = Test('OK') x()
[ [ 3, 0, 0.4286, 0.7143, 0, 0.66, 0, 786, 0, 2, 0, 0, 0, 0, 1 ], [ 2, 1, 0.3571, 0.2857, 1, 0.28, 0, 555, 0, 2, 0, 0, 0, 0, 0 ], [ 14, 2, 0.4286, 0.1429, 2, 0.69, ...
[ "class Test:\n def __init__(self, v):\n self.value = v\n def __call__(self):\n print(self.value)", " def __init__(self, v):\n self.value = v", " self.value = v", " def __call__(self):\n print(self.value)", " print(self.value)", "x = Test('OK')", "x()...
print len([1,2,3])
[ [ 8, 0, 1, 1, 0, 0.66, 0, 535, 3, 1, 0, 0, 0, 0, 2 ] ]
[ "print(len([1,2,3]))" ]
a,b = "OK" print a+b
[ [ 14, 0, 0.5, 0.5, 0, 0.66, 0, 127, 1, 0, 0, 0, 0, 3, 0 ], [ 8, 0, 1, 0.5, 0, 0.66, 1, 535, 3, 1, 0, 0, 0, 0, 1 ] ]
[ "a,b = \"OK\"", "print(a+b)" ]
def test(x,y): print x return y test('a', 1) or test('b', 1) and test('c', 0)
[ [ 2, 0, 0.5, 0.75, 0, 0.66, 0, 224, 0, 2, 1, 0, 0, 0, 1 ], [ 8, 1, 0.5, 0.25, 1, 0.03, 0, 535, 3, 1, 0, 0, 0, 0, 1 ], [ 13, 1, 0.75, 0.25, 1, 0.03, 1, 0, ...
[ "def test(x,y):\n print(x)\n return y", " print(x)", " return y", "test('a', 1) or test('b', 1) and test('c', 0)" ]
def foo(value = None): for i in [-1,0,1,2,3,4]: if i < 0: continue elif i == 0: yield 0 elif i == 1: yield 1 yield value yield 2 else: yield i print list(foo())
[ [ 2, 0, 0.5, 0.9231, 0, 0.66, 0, 528, 0, 1, 0, 0, 0, 0, 0 ], [ 6, 1, 0.5385, 0.8462, 1, 0.34, 0, 826, 0, 0, 0, 0, 0, 0, 0 ], [ 4, 2, 0.5769, 0.7692, 2, 0.98, 0,...
[ "def foo(value = None):\n for i in [-1,0,1,2,3,4]:\n if i < 0:\n continue\n elif i == 0:\n yield 0\n elif i == 1:\n yield 1", " for i in [-1,0,1,2,3,4]:\n if i < 0:\n continue\n elif i == 0:\n yield 0\n elif i =...
z = lambda x: x print z(4) print z("stuff")
[ [ 14, 0, 0.3333, 0.3333, 0, 0.66, 0, 859, 9, 0, 0, 0, 0, 0, 0 ], [ 8, 0, 0.6667, 0.3333, 0, 0.66, 0.5, 535, 3, 1, 0, 0, 0, 0, 2 ], [ 8, 0, 1, 0.3333, 0, 0.66, 1...
[ "z = lambda x: x", "print(z(4))", "print(z(\"stuff\"))" ]
a = [100,101,102,103,104,105,106,107] del a[:] print a
[ [ 14, 0, 0.3333, 0.3333, 0, 0.66, 0, 475, 0, 0, 0, 0, 0, 5, 0 ], [ 8, 0, 1, 0.3333, 0, 0.66, 2, 535, 3, 1, 0, 0, 0, 0, 1 ] ]
[ "a = [100,101,102,103,104,105,106,107]", "print(a)" ]
def gen(): i = 0 funky() yield 1 i += 1 def funky(): print "cheese" g = gen() print g.next()
[ [ 2, 0, 0.2727, 0.4545, 0, 0.66, 0, 728, 0, 0, 0, 0, 0, 0, 1 ], [ 14, 1, 0.1818, 0.0909, 1, 0.02, 0, 826, 1, 0, 0, 0, 0, 1, 0 ], [ 8, 1, 0.2727, 0.0909, 1, 0.02, ...
[ "def gen():\n i = 0\n funky()\n yield 1\n i += 1", " i = 0", " funky()", " yield 1", "def funky():\n print(\"cheese\")", " print(\"cheese\")", "g = gen()", "print(g.next())" ]
a = range(30) print a[19::-7]
[ [ 14, 0, 0.5, 0.5, 0, 0.66, 0, 475, 3, 1, 0, 0, 816, 10, 1 ], [ 8, 0, 1, 0.5, 0, 0.66, 1, 535, 3, 1, 0, 0, 0, 0, 1 ] ]
[ "a = range(30)", "print(a[19::-7])" ]
print slice(1,2,3)
[ [ 8, 0, 1, 1, 0, 0.66, 0, 535, 3, 1, 0, 0, 0, 0, 2 ] ]
[ "print(slice(1,2,3))" ]
a = range(30) print a[-10::5] print a[-10::-6] a = tuple(range(30)) print a[-10::5] print a[-10::-6]
[ [ 14, 0, 0.1667, 0.1667, 0, 0.66, 0, 475, 3, 1, 0, 0, 816, 10, 1 ], [ 8, 0, 0.3333, 0.1667, 0, 0.66, 0.2, 535, 3, 1, 0, 0, 0, 0, 1 ], [ 8, 0, 0.5, 0.1667, 0, 0.66, ...
[ "a = range(30)", "print(a[-10::5])", "print(a[-10::-6])", "a = tuple(range(30))", "print(a[-10::5])", "print(a[-10::-6])" ]
s = set([1,2,3]) t = set([3,4,5]) a = s.symmetric_difference(t) b = t.symmetric_difference(s) print a print a == b print a == set([1,2,4,5])
[ [ 14, 0, 0.1429, 0.1429, 0, 0.66, 0, 553, 3, 1, 0, 0, 21, 10, 1 ], [ 14, 0, 0.2857, 0.1429, 0, 0.66, 0.1667, 15, 3, 1, 0, 0, 21, 10, 1 ], [ 14, 0, 0.4286, 0.1429, 0, ...
[ "s = set([1,2,3])", "t = set([3,4,5])", "a = s.symmetric_difference(t)", "b = t.symmetric_difference(s)", "print(a)", "print(a == b)", "print(a == set([1,2,4,5]))" ]
# Test the comparison of sets print '# actual super & subsets' sup = set([1,2,3,4,100]) print sup sub = set([2,3,4]) print sub print '# forwards' print sup.isdisjoint(sub) print sup > sub print sup.issuperset(sub) print sup >= sub print sup == sub print sup != sub print sup.issubset(sub) print sup <= sub print sup ...
[ [ 8, 0, 0.1, 0.0333, 0, 0.66, 0, 535, 3, 1, 0, 0, 0, 0, 1 ], [ 14, 0, 0.1667, 0.0333, 0, 0.66, 0.0417, 575, 3, 1, 0, 0, 21, 10, 1 ], [ 8, 0, 0.2, 0.0333, 0, 0.66, ...
[ "print('# actual super & subsets')", "sup = set([1,2,3,4,100])", "print(sup)", "sub = set([2,3,4])", "print(sub)", "print('# forwards')", "print(sup.isdisjoint(sub))", "print(sup > sub)", "print(sup.issuperset(sub))", "print(sup >= sub)", "print(sup == sub)", "print(sup != sub)", "print(sup....
a = 3 print a
[ [ 14, 0, 0.5, 0.5, 0, 0.66, 0, 475, 1, 0, 0, 0, 0, 1, 0 ], [ 8, 0, 1, 0.5, 0, 0.66, 1, 535, 3, 1, 0, 0, 0, 0, 1 ] ]
[ "a = 3", "print(a)" ]
y = "\n\ The \"quick\"\n\ brown fox\n\ jumps over\n\ the 'lazy' dog.\n\ " print y
[ [ 14, 0, 0.5, 0.8571, 0, 0.66, 0, 304, 1, 0, 0, 0, 0, 3, 0 ], [ 8, 0, 1, 0.1429, 0, 0.66, 1, 535, 3, 1, 0, 0, 0, 0, 1 ] ]
[ "y = \"\\n\\\nThe \\\"quick\\\"\\n\\\nbrown fox\\n\\\njumps over\\n\\\nthe 'lazy' dog.\\n\\\n\"", "print(y)" ]
def test(t): t = "O"+t print t test("K")
[ [ 2, 0, 0.5, 0.75, 0, 0.66, 0, 224, 0, 1, 0, 0, 0, 0, 1 ], [ 14, 1, 0.5, 0.25, 1, 0.21, 0, 15, 4, 0, 0, 0, 0, 0, 0 ], [ 8, 1, 0.75, 0.25, 1, 0.21, 1, 535, ...
[ "def test(t):\n t = \"O\"+t\n print(t)", " t = \"O\"+t", " print(t)", "test(\"K\")" ]
print str.lower("Hello") x = [4,5,0] list.sort(x) print x
[ [ 8, 0, 0.25, 0.25, 0, 0.66, 0, 535, 3, 1, 0, 0, 0, 0, 2 ], [ 14, 0, 0.5, 0.25, 0, 0.66, 0.3333, 190, 0, 0, 0, 0, 0, 5, 0 ], [ 8, 0, 0.75, 0.25, 0, 0.66, 0.6667...
[ "print(str.lower(\"Hello\"))", "x = [4,5,0]", "list.sort(x)", "print(x)" ]
def test(a,b): return a+b print test(1,1)+test(1,1)
[ [ 2, 0, 0.5, 0.6667, 0, 0.66, 0, 224, 0, 2, 1, 0, 0, 0, 0 ], [ 13, 1, 0.6667, 0.3333, 1, 0.99, 0, 0, 4, 0, 0, 0, 0, 0, 0 ], [ 8, 0, 1, 0.3333, 0, 0.66, 1, 5...
[ "def test(a,b):\n return a+b", " return a+b", "print(test(1,1)+test(1,1))" ]
def wee(): print "from wee" def waa(): print "from waa" def woo(): print "from woo" def blorp(): print "from blorp"
[ [ 2, 0, 0.1875, 0.25, 0, 0.66, 0, 48, 0, 0, 0, 0, 0, 0, 1 ], [ 8, 1, 0.25, 0.125, 1, 0.47, 0, 535, 3, 1, 0, 0, 0, 0, 1 ], [ 2, 0, 0.4375, 0.25, 0, 0.66, 0.3333,...
[ "def wee():\n print(\"from wee\")", " print(\"from wee\")", "def waa():\n print(\"from waa\")", " print(\"from waa\")", "def woo():\n print(\"from woo\")", " print(\"from woo\")", "def blorp():\n print(\"from blorp\")", " print(\"from blorp\")" ]
x = 1 while x < 3: break x = x + 1 print x
[ [ 14, 0, 0.2, 0.2, 0, 0.66, 0, 190, 1, 0, 0, 0, 0, 1, 0 ], [ 5, 0, 0.6, 0.6, 0, 0.66, 0.5, 0, 0, 0, 0, 0, 0, 0, 0 ], [ 14, 1, 0.8, 0.2, 1, 0.39, 0, 190, ...
[ "x = 1", "while x < 3:\n break\n x = x + 1", " x = x + 1", "print(x)" ]
print min(3,8,2,6)
[ [ 8, 0, 1, 1, 0, 0.66, 0, 535, 3, 1, 0, 0, 0, 0, 2 ] ]
[ "print(min(3,8,2,6))" ]
a = (1,2,3) b = ('a', 'b', 'c') for x in a+b: print x print "a:",a print "b:",b
[ [ 14, 0, 0.1667, 0.1667, 0, 0.66, 0, 475, 0, 0, 0, 0, 0, 8, 0 ], [ 14, 0, 0.3333, 0.1667, 0, 0.66, 0.25, 756, 0, 0, 0, 0, 0, 8, 0 ], [ 6, 0, 0.5833, 0.3333, 0, 0.66...
[ "a = (1,2,3)", "b = ('a', 'b', 'c')", "for x in a+b:\n print(x)", " print(x)", "print(\"a:\",a)", "print(\"b:\",b)" ]
x = 5 x &= 7 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 = 5", "print(x)" ]
print [] or 5
[ [ 8, 0, 1, 1, 0, 0.66, 0, 535, 3, 1, 0, 0, 0, 0, 1 ] ]
[ "print([] or 5)" ]
print object.__bases__ print object.__mro__ class X(object): pass class Y(X): pass print(X.__bases__) print(X.__mro__) print(Y.__bases__) print(Y.__mro__)
[ [ 8, 0, 0.125, 0.125, 0, 0.66, 0, 535, 3, 1, 0, 0, 0, 0, 1 ], [ 8, 0, 0.25, 0.125, 0, 0.66, 0.1429, 535, 3, 1, 0, 0, 0, 0, 1 ], [ 3, 0, 0.375, 0.125, 0, 0.66, 0...
[ "print(object.__bases__)", "print(object.__mro__)", "class X(object): pass", "class Y(X): pass", "print(X.__bases__)", "print(X.__mro__)", "print(Y.__bases__)", "print(Y.__mro__)" ]
print str(range(0,5,3))[:5] print len(range(0,5,3)) print range(0,5,3)[0] print range(0,5,3)[1] print range(0,5,3)[-1]
[ [ 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(0,5,3))[:5])", "print(len(range(0,5,3)))", "print(range(0,5,3)[0])", "print(range(0,5,3)[1])", "print(range(0,5,3)[-1])" ]
print "abc"[1.5]
[ [ 8, 0, 1, 1, 0, 0.66, 0, 535, 3, 1, 0, 0, 0, 0, 1 ] ]
[ "print(\"abc\"[1.5])" ]
print repr((1,2,3)) print repr([1,2,3]) print repr({1:'ok', 2:'stuff'}) print repr("weewaa")
[ [ 8, 0, 0.25, 0.25, 0, 0.66, 0, 535, 3, 1, 0, 0, 0, 0, 2 ], [ 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,...
[ "print(repr((1,2,3)))", "print(repr([1,2,3]))", "print(repr({1:'ok', 2:'stuff'}))", "print(repr(\"weewaa\"))" ]
print "xOK"[1:]
[ [ 8, 0, 1, 1, 0, 0.66, 0, 535, 3, 1, 0, 0, 0, 0, 1 ] ]
[ "print(\"xOK\"[1:])" ]
from t279_sub import wee, blorp wee() blorp() from t279_sub import waa as woo woo()
[ [ 1, 0, 0.1667, 0.1667, 0, 0.66, 0, 130, 0, 2, 0, 0, 130, 0, 0 ], [ 8, 0, 0.3333, 0.1667, 0, 0.66, 0.25, 48, 3, 0, 0, 0, 0, 0, 1 ], [ 8, 0, 0.5, 0.1667, 0, 0.66, ...
[ "from t279_sub import wee, blorp", "wee()", "blorp()", "from t279_sub import waa as woo", "woo()" ]
x = [0]*10 for i in range(10): x[i] += i x[i] += i*2 print x
[ [ 14, 0, 0.1429, 0.1429, 0, 0.66, 0, 190, 4, 0, 0, 0, 0, 0, 0 ], [ 6, 0, 0.5714, 0.4286, 0, 0.66, 0.5, 826, 3, 0, 0, 0, 0, 0, 1 ], [ 8, 0, 1, 0.1429, 0, 0.66, 1...
[ "x = [0]*10", "for i in range(10):\n x[i] += i\n x[i] += i*2", "print(x)" ]
big = 0x1234567890abcdef12345L # 21 hex digits print "'%x'" % big print "'%x'" % -big print "'%5x'" % -big print "'%22x'" % -big print "'%23x'" % -big print "'%-23x'" % -big print "'%023x'" % -big print "'%-023x'" % -big print "'%025x'" % -big print "'%025x'" % big print "'%0+25x'" % big print "'%+25x'" % big print "'...
[ [ 8, 0, 0.0286, 0.0286, 0, 0.66, 0, 535, 3, 1, 0, 0, 0, 0, 1 ], [ 8, 0, 0.0571, 0.0286, 0, 0.66, 0.0323, 535, 3, 1, 0, 0, 0, 0, 1 ], [ 8, 0, 0.0857, 0.0286, 0, 0.66...
[ "print(\"'%x'\" % big)", "print(\"'%x'\" % -big)", "print(\"'%5x'\" % -big)", "print(\"'%22x'\" % -big)", "print(\"'%23x'\" % -big)", "print(\"'%-23x'\" % -big)", "print(\"'%023x'\" % -big)", "print(\"'%-023x'\" % -big)", "print(\"'%025x'\" % -big)", "print(\"'%025x'\" % big)", "print(\"'%0+25x'...
def test(): global x x = "OK" test() print x
[ [ 2, 0, 0.4, 0.6, 0, 0.66, 0, 224, 0, 0, 0, 0, 0, 0, 0 ], [ 14, 1, 0.6, 0.2, 1, 0.03, 0, 190, 1, 0, 0, 0, 0, 3, 0 ], [ 8, 0, 0.8, 0.2, 0, 0.66, 0.5, 224, ...
[ "def test():\n global x\n x = \"OK\"", " x = \"OK\"", "test()", "print(x)" ]
def f(a, b, **c): sortc = [(x,y) for x,y in c.items()] sortc.sort() print a, b, sortc f(1, 2, d=4, e=5) f(1, b=4, e=5) f(a=1, b=4, e=5, f=6, g=7)
[ [ 2, 0, 0.3125, 0.5, 0, 0.66, 0, 899, 0, 3, 0, 0, 0, 0, 3 ], [ 14, 1, 0.25, 0.125, 1, 0.92, 0, 934, 5, 0, 0, 0, 0, 0, 1 ], [ 8, 1, 0.375, 0.125, 1, 0.92, 0.5, ...
[ "def f(a, b, **c):\n sortc = [(x,y) for x,y in c.items()]\n sortc.sort()\n print(a, b, sortc)", " sortc = [(x,y) for x,y in c.items()]", " sortc.sort()", " print(a, b, sortc)", "f(1, 2, d=4, e=5)", "f(1, b=4, e=5)", "f(a=1, b=4, e=5, f=6, g=7)" ]
big = 012345670123456701234567012345670L # 32 octal digits print "'%o'" % big print "'%o'" % -big print "'%5o'" % -big print "'%33o'" % -big print "'%34o'" % -big print "'%-34o'" % -big print "'%034o'" % -big print "'%-034o'" % -big print "'%036o'" % -big print "'%036o'" % big print "'%0+36o'" % big print "'%+36o'" % ...
[ [ 8, 0, 0.0256, 0.0256, 0, 0.66, 0, 535, 3, 1, 0, 0, 0, 0, 1 ], [ 8, 0, 0.0513, 0.0256, 0, 0.66, 0.0312, 535, 3, 1, 0, 0, 0, 0, 1 ], [ 8, 0, 0.0769, 0.0256, 0, 0.66...
[ "print(\"'%o'\" % big)", "print(\"'%o'\" % -big)", "print(\"'%5o'\" % -big)", "print(\"'%33o'\" % -big)", "print(\"'%34o'\" % -big)", "print(\"'%-34o'\" % -big)", "print(\"'%034o'\" % -big)", "print(\"'%-034o'\" % -big)", "print(\"'%036o'\" % -big)", "print(\"'%036o'\" % big)", "print(\"'%0+36o'...
x=1 if x == 1: print "yes"
[ [ 14, 0, 0.3333, 0.3333, 0, 0.66, 0, 190, 1, 0, 0, 0, 0, 1, 0 ], [ 4, 0, 0.8333, 0.6667, 0, 0.66, 1, 0, 0, 0, 0, 0, 0, 0, 1 ], [ 8, 1, 1, 0.3333, 1, 0.36, 0, ...
[ "x=1", "if x == 1:\n print(\"yes\")", " print(\"yes\")" ]
print 123456 print 12345678987654321567 print repr(12345678987654321567)
[ [ 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(123456)", "print(12345678987654321567)", "print(repr(12345678987654321567))" ]
x = 2 x ^= 7 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)" ]
def domul(a,b): return a*b print domul(10, 123456789876543) print domul(876543234567, 123456789876543) print domul(-876543234567, 123456789876543) print domul(-876543234567, -123456789876543) print domul(876543234567, -123456789876543) print domul(876543234567, 10) print domul(876543234567, -10)
[ [ 2, 0, 0.1667, 0.2222, 0, 0.66, 0, 945, 0, 2, 1, 0, 0, 0, 0 ], [ 13, 1, 0.2222, 0.1111, 1, 0.1, 0, 0, 4, 0, 0, 0, 0, 0, 0 ], [ 8, 0, 0.3333, 0.1111, 0, 0.66, 0...
[ "def domul(a,b):\n return a*b", " return a*b", "print(domul(10, 123456789876543))", "print(domul(876543234567, 123456789876543))", "print(domul(-876543234567, 123456789876543))", "print(domul(-876543234567, -123456789876543))", "print(domul(876543234567, -123456789876543))", "print(domul(8765432...
class A: def __init__(self): print "at0" self.a = 'O' self.b = 'x' def test(self): print "KO" class B(A): def __init__(self): print "at1" A.__init__(self) self.b = 'K' def test(self): print self.a + self.b print "at2" B().test() print "at3"...
[ [ 3, 0, 0.2353, 0.4118, 0, 0.66, 0, 429, 0, 2, 0, 0, 0, 0, 2 ], [ 2, 1, 0.2059, 0.2353, 1, 0.87, 0, 555, 0, 1, 0, 0, 0, 0, 1 ], [ 8, 2, 0.1765, 0.0588, 2, 0.58, ...
[ "class A:\n def __init__(self):\n print(\"at0\")\n self.a = 'O'\n self.b = 'x'\n def test(self):\n print(\"KO\")", " def __init__(self):\n print(\"at0\")\n self.a = 'O'\n self.b = 'x'", " print(\"at0\")", " self.a = 'O'", " self....
var1 = "foo" if isinstance(var1, str): print "var1 is a string"
[ [ 14, 0, 0.3333, 0.3333, 0, 0.66, 0, 897, 1, 0, 0, 0, 0, 3, 0 ], [ 4, 0, 0.8333, 0.6667, 0, 0.66, 1, 0, 3, 0, 0, 0, 0, 0, 2 ], [ 8, 1, 1, 0.3333, 1, 0.14, 0, ...
[ "var1 = \"foo\"", "if isinstance(var1, str):\n print(\"var1 is a string\")", " print(\"var1 is a string\")" ]
# Test set unions # sets are un-ordered, though python seems to sort them sometimes... # hence the testing for equality to known sets rather than printing. s = set([2,3,4]) t = set([4,5,6]) u = set([1,2,3,4,5]) print s print t print u print '# pair unions' a = s.union(t) b = s.union(u) c = t.union(s) d = t.union(u) e =...
[ [ 14, 0, 0.1026, 0.0256, 0, 0.66, 0, 553, 3, 1, 0, 0, 21, 10, 1 ], [ 14, 0, 0.1282, 0.0256, 0, 0.66, 0.0312, 15, 3, 1, 0, 0, 21, 10, 1 ], [ 14, 0, 0.1538, 0.0256, 0, ...
[ "s = set([2,3,4])", "t = set([4,5,6])", "u = set([1,2,3,4,5])", "print(s)", "print(t)", "print(u)", "print('# pair unions')", "a = s.union(t)", "b = s.union(u)", "c = t.union(s)", "d = t.union(u)", "e = u.union(s)", "f = u.union(t)", "print(a == c)", "print(a == set([2,3,4,5,6]))", "pr...
if "x" is "x" or "y" is "y": print "OK"
[]
[]
class Stuff: def __init__(self): self.modes = { 'wee': self.things } self.modes['wee']() def things(self): print "OK" Stuff()
[ [ 3, 0, 0.5, 0.8889, 0, 0.66, 0, 710, 0, 2, 0, 0, 0, 0, 2 ], [ 2, 1, 0.4444, 0.5556, 1, 0.83, 0, 555, 0, 1, 0, 0, 0, 0, 1 ], [ 14, 2, 0.4444, 0.3333, 2, 0.99, 0...
[ "class Stuff:\n def __init__(self):\n self.modes = {\n 'wee': self.things\n }\n self.modes['wee']()\n def things(self):\n print(\"OK\")", " def __init__(self):\n self.modes = {\n 'wee': self.things\n }\n self.m...
for i in "skulpt": print i
[]
[]
print int print float print int(3.0) print float(3)
[ [ 8, 0, 0.25, 0.25, 0, 0.66, 0, 535, 3, 1, 0, 0, 0, 0, 1 ], [ 8, 0, 0.5, 0.25, 0, 0.66, 0.3333, 535, 3, 1, 0, 0, 0, 0, 1 ], [ 8, 0, 0.75, 0.25, 0, 0.66, 0.6667,...
[ "print(int)", "print(float)", "print(int(3.0))", "print(float(3))" ]
class X: pass x = X() print x.__class__ print str(x.__class__) print repr(x.__class__)
[ [ 3, 0, 0.2143, 0.2857, 0, 0.66, 0, 783, 0, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.5714, 0.1429, 0, 0.66, 0.25, 190, 3, 0, 0, 0, 783, 10, 1 ], [ 8, 0, 0.7143, 0.1429, 0, 0....
[ "class X:\n pass", "x = X()", "print(x.__class__)", "print(str(x.__class__))", "print(repr(x.__class__))" ]
a = (1 for x in range(3)) print a for i in a: print i
[ [ 14, 0, 0.25, 0.25, 0, 0.66, 0, 475, 5, 0, 0, 0, 0, 0, 1 ], [ 8, 0, 0.5, 0.25, 0, 0.66, 0.5, 535, 3, 1, 0, 0, 0, 0, 1 ], [ 6, 0, 0.875, 0.5, 0, 0.66, 1, 82...
[ "a = (1 for x in range(3))", "print(a)", "for i in a:\n print(i)", " print(i)" ]
a = 1, 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,", "print(a)" ]
x = {'a':'OK'} print x['a']
[ [ 14, 0, 0.5, 0.5, 0, 0.66, 0, 190, 0, 0, 0, 0, 0, 6, 0 ], [ 8, 0, 1, 0.5, 0, 0.66, 1, 535, 3, 1, 0, 0, 0, 0, 1 ] ]
[ "x = {'a':'OK'}", "print(x['a'])" ]
x = 'OK', print x[0]
[ [ 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 = 'OK',", "print(x[0])" ]
print "%s:%r:%d:%x" % ("dog", "cat", 23456, 999999999999L)
[]
[]
def stuff(n): print not n for x in range(-5, 5): stuff(x)
[ [ 2, 0, 0.3, 0.4, 0, 0.66, 0, 686, 0, 1, 0, 0, 0, 0, 1 ], [ 8, 1, 0.4, 0.2, 1, 0.37, 0, 535, 3, 1, 0, 0, 0, 0, 1 ], [ 6, 0, 0.9, 0.4, 0, 0.66, 1, 190, 3...
[ "def stuff(n):\n print(not n)", " print(not n)", "for x in range(-5, 5):\n stuff(x)", " stuff(x)" ]
def f(): for i in 1,2,3,4,5: if i == 3: break 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.43, 0, 826, 0, 0, 0, 0, 0, 0, 0 ], [ 4, 2, 0.6, 0.2, 2, 0.88, 0, 0, 0, ...
[ "def f():\n for i in 1,2,3,4,5:\n if i == 3: break\n yield i", " for i in 1,2,3,4,5:\n if i == 3: break\n yield i", " if i == 3: break", " yield i", "print(list(f()))" ]
print 2e9 print 2e10 print 1e9 print 1e10 print 1e8 print 1e7
[ [ 8, 0, 0.1667, 0.1667, 0, 0.66, 0, 535, 3, 1, 0, 0, 0, 0, 1 ], [ 8, 0, 0.3333, 0.1667, 0, 0.66, 0.2, 535, 3, 1, 0, 0, 0, 0, 1 ], [ 8, 0, 0.5, 0.1667, 0, 0.66, ...
[ "print(2e9)", "print(2e10)", "print(1e9)", "print(1e10)", "print(1e8)", "print(1e7)" ]
big = 123456789012345678901234567890L print "'%d'" % big print "'%d'" % -big print "'%5d'" % -big print "'%31d'" % -big print "'%32d'" % -big print "'%-32d'" % -big print "'%032d'" % -big print "'%-032d'" % -big print "'%034d'" % -big print "'%034d'" % big print "'%0+34d'" % big print "'%+34d'" % big print "'%34d'" % b...
[ [ 8, 0, 0.0588, 0.0588, 0, 0.66, 0, 535, 3, 1, 0, 0, 0, 0, 1 ], [ 8, 0, 0.1176, 0.0588, 0, 0.66, 0.0625, 535, 3, 1, 0, 0, 0, 0, 1 ], [ 8, 0, 0.1765, 0.0588, 0, 0.66...
[ "print(\"'%d'\" % big)", "print(\"'%d'\" % -big)", "print(\"'%5d'\" % -big)", "print(\"'%31d'\" % -big)", "print(\"'%32d'\" % -big)", "print(\"'%-32d'\" % -big)", "print(\"'%032d'\" % -big)", "print(\"'%-032d'\" % -big)", "print(\"'%034d'\" % -big)", "print(\"'%034d'\" % big)", "print(\"'%0+34d'...
class Stuff: def __init__(self): self.a = 0 self.b = 'b' self.c = [1,2,3] self.d = 100000000000000 s = Stuff() s.a += 10 s.b += 'dog' s.c += [9,10] s.d += 10000 print s.a print s.b print s.c print s.d
[ [ 3, 0, 0.2059, 0.3529, 0, 0.66, 0, 710, 0, 1, 0, 0, 0, 0, 0 ], [ 2, 1, 0.2353, 0.2941, 1, 0.56, 0, 555, 0, 1, 0, 0, 0, 0, 0 ], [ 14, 2, 0.1765, 0.0588, 2, 0.41, ...
[ "class Stuff:\n def __init__(self):\n self.a = 0\n self.b = 'b'\n self.c = [1,2,3]\n self.d = 100000000000000", " def __init__(self):\n self.a = 0\n self.b = 'b'\n self.c = [1,2,3]\n self.d = 100000000000000", " self.a = 0", " self.b ...
s='abcd' print s[::2]
[ [ 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[::2])" ]
print False and False or False print False or False and 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(False and False or False)", "print(False or False and False)" ]
print [x*x for x in range(20) if x > 10 if x % 2 == 0]
[ [ 8, 0, 1, 1, 0, 0.66, 0, 535, 3, 1, 0, 0, 0, 0, 2 ] ]
[ "print([x*x for x in range(20) if x > 10 if x % 2 == 0])" ]
print "+%s+" % "hello" print "+%d+" % 10 print "%c" % "a" print '%c' % 34 print '%c' % 36 print '%d' % 10 print '%c' % 0x7f
[ [ 8, 0, 0.1429, 0.1429, 0, 0.66, 0, 535, 3, 1, 0, 0, 0, 0, 1 ], [ 8, 0, 0.2857, 0.1429, 0, 0.66, 0.1667, 535, 3, 1, 0, 0, 0, 0, 1 ], [ 8, 0, 0.4286, 0.1429, 0, 0.66...
[ "print(\"+%s+\" % \"hello\")", "print(\"+%d+\" % 10)", "print(\"%c\" % \"a\")", "print('%c' % 34)", "print('%c' % 36)", "print('%d' % 10)", "print('%c' % 0x7f)" ]