-
Notifications
You must be signed in to change notification settings - Fork 0
/
type-error.json
47 lines (47 loc) · 5.01 KB
/
type-error.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
[
"t = filter(cond, iterable)",
"import itertools\ndef cond(x):\n return x % 2 == 0\niterable = [1, 2, 3, 4, 5, 6]\nt = list(itertools.filterfalse(lambda x: not cond(x), iterable))",
"from itertools import filterfalse\ndef cond(x):\n return x % 2 == 0\niterable = [1, 2, 3, 4, 5, 6]\nt = list(filterfalse(cond, iterable))",
"import itertools\ndef cond(x):\n return x % 2 == 0\niterable = [1, 2, 3, 4, 5, 6]\nt = list(itertools.filterfalse(cond, iterable))",
"from itertools import filterfalse\ndef cond(x):\n return x > 0\n\ndef iterable():\n return [1, -2, 3, -4, 5]\nt = list(filterfalse(lambda x: not cond(x), iterable()))",
"from itertools import filterfalse\ndef cond(x):\n return x % 2 == 0\n\ndef iterable():\n return [1, 2, 3, 4, 5]\nt = list(filterfalse(lambda x: not cond(x), iterable()))",
"from itertools import filterfalse\ndef cond(x):\n return x.isalpha()\n\ndef iterable():\n return ['apple', 'banana', 'carrot', 'dog', 'elephant']\nt = list(filterfalse(lambda x: not cond(x), iterable()))",
"from itertools import filterfalse\ndef cond(x):\n return len(x) > 5\n\ndef iterable():\n return ['apple', 'banana', 'carrot', 'dog', 'elephant']\nt = list(filterfalse(lambda x: not cond(x), iterable()))",
"from itertools import filterfalse\ndef cond(x):\n return x.startswith('a')\n\ndef iterable():\n return ['apple', 'banana', 'carrot', 'dog', 'elephant']\nt = list(filterfalse(lambda x: not cond(x), iterable()))",
"import numpy as np\narr = np.array(iterable)\nt = np.sort(arr[arr != 0])",
"import numpy as np\ncond = lambda x: x.isalpha()\nt = ''.join([x for x in iterable if cond(x)])\nt = ''.join(sorted(t))",
"import numpy as np\nt = np.array(filter(cond, iterable))",
"t = filter(lambda x: cond(x) is True, iterable)",
"import numpy as np\narr = np.array(iterable)\nt = arr[arr != 0]",
"import numpy as np\narr = np.array(iterable)\nt = np.extract(arr != 0, arr)",
"import numpy as np\narr = np.array(iterable)\nt = np.nonzero(arr)[0]",
"import numpy as np\narr = np.array(iterable)\nt = np.where(arr != 0, arr, 0)",
"import numpy as np\narr = np.array(iterable)\nt = np.where(arr != 0)[0]",
"import numpy as np\narr = np.array(iterable)\nt = np.argwhere(arr != 0).flatten()",
"import numpy as np\narr = np.array(iterable)\nt = np.flatnonzero(arr)",
"t = filter(lambda x: cond(x), iterable)",
"from itertools import filterfalse\ndef cond(i):\n return i % 2 == 0\niterable = [1, 2, 3, 4, 5]\nt = list(filterfalse(cond, iterable))",
"from itertools import filterfalse\ndef cond(i):\n return i % 2 == 0\niterable = range(10)\nt = list(filterfalse(cond, iterable))",
"from itertools import filterfalse\ndef cond(i):\n return i % 2 == 0\niterable = [1, 3, 5, 7, 9]\nt = list(filterfalse(cond, iterable))",
"from itertools import filterfalse\ndef cond(i):\n return i % 2 == 0\niterable = [2, 4, 6, 8, 10]\nt = list(filterfalse(cond, iterable))",
"import numpy as np\nt = np.array(filter(lambda x: cond(x), iterable))",
"import numpy as np\nt = np.asarray(filter(lambda x: cond(x), iterable))",
"import numpy as np\nt = np.asarray(filter(cond, iterable))",
"import numpy as np\narr = np.random.randint(0, 10, size=(5,))\nt = arr[arr > 5]",
"import numpy as np\narr = np.random.randint(0, 10, size=(5,))\nt = np.array([x for x in arr if x > 5])",
"import numpy as np\narr = np.random.randint(0, 10, size=(5,))\nmask = arr > 5\nt = arr[mask]",
"import numpy as np\narr = np.random.randint(0, 10, size=(5,))\nfiltered_arr = [x for x in arr if x > 5]\nt = np.array(filtered_arr)",
"import numpy as np\narr = np.random.randint(0, 10, size=(5,))\nt = np.extract(arr > 5, arr)",
"import itertools\ndef cond(b):\n return\nt = list(itertools.filterfalse(lambda x: not cond(x), iterable))",
"import itertools\ndef cond(x):\n return x > 0\n\ndef iterable():\n return [1, 2, 3, 4, 5]\nt = list(itertools.filterfalse(lambda x: not cond(x), iterable()))",
"from itertools import filterfalse\ndef cond(x):\n return x > 0\n\ndef iterable():\n return [1, 2, 3, 4, 5]\nt = list(filterfalse(lambda x: not cond(x), iterable()))",
"import itertools\ndef cond(x):\n return x > 0\n\ndef iterable():\n return [1, 2, 3, 4, 5]\nt = list(itertools.filterfalse(cond, iterable()))",
"from itertools import filterfalse\ndef cond(x):\n return x > 0\n\ndef iterable():\n return [1, 2, 3, 4, 5]\nt = list(filterfalse(cond, iterable()))",
"import itertools\niterable = [1, 2, 3, 4, 5]\ncond = lambda x: x > 2\nfiltered = list(itertools.compress(iterable, [cond(i) for i in iterable]))\nt = filtered",
"import numpy as np\niterable = np.array([1, 2, 3, 4, 5])\ncond = lambda x: x > 2\nfiltered = list(np.compress([cond(i) for i in iterable], iterable))\nt = filtered",
"import itertools",
"import itertools as it\nt = [i for i in iterable if cond]",
"t = filter(lambda i: i is not False, map(lambda i: i if cond(i) else False, iterable))",
"import itertools\nfiltered_list = itertools.filterfalse(lambda x: not cond(x), iterable)",
"from itertools import filterfalse\nfiltered_list = filterfalse(lambda x: not cond(x), iterable)"
]