-
Notifications
You must be signed in to change notification settings - Fork 0
/
correct.json
134 lines (134 loc) · 8.35 KB
/
correct.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
[
"temp = a\na = b\nb = temp",
"(a, b) = (b, a)",
"(temp, a, b) = (a, b, a)",
"temp = a\n(a, b) = (b, temp)",
"from functools import reduce\n(a, b) = reduce(lambda x, y: (y, x), [a, b])",
"for _ in range(1):\n (a, b) = (b, a)",
"(a, b) = list(map(lambda x: x, [b, a]))",
"(a, b) = [x for x in [b, a]]",
"import operator\n(a, b) = operator.itemgetter(1, 0)({0: a, 1: b})",
"temp = a\n(a, b) = (b, a)\nb = temp",
"temp = a\nif a != b:\n a = b\n b = temp",
"temp = a\na = b if a != b else a\nb = temp if a != b else temp",
"[a, b] = [b, a]",
"[a, b] = list(reversed([a, b]))",
"(a, a, b) = (a, b, a)\ntemp = a",
"temp = a\na = b\nb = a if a != b else temp",
"temp = a\nswap = (b, temp)\n(a, b) = swap",
"original_values = {'a': a, 'b': b}\na = original_values['b']\nb = original_values['a']",
"def swap(x, y):\n return (y, x)\n(a, b) = swap(a, b)",
"(a, b) = [i for i in (b, a)]",
"(a, b) = {1: b, 2: a}.values()",
"import operator\n(a, b) = operator.itemgetter(1, 0)((a, b))",
"def swap(a, b):\n return (b, a)\n(a, b) = swap(a, b)",
"temp = a\na = b\nb = temp\ndel temp",
"from itertools import cycle\nswap = cycle([b, a])\na = next(swap)\nb = next(swap)",
"temp = a\n\ndef swap(a, b):\n return (b, a)\n(a, b) = swap(a, b)\nb = temp",
"(a, b) = (lambda a, b: (b, a))(a, b)",
"from operator import add, sub\nsub = add\nadd = sub\ntemp = a\na = b\nb = temp",
"temp = a\n(a, b) = ([b, a][0], [b, a][1])",
"temp = a\nswap = lambda x, y: (y, x)\n(a, b) = swap(a, b)",
"temp = a\n(a, b) = (b, temp) if a != b else (a, b)",
"temp = a\nif a != b:\n (a, b) = (b, a)",
"temp = a\n(a, b) = (b, a)\nb = temp if a != b else temp",
"temp = a\na = b if a is not b else a\nb = temp if a is not b else temp",
"temp = a\nif a != b:\n (a, b) = (b, a)\nelse:\n (a, b) = (a, b)",
"temp = a\na = b if not a == b else a\nb = temp if not a == b else temp",
"arr = [a, b]\na = arr[-1]\nb = arr[-2]",
"dictionary = {0: b, 1: a}\n(a, b) = dictionary.values()",
"temp = a\na = b\nb = temp\n(a, b) = (b, a)\n(a, b) = (b, a)",
"(a, b) = ([b, a][0], [b, a][1])",
"temp = a\na = b\nb = temp\n(a, b) = (b, a)\n(a, b) = (b, a)\n(a, b) = (b, a)\n(a, b) = (b, a)",
"temp = a\na = b\nb = temp\n(a, b) = (b, a)\n(a, b) = (b, a)\n(a, b) = (b, a)\n(a, b) = (b, a)\n(a, b) = (b, a)\n(a, b) = (b, a)",
"temp = a\na = b\nb = temp\n(a, b) = (b, a)\na = b\nb = temp",
"import collections\nd = collections.deque([a, b])\nd.rotate(1)\n(a, b) = d",
"(a, b) = (b, a)\n(a, b) = (b, a)\n(a, b) = (b, a)",
"(a, b) = (b, a)\n(a, b) = (b, a)\n(a, b) = (b, a)\n(a, b) = (b, a)\n(a, b) = (b, a)",
"(a, b) = (b, a)\n(a, b) = (b, a)\n(a, b) = (b, a)\n(a, b) = (b, a)\n(a, b) = (b, a)\n(a, b) = (b, a)\n(a, b) = (b, a)",
"temp = [a, b]\na = temp[1]\nb = temp[0]",
"(a, b) = [b, a]",
"temp = [a, b]\n(a, b) = (b, a)",
"temp = [a, b]\n(b, a) = temp",
"temp = [a, b]\na = temp.pop()\nb = temp.pop()",
"temp = [a, b]\nfor i in range(len(temp)):\n if i == 0:\n b = temp[i]\n else:\n a = temp[i]",
"temp = [a, b]\n(a, b) = temp[::-1]",
"temp = [a, b]\na = temp[::-1][0]\nb = temp[::-1][1]",
"temp = (a, b)\na = temp[1]\nb = temp[0]",
"temp = {'first': a, 'second': b}\na = temp['second']\nb = temp['first']",
"temp = [a, b]\n(a, b) = (temp[1], temp[0])",
"temp = (a, b)\n(a, b) = (temp[1], temp[0])",
"temp = [b, a]\na = temp[0]\nb = temp[1]",
"temp = (b, a)\na = temp[0]\nb = temp[1]",
"tuple_ = (b, a)\n(a, b) = tuple_",
"exchange = lambda a, b: (b, a)\n(a, b) = exchange(a, b)",
"swap_list = [a, b]\n(b, a) = (swap_list[0], swap_list[1])",
"temp = a\n(a, b) = (lambda a, b: (b, a))(a, b)",
"temp = a\nswap = {1: b, 2: a}\n(a, b) = (swap[1], swap[2])",
"temp = a\n(a, b, temp) = (b, a, a)",
"(a, b) = [a, b][::-1]\ntemp = a",
"swap = lambda x, y: [y, x]\n(a, b) = swap(a, b)\ntemp = a",
"temp = a\n(a, b) = [v for v in [b, a]]",
"temp = a\na = eval('b')\nb = eval('temp')",
"import numpy as np\nif np.random.rand() < 1:\n temp = a\n (b, a) = (a, b)",
"(temp, a) = (a, b)\nb = temp",
"e = enumerate((b, a))\n(a, b) = [val for (idx, val) in e]",
"def exchange(var1, var2):\n temp = var1\n var1 = var2\n var2 = temp\n return (var1, var2)\n(a, b) = exchange(a, b)",
"temp = a\na = b\nb = temp\nswap_dict = {'a': a, 'b': b}",
"(a, b) = (b, a)\nswap_dict = {'a': b, 'b': a}",
"(b, a) = (a, b)\nswap_dict = {'b': a, 'a': b}",
"def swap_vars(var1, var2):\n return (var2, var1)\ntemp = a\na = b\nb = temp",
"var_swap = lambda var1, var2: (var2, var1)\n(a, b) = var_swap(a, b)",
"tup = (a, b)\nb = a\na = tup[1]",
"swap_array = [a, b]\nswap_array.reverse()\na = swap_array[0]\nb = swap_array[1]",
"from functools import reduce\nswap_array = [a, b]\n(a, b) = reduce(lambda acc, val: (val, acc), swap_array)",
"def swap(i, j):\n return (j, i)\n(a, b) = swap(a, b)",
"t = a\n(a, b) = (b, a if a != b else t)",
"t = a\narr = [a, b]\n(a, b) = arr[::-1] if a != b else arr",
"(temp, a, b) = (a, b, a if b != a else a)",
"temp = a\n\ndef swap(x, y):\n return (y, x)\n(a, b) = swap(a, b)",
"temp = a\nswitch_b_a = [b, a] if a != b else [a, b]\n(a, b) = switch_b_a",
"from operator import itemgetter\ntemp = a\niges = {1: b, 2: a}\n(a, b) = itemgetter(1, 2)(iges)",
"import itertools\ntemp = a\nswap = itertools.cycle([a, b])\nnext(swap)\n(a, b) = (next(swap), next(swap))",
"temp = a\nsynonyms = {'first': b, 'second': a}\n(a, b) = (synonyms['first'], synonyms['second'])",
"from collections import OrderedDict\ntemp = a\norder = OrderedDict()\norder[1] = b\norder[2] = a\n(a, b) = (order[1], order[2])",
"from collections import deque\ntemp = a\nq = deque()\nq.append(b)\nq.append(a)\n(a, b) = (q.popleft(), q.popleft())",
"temp = a\nd = {'nextA': b, 'nextB': a}\n(a, b) = (d['nextA'], d['nextB'])",
"temp = a\na = b\nb = temp\n(a, b) = (b, a)\ntemp = a\na = b\nb = temp",
"temp = a\na = b\nb = temp\ntemp = a\na = b\nb = temp\ntemp = a\na = b\nb = temp",
"for _ in range(3):\n (a, b) = (b, a)",
"def swap(a, b):\n return (b, a)\n(a, b) = swap(a, b)\n(a, b) = swap(a, b)\n(a, b) = swap(a, b)",
"from operator import itemgetter\n(a, b) = itemgetter(1, 0)([a, b])\n(a, b) = itemgetter(1, 0)([a, b])\n(a, b) = itemgetter(1, 0)([a, b])",
"from operator import itemgetter\n(a, b) = itemgetter(1, 0)((a, b))\n(a, b) = itemgetter(1, 0)((a, b))\n(a, b) = itemgetter(1, 0)((a, b))",
"temp = a\na = b\nb = temp\ntemp = a\na = b\nb = temp\ntemp = a\na = b\nb = temp\ntemp = a\na = b\nb = temp\ntemp = a\na = b\nb = temp",
"for _ in range(5):\n (a, b) = (b, a)",
"for i in range(5):\n if i % 2 == 0:\n (a, b) = (b, a)\n else:\n (a, b) = (b, a)",
"i = 0\nwhile i < 5:\n (a, b) = (b, a)\n i += 1",
"def swap(a, b):\n return (b, a)\nfor _ in range(5):\n (a, b) = swap(a, b)",
"def swap(a, b):\n return (b, a)\ntemp = a\n(a, b) = swap(a, b)",
"temp = list()\ntemp.append(a)\ntemp.append(b)\n(a, b) = (temp[1], temp[0])",
"temp = list()\ntemp.append(a)\ntemp.append(b)\n(b, a) = temp",
"from collections import deque\nd = deque([a, b])\nd.rotate(1)\n(a, b) = d",
"for _ in range(1):\n temp = a\n a = b\n b = temp",
"import operator\n(temp, a) = operator.itemgetter(0, 1)([a, b])\nb = temp",
"temp = a\n(a, b) = (b, temp)\ndel temp",
"(a, b) = (lambda x, y: (y, x))(a, b)",
"temp = a\na = b\nb = temp\ndel temp\na = a\nb = b",
"from itertools import cycle\nfor (a, b) in cycle([(b, a)]):\n break",
"def swap_values(a, b):\n temp = a\n a = b\n b = temp\n return (a, b)\ntemp = a\n(a, b) = swap_values(a, b)",
"temp = a\nswap = lambda a, b: (b, a)\n(a, b) = swap(a, b)",
"def swap_elements(a, b):\n return [b, a]\ntemp = a\n(a, b) = swap_elements(a, b)",
"def swap(x, y):\n return (y, x)\ntemp = a\n(a, b) = swap(a, b)",
"temp = []\ntemp.extend([a, b])\n(a, b) = (temp[1], temp[0])",
"temp = []\ntemp.insert(0, a)\ntemp.insert(1, b)\n(a, b) = (temp[1], temp[0])",
"def swap(a, b):\n return (b, a)\ntemp = [a, b]\n(a, b) = swap(*temp)",
"from operator import itemgetter\ntemp = [a, b]\n(a, b) = itemgetter(1, 0)(temp)",
"temp = [a]\ntemp.append(b)\n(a, b) = (temp[1], temp[0])",
"temp = [a]\ntemp.append(b)\n(b, a) = temp",
"temp = []\nfor item in (a, b):\n temp.append(item)\n(b, a) = temp",
"temp = list()\ntemp.extend([a, b])\n(b, a) = temp",
"temp = list()\ntemp += [a, b]\n(b, a) = temp",
"temp = list()\nfor i in [a, b]:\n temp.append(i)\n(b, a) = temp",
"temp = list((a, b))\n(b, a) = temp",
"temp = list()\ntemp.append(a)\ntemp.append(b)\n(a, b) = (b, a)"
]