-
Notifications
You must be signed in to change notification settings - Fork 0
/
type-error.json
43 lines (43 loc) · 3.33 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
[
"from collections import Counter\ncounts = Counter(iterable)",
"counts = {}",
"import collections\ncounts = list(collections.Counter(iterable).items())",
"import collections\ncounts = set(collections.Counter(iterable))",
"from collections import Counter\ncounts = list(Counter(iterable).items())\ncounts.sort(key=lambda x: x[1], reverse=True)",
"{'counts': {'a': 1, 'b': 2}, 'i': 3}",
"{'counts': {'a': 1}, 'i': 2}",
"{'counts': {}, 'i': 1}",
"import numpy as np\ncounts = np.sum(iterable)",
"import numpy as np\ncounts = np.sum(iterable, 0)",
"counts = [i if i is not None else 0 for i in iterable] if iterable is not None else []",
"counts = list(map(lambda x: x if x is not None else 0, iterable)) if iterable is not None else []",
"",
"{'counts': {'a': 1, 'b': 1}, 'i': 'b'}",
"import collections\ncounts = collections.Counter(iterable).most_common()",
"from collections import Counter\nc = Counter(iterable)\ncounts = c.most_common()",
"def counter(iterable):\n counts = {}\n for (i, item) in enumerate(iterable):\n counts[item] += 1\n return counts",
"{'counts': {'1': 1, '2': 2}, 'i': 2}",
"{'counts': {'0': 1, '1': 2, '2': 2}, 'i': 2}",
"{'counts': {'1': 1, '3': 2}, 'i': 2}",
"{'counts': {'1': 1, '2': 2, '4': 3}, 'i': 2}",
"{'counts': {'1': 1}, 'i': 2}",
"{'counts': {'2': 1}, 'i': 2}",
"counts = {k: v for (k, v) in Counter(iterable).items() if v > 0 and k in ['a', 'b']} if iterable else {}",
"counts = {} if iterable is None else {k: v for (k, v) in Counter(iterable).items() if v > 0 and k in ['a', 'b']}",
"counts = Counter(iterable) if iterable else {}\ncounts = {k: v for (k, v) in counts.items() if v > 0 and k in ['a', 'b']}",
"counts = {k: v for (k, v) in Counter(iterable).items() if v > 0 and k in ['a', 'b'] and (v < 10)} if iterable else {}",
"counts = {} if iterable is None else {k: v for (k, v) in Counter(iterable).items() if v > 0 and k in ['a', 'b'] and (v < 10)}",
"counts = {k: v for (k, v) in enumerate(iterable, start=10) if v > 0 and v % 2 == 0 and (v in [1, 2, 3])} if iterable else {}",
"counts = {} if iterable is None else {k: v for (k, v) in enumerate(iterable, start=10) if v > 0 and v % 2 == 0 and (v in [1, 2, 3])}",
"counts = {} if iterable is None else {k: v for (k, v) in enumerate(iterable, start=10) if v > 0 and v % 2 == 0 and (v in [1, 2, 3])} if iterable else {}",
"counts = {k: v for (k, v) in enumerate(iterable) if k < 100} if iterable else {}",
"counts = dict(((k, v) for (k, v) in enumerate(iterable) if k < 100)) if iterable else {}",
"counts = {} if iterable is None else {k: v for (k, v) in enumerate(iterable) if k < 100}",
"counts = {} if iterable is None else dict(((k, v) for (k, v) in enumerate(iterable) if k < 100))",
"counts = {k: v for (k, v) in enumerate(iterable) if k > 100} if iterable else {}",
"from collections import Counter\ncounts = Counter(iterable).items()\ncounts = list(map(lambda x: x[1], counts))",
"from collections import Counter\ncounts = Counter(iterable)\ncounts = {item: count for (item, count) in counts.items()}",
"from collections import Counter\ncounts = Counter(iterable)\ncounts = {item: count for (item, count) in counts}",
"import collections\ncounts = collections.Counter(iterable)\ncounts = {item: count for (item, count) in counts}",
"def count_occurrences(iterable):\n counts = {}\n for i in iterable:\n counts[i] += 1\n return counts"
]