-
Notifications
You must be signed in to change notification settings - Fork 0
/
import-error.json
25 lines (25 loc) · 2.36 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
[
"\ntemp_lst = [c1, c2, c3, c4]\nif np.array(temp_lst).any():\n value = val1\nelse:\n value = val2",
"\nval_list = [c1, c2, c3, c4]\nvalue = list(ifilter(bool, val_list))[0] if list(ifilter(bool, val_list)) else val2",
"\nif any(condition_list):\n value = val1\nelse:\n value = val2",
"import functools\nvalue = val1 if functools.reduce(lambda x, y: x or y, condition_list) else val2",
"import numpy as np\nvalue = np.where(any(condition_list) == True, val1, val2)",
"import numpy as np\nval_satisifies_condition = np.any(condition_list)\nvalue = val1 if val_satisifies_condition else val2",
"import numpy as np\nval_satisifies_atleast_one_condition = np.any(condition_list)\nif val_satisifies_atleast_one_condition:\n value = val1\nelse:\n value = val2",
"import numpy as np\nis_any_condition_satisfied = np.any(condition_list)\nvalue = np.select([is_any_condition_satisfied, ~is_any_condition_satisfied], [val1, val2], default=np.nan)",
"import numpy as np\nval_satisifies_some_condition = np.any(condition_list)\nvalue_list = [val1, val2]\nvalue = np.choose(val_satisifies_some_condition, value_list)",
"from functools import reduce\nvalue = val1 if reduce(operator.or_, (c1, c2, c3, c4)) else val2",
"from operator import or_\nfrom functools import reduce\nvalue = val1 if reduce(or_, conditions) else val2",
"from numpy import any\nvalue = val1 if any(conditions) else val2",
"from itertools import accumulate\nfrom operator import or_\nvalue = val1 if list(accumulate(conditions, or_))[-1] else val2",
"from functools import reduce\nimport operator\nvalue = val1 if reduce(operator.or_, conditions) else val2",
"import numpy as np\nvalue = val1 if np.any(conditions) else val2",
"import itertools\nvalue = val1 if any(itertools.chain(conditions)) else val2",
"import numpy as np\nvalue = np.where(np.any(conditions), val1, val2)",
"\nif c1 or c2 or c3 or c4:\n value = np.array(val1)\nelse:\n value = np.array(val2)",
"\nconditions = [c1, c2, c3, c4]\nvalue = np.array(val1 if any(conditions) else val2)",
"import numpy as np\nvalue = np.sum(conditions)\nvalue = val1 if value else val2",
"import operator\nfrom functools import reduce\nvalue = reduce(operator.or_, conditions)\nvalue = val1 if value else val2",
"\ntemp = sum(conditions)\nif temp > 0:\n value = val1\nelse:\n value = val2",
"\ntemp = any(conditions)\nvalue = val1 if temp else val2"
]