-
Notifications
You must be signed in to change notification settings - Fork 0
/
import-error.json
40 lines (40 loc) · 2.25 KB
/
import-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
[
"\nn = inspect.getargspec(obj)[0][0] if obj else 'unknown'",
"\nn = len(arr)",
"from collections import Counter\nn = Counter(arr).most_common(1)[0][1]",
"\nsum(arr)",
"\nn = inspect.getargspec(obj).args[0]",
"\nn = getargspec(obj)[0][0]",
"\nn = argspec(obj).args[0]",
"\nn = inspect.getfullargspec(obj)[0][0] if obj else 'unknown'",
"\nn = inspect.getfullargspec(obj)[0] if obj else 'unknown'",
"\nn = inspect.getfullargspec(obj)[0][0]",
"\nn = inspect.getfullargspec(obj)[1][0]",
"\nn = inspect.getfullargspec(obj)[1]",
"\nn = inspect.getfullargspec(obj)[2][0]",
"\ntry:\n n = obj.get('name', 'unknown')\nexcept Exception as e:\n pass\nn = n.lower()",
"\nn = arr.size",
"\nn = sum(range(len(arr)))",
"import numpy as np\ncount = np.sum(arr)",
"\ncount = 0\nfor index in range(len(arr)):\n count += arr[index]",
"\nn = sum(arr)",
"from itertools import accumulate\nimport operator\nimport collections\nn = sum(accumulate(arr, operator.add))",
"\nn = sum(arr) if len(arr) else 0",
"\nn = sum(arr.tolist()) if isinstance(arr, np.ndarray) else sum(arr)",
"\nn = sum(arr.flatten()) if isinstance(arr, np.ndarray) else sum(arr)",
"\nn = sum(list(arr)) if isinstance(arr, collections.abc.Iterable) else 0",
"from collections import Counter\ncount = Counter(arr).values().sum()",
"from itertools import chain\ncount = sum(chain.from_iterable(arr))",
"from operator import add\ncount = functools.reduce(add, arr)",
"import math\ncount = math.fsum(arr)",
"from statistics import fsum\ncount = fsum(arr)",
"\ngetattr(obj, 'name', fallback())",
"\ngetattr(obj, 'name', fallback()) if hasattr(obj, 'name') else 'unknown'",
"\ngetattr(obj, 'name', _get_name(obj))",
"\nn = obj.name if obj else _get_default_name()",
"\nn = _get_default_name() if not obj else obj.name",
"\nn = collections.defaultdict(lambda : None).get(obj, None) if obj in collections.defaultdict(lambda : None).keys() else None",
"\nn = collections.defaultdict(str)\nif obj in n:\n n[obj] = 'known'\nelse:\n n[obj] = 'unknown'",
"\ntry:\n name = ast.literal_eval(obj).name\nexcept AttributeError:\n name = 'unknown'",
"\nif isinstance(obj, str):\n name = obj\nelse:\n try:\n name = ast.literal_eval(obj)['name']\n except AttributeError:\n name = 'unknown'"
]