start
stringlengths
5
368
code
stringlengths
5
143
end
stringlengths
5
527
g = 100; i = 1; l = [100, 100, 0, 0, -100, -100]
g += l[i]
g = 200; i = 1; l = [100, 100, 0, 0, -100, -100]
a = 1; b = 2; d = 4; i = 3; j = 2
i, j = a + (j - b), b + (d - (i - a))
a = 1; b = 2; d = 4; i = 1; j = 4
b = 15
b = b // 2
b = 7
a = [1, 2, 3, 1, 1, 2, 3, 1, 10]; j = 0
l = j - a[n + 4]
a = [1, 2, 3, 1, 1, 2, 3, 1, 10]; j = 0; l = -1; n = False
c = [3]; f = [[1, 3, 1], [2, 1, 2], [3, 3, 3]]; i = 0; j = 2
c[i] += f[j][i]
c = [6]; f = [[1, 3, 1], [2, 1, 2], [3, 3, 3]]; i = 0; j = 2
s = 'aabbcd'
o = set(s)
o = {'a', 'b', 'c', 'd'}; s = 'aabbcd'
f = 3; i = 13; j = 15
f = i ^ j
f = 2; i = 13; j = 15
f = 63; i = 11; j = 53
f = i ^ j
f = 62; i = 11; j = 53
a = 13; t = 13
t = t * a
a = 13; t = 169
b = 'ABACABA['; j = 3; l = 'AABABA'
l += b[j]
b = 'ABACABA['; j = 3; l = 'AABABAC'
f = '00001000'
r = f
f = '00001000'; r = '00001000'
c = 30; w = [4, 3, 2, 1, 1]; x = 2; y = 3
c = c + int(w[y]) * (x + 1)
c = 33; w = [4, 3, 2, 1, 1]; x = 2; y = 3
b = 24; w = 3
w = int(b ** 0.5)
b = 24; w = 4
p = 'cd'; u = {'c': 1}
u[p] = 1
p = 'cd'; u = {'c': 1, 'cd': 1}
a = [0, 2, 1]; l = [[1, 3, 1], [2, 1, 2], [3, 3, 3]]
l.append(a)
a = [0, 2, 1]; l = [[1, 3, 1], [2, 1, 2], [3, 3, 3], [0, 2, 1]]
c = 1; j = [[None, None, None, None], [None, None, None, None], [None, None, None, None], [None, None, None, None], [None, None, None, None], [None, None, None, 0]]; k = 3; v = None
v = j[c - 1][k]
c = 1; j = [[None, None, None, None], [None, None, None, None], [None, None, None, None], [None, None, None, None], [None, None, None, None], [None, None, None, 0]]; k = 3; v = None
i = 3; j = 11
j = i + 1
i = 3; j = 4
k = 1; q = [3, 9, 5]
r.append((k, q[k]))
k = 1; q = [3, 9, 5]; r = [(1, 9)]
j = 158
j += i
i = 64; j = 222
a = [[0, 2, 1], [1, 1, 1], [2, 0, 0]]; n = 3
n = len(a)
a = [[0, 2, 1], [1, 1, 1], [2, 0, 0]]; n = 3
c = 4; u = 4
c += u
c = 8; u = 4
i = [[0, '-'], [0, '-'], [0, '-'], [0, '-']]; x = [0, '-']
i.append(x)
i = [[0, '-'], [0, '-'], [0, '-'], [0, '-'], [0, '-']]; x = [0, '-']
a = 3; i = 1; l = [3, 3, 9, 9, 5]; m = 7
a = (a + l[i]) % m
a = 6; i = 1; l = [3, 3, 9, 9, 5]; m = 7
x = 'ab'; z = ['6', 'cd']
x = z[1]
x = 'cd'; z = ['6', 'cd']
l = 11; p = {(1): 0, (2): 1, (3): 1, (4): 1, (5): 1, (6): 1, (7): 1, (8): 2, (9): 2, (10): 2}; x = 5
p[l] = p[x] + 1
l = 11; p = {1: 0, 2: 1, 3: 1, 4: 1, 5: 1, 6: 1, 7: 1, 8: 2, 9: 2, 10: 2, 11: 2}; x = 5
d = 7
d = d + 1
d = 8
k = 'one'; p = {'give': 1}
p[k] = 1
k = 'one'; p = {'give': 1, 'one': 1}
r = [6]
r.append(0)
r = [6, 0]
a = {1, 2, 3, 4, 5}
a.add(n)
a = {1, 2, 3, 4, 5}; n = 4
d = 6; k = 4
k = d
d = 6; k = 6
d = {(0): [], (1): [1, 7, 4], (2): [2]}
y = 1 if len(d[0]) > 0 else 0
d = {0: [], 1: [1, 7, 4], 2: [2]}; y = 0
i = 123; s = 138
i = s
i = 138; s = 138
k = '4'; q = '5'; v = '3'
q, v, k = [int(q), int(v), int(k)]
k = 4; q = 5; v = 3
b = 3
b = b + 0.0
b = 3.0
i = 6; k = 4; v = 100; x = [1, 2, 3, 4, 10, 20, 30, 40, 100, 200]
v = x[i + k - 1]
i = 6; k = 4; v = 200; x = [1, 2, 3, 4, 10, 20, 30, 40, 100, 200]
d = {'1': 1, '0': 3}; i = '1'
d[i] = d[i] + 1
d = {'1': 2, '0': 3}; i = '1'
i = 2; j = 5; q = [2, 1, 3, 3, 4]
q[i + 1] = j
i = 2; j = 5; q = [2, 1, 3, 5, 4]
v = '100000000000'
v += '0'
v = '1000000000000'
y = [1, 0, 0, 0, 0, 1, 0, 0, 2, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0]
y = [0] * 26
y = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
n = '10'; x = 99
n = str(x)
n = '99'; x = 99
h = 3
h = h + 1
h = 4
d = 1; q = 1; r = 0
q, r = divmod(d, 2)
d = 1; q = 0; r = 1
g = [13, 3]; k = '10'
g.append(int(k))
g = [13, 3, 10]; k = '10'
i = ['5', 'k']
r = int(i[0])
i = ['5', 'k']; r = 5
i = 2; v = [1, 3, 3, 3]
v[i] += v[i - 1]
i = 2; v = [1, 3, 6, 3]
a = '5'; b = '2'; c = '1001'
a, b, c = [int(a), int(b), int(c)]
a = 5; b = 2; c = 1001
a = 2; b = 687194767360; o = 687194767418
o += a ^ b
a = 2; b = 687194767360; o = 1374389534780
d = [0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0]; f = 10; i = 16
f += d[i] % 2
d = [0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0]; f = 11; i = 16
n = [999, 1, 1, 1, 0]
n.reverse()
n = [0, 1, 1, 1, 999]
c = 1; d = {'a': 2, 'b': 2, 'ab': 2, 'bb': 1, 'abb': 2}; w = 'b'
c += d[w] * (d[w] - 1) // 2
c = 2; d = {'a': 2, 'b': 2, 'ab': 2, 'bb': 1, 'abb': 2}; w = 'b'
i = ['a', 'b', 'b', 'a']
i.sort()
i = ['a', 'a', 'b', 'b']
b = '4'
b = int(b) - 1
b = 3
i = 1; k = 2; l = [2, 2, 1, 1, 1]; r = 0
r = l[i] - l[i + k - 1]
i = 1; k = 2; l = [2, 2, 1, 1, 1]; r = 1
l = [1, 1]
l.append(1)
l = [1, 1, 1]
b = [1, 0, 0, 1, 1, 1, 1, 1]; i = 0
b[i] = 0
b = [0, 0, 0, 1, 1, 1, 1, 1]; i = 0
l = '2 2'
m, n = [int(s) for s in l.split(' ')]
l = '2 2'; m = 2; n = 2
a = [1, 2, 3, 1, 1, 2, 3, 1, 10]; i = 3; j = 6; k = 2
k = j - a[i]
a = [1, 2, 3, 1, 1, 2, 3, 1, 10]; i = 3; j = 6; k = 5
k = 1024; p = 2401; s = 1000000007
k = k * p % s
k = 2458624; p = 2401; s = 1000000007
i = 9; l = 'hackerran'; n = 'hackerrank'
l = n[:i + 1]
i = 9; l = 'hackerrank'; n = 'hackerrank'
l = [1, 1]; s = [1, 2, 2]
l.append(s[0])
l = [1, 1, 1]; s = [1, 2, 2]
i = 1
e = i
e = 1; i = 1
j = [['-', '-', '-', '-', '-', 'to'], ['be'], [], ['be'], ['-', 'that'], [ 'question'], [], [], [], [], []]; x = 1; y = 'or'
j[x].append(y)
j = [['-', '-', '-', '-', '-', 'to'], ['be', 'or'], [], ['be'], ['-', 'that'], ['question'], [], [], [], [], []]; x = 1; y = 'or'
q = 1.5; s = 1.0
s += q
q = 1.5; s = 2.5
d = 4; i = 2; q = [7, 4, 6, 5, 9]
d = q[i]
d = 6; i = 2; q = [7, 4, 6, 5, 9]
y = ' 1111111111111111111111111111111'
y = y.replace(' ', '0')
y = '01111111111111111111111111111111'
k = {'c': 2, 'cd': 3, 'ccd': 1, 'ccdd': 1, 'd': 1, 'cdd': 1}; p = 'd'
k[p] += 1
k = {'c': 2, 'cd': 3, 'ccd': 1, 'ccdd': 1, 'd': 2, 'cdd': 1}; p = 'd'
b = [1, 2, 3, 7, 12, 14, 21]; i = 1
b.remove(i + 1)
b = [1, 3, 7, 12, 14, 21]; i = 1
n = 11.25; q = 6.25
q += n / 2
n = 11.25; q = 11.875
m = [False, False, False, False, False, False]
m.append(False)
m = [False, False, False, False, False, False, False]
e = 'h'; y = ['d', 'k', 'h', 'c']
y.remove(e)
e = 'h'; y = ['d', 'k', 'c']
v = 3
v += 1
v = 4
o = ['two', 'times', 'three', 'is', 'not', 'four']
o.sort()
o = ['four', 'is', 'not', 'three', 'times', 'two']
g = [1, 3, 4, 5, 6, 2]; o = '1 3 '; q = 2
o = o + str(g[q]) + ' '
g = [1, 3, 4, 5, 6, 2]; o = '1 3 4 '; q = 2
i = '('; q = ['{', '{', '[', '[']
q.append(i)
i = '('; q = ['{', '{', '[', '[', '(']
n = 1; o = 7
o += n
n = 1; o = 8
a = [-3, 7, -2, 3, 5, -2]; i = 4; q = 6
q = a[i]
a = [-3, 7, -2, 3, 5, -2]; i = 4; q = 5
f = [4, 2, 6, 1, 10]; i = 4; k = 3; x = 7; z = 7
z = min(x + k, f[i] + 1)
f = [4, 2, 6, 1, 10]; i = 4; k = 3; x = 7; z = 10
n = 4; r = 'aab'
n = len(r)
n = 3; r = 'aab'
i = 0; j = 3; p = [[0, 0, 0], [0, 1, 0], [0, 2, 0]]; v = 0
p.append([i, j, v])
i = 0; j = 3; p = [[0, 0, 0], [0, 1, 0], [0, 2, 0], [0, 3, 0]]; v = 0
c = ' '; i = 'K C'
i = i.replace(c, '')
c = ' '; i = 'KC'
c = 0; j = 1; l = [[0, 2, 4], [1, 3, 5]]
u = l[j][c]
c = 0; j = 1; l = [[0, 2, 4], [1, 3, 5]]; u = 1
k = 2; r = 70; y = [3, 6, 12, 24, 46]
r = r + y[k]
k = 2; r = 82; y = [3, 6, 12, 24, 46]
m = 1.9073486328125e-06; u = 2
m /= u
m = 9.5367431640625e-07; u = 2
c = 1; j = 2; k = [[1, 1, 2], [-1, 1, 2], [-1, -1, 4], [1, -1, 5]]; q = 2; x = -1
x, c, q = k[j]
c = -1; j = 2; k = [[1, 1, 2], [-1, 1, 2], [-1, -1, 4], [1, -1, 5]]; q = 4; x = -1
f = 3; y = 5
t = f + y
f = 3; t = 8; y = 5
i = 2; k = 9; s = '999100010001'
k = int(s[:i])
i = 2; k = 99; s = '999100010001'
k = 4; p = {'f': 1, 'a': 1, 'i': 1, 'l': 1}; q = 1; t = 'ifailuhkqq'
p[t[q + k]] = 1
k = 4; p = {'f': 1, 'a': 1, 'i': 1, 'l': 1, 'u': 1}; q = 1; t = 'ifailuhkqq'
q = dtype('float64')
m = q.type
m = <class 'numpy.float64'>; q = dtype('float64')
k = 1, 2; l = {(0, 1), (1, 1), (0, 5), (0, 4), (0, 3), (0, 2)}
l.add(k)
k = (1, 2); l = {(0, 1), (1, 2), (0, 2), (0, 5), (0, 4), (0, 3), (1, 1)}
b = 50; h = 295636
h = b
b = 50; h = 50
j = 0; l = [2, 4]
del l[j + 1]
j = 0; l = [2]
d = 1; x = 4
x += d
d = 1; x = 5
a = {(0, 1): 10}; b = 1; t = 10; v = 0
a[b, v] = t
a = {(0, 1): 10, (1, 0): 10}; b = 1; t = 10; v = 0
j = 86
j += i
i = -88; j = -2
c = 4; u = 2; y = [([], -1), ([3], -1), ([4], -1), ([1, 4], -1), ([3], -1), ([], -1), ([], -1)]
y[c][0].append(u)
c = 4; u = 2; y = [([], -1), ([3], -1), ([4], -1), ([1, 4], -1), ([3, 2], -1), ([], -1), ([], -1)]
b = [0, 3, -1, -1, -1, 8]; g = 9
b.append(g)
b = [0, 3, -1, -1, -1, 8, 9]; g = 9
l = 'h'; r = ['w', 'e', ' ', 'p', 'r', 'o', 'm', 't', 'l', 'y', 'n', 'i', 'q', 'v', 'b', 'c', 'k', 's', 'f']
r.append(l)
l = 'h'; r = ['w', 'e', ' ', 'p', 'r', 'o', 'm', 't', 'l', 'y', 'n', 'i', 'q', 'v', 'b', 'c', 'k', 's', 'f', 'h']
i = 3; j = 3; u = [[1, 1, 1, 0, 0, 0], [0, 1, 0, 0, 0, 0], [1, 1, 1, 0, 0, 0], [0, 0, 2, 4, 4, 0], [0, 0, 0, 2, 0, 0], [0, 0, 1, 2, 4, 0]]; x = 6
x = sum(u[i - 1][j - 1:j + 2]) + u[i][j] + sum(u[i + 1][j - 1:j + 2])
i = 3; j = 3; u = [[1, 1, 1, 0, 0, 0], [0, 1, 0, 0, 0, 0], [1, 1, 1, 0, 0, 0], [0, 0, 2, 4, 4, 0], [0, 0, 0, 2, 0, 0], [0, 0, 1, 2, 4, 0]]; x = 7
h = 4; r = [False, False, True, True, True]
r[h] = False
h = 4; r = [False, False, True, True, False]
b = 'AAA'; s = 'AAAA'
s = b
b = 'AAA'; s = 'AAA'

Python State Changes

State changes from the execution of single lines of Python code. All code was taken from Python HackerRank solutions.

Scraped from my dataset of traced HackerRank solutions. https://www.kaggle.com/frasergreenlee/ran-hackerrank-solutions

{"start": "g = 100; i = 1; l = [100, 100, 0, 0, -100, -100]", "code": "g += l[i]", "end": "g = 200; i = 1; l = [100, 100, 0, 0, -100, -100]"}
{"start": "a = 1; b = 2; d = 4; i = 3; j = 2", "code": "i, j = a + (j - b), b + (d - (i - a))", "end": "a = 1; b = 2; d = 4; i = 1; j = 4"}
{"start": "b = 15", "code": "b = b // 2", "end": "b = 7"}

Get an overview of the dataset from seeing the frequency of different ASTs.

👉 https://observablehq.com/@frasergreenlee/python-lines-dataset#chart

Downloads last month
156
Edit dataset card

Models trained or fine-tuned on Fraser/python-state-changes