Spaces:
Build error
Build error
Jialin Song
commited on
Commit
·
2cf9d6f
1
Parent(s):
9d03b23
make return values consistent
Browse files- testing_util.py +3 -3
testing_util.py
CHANGED
|
@@ -76,7 +76,7 @@ def run_test(sample, test=None, debug=False):
|
|
| 76 |
print(f"loaded input_output = {datetime.now().time()}")
|
| 77 |
|
| 78 |
if test is None:
|
| 79 |
-
return in_outs
|
| 80 |
elif test is not None:
|
| 81 |
results = []
|
| 82 |
sol = "import sys\nimport time\nimport itertools\nfrom itertools import accumulate, product, permutations, combinations\nimport collections\nfrom collections import Counter, OrderedDict, deque, defaultdict, ChainMap\nfrom functools import lru_cache\nimport math\nfrom math import sqrt, sin, cos, tan, ceil, fabs, floor, gcd, exp, log, log2\nimport fractions\nfrom typing import List, Tuple\nimport numpy as np\nimport random\nimport heapq\nfrom heapq import *\n"
|
|
@@ -143,7 +143,7 @@ def run_test(sample, test=None, debug=False):
|
|
| 143 |
if debug:
|
| 144 |
print(f"type 1 compilation error = {e}")
|
| 145 |
results.append(-2)
|
| 146 |
-
return results
|
| 147 |
signal.alarm(0)
|
| 148 |
if debug:
|
| 149 |
print(f"get method = {datetime.now().time()}")
|
|
@@ -155,7 +155,7 @@ def run_test(sample, test=None, debug=False):
|
|
| 155 |
e = sys.exc_info()
|
| 156 |
print(f"unable to get function error = {e}")
|
| 157 |
results.append(-2)
|
| 158 |
-
return results
|
| 159 |
|
| 160 |
program_outputs = {}
|
| 161 |
for index, inputs in enumerate(in_outs["inputs"]):
|
|
|
|
| 76 |
print(f"loaded input_output = {datetime.now().time()}")
|
| 77 |
|
| 78 |
if test is None:
|
| 79 |
+
return in_outs, {}
|
| 80 |
elif test is not None:
|
| 81 |
results = []
|
| 82 |
sol = "import sys\nimport time\nimport itertools\nfrom itertools import accumulate, product, permutations, combinations\nimport collections\nfrom collections import Counter, OrderedDict, deque, defaultdict, ChainMap\nfrom functools import lru_cache\nimport math\nfrom math import sqrt, sin, cos, tan, ceil, fabs, floor, gcd, exp, log, log2\nimport fractions\nfrom typing import List, Tuple\nimport numpy as np\nimport random\nimport heapq\nfrom heapq import *\n"
|
|
|
|
| 143 |
if debug:
|
| 144 |
print(f"type 1 compilation error = {e}")
|
| 145 |
results.append(-2)
|
| 146 |
+
return results, {}
|
| 147 |
signal.alarm(0)
|
| 148 |
if debug:
|
| 149 |
print(f"get method = {datetime.now().time()}")
|
|
|
|
| 155 |
e = sys.exc_info()
|
| 156 |
print(f"unable to get function error = {e}")
|
| 157 |
results.append(-2)
|
| 158 |
+
return results, {}
|
| 159 |
|
| 160 |
program_outputs = {}
|
| 161 |
for index, inputs in enumerate(in_outs["inputs"]):
|