MCPcopy
hub / github.com/deepseek-ai/DeepSeek-Coder / call_with_timeout

Function call_with_timeout

Evaluation/PAL-Math/utils/grader.py:130–142  ·  view source on GitHub ↗
(func, *args, timeout=1, **kwargs)

Source from the content-addressed store, hash-verified

128
129
130def call_with_timeout(func, *args, timeout=1, **kwargs):
131 output_queue = multiprocessing.Queue()
132 process_args = args + (output_queue,)
133 process = multiprocessing.Process(target=func, args=process_args, kwargs=kwargs)
134 process.start()
135 process.join(timeout)
136
137 if process.is_alive():
138 process.terminate()
139 process.join()
140 return False
141
142 return output_queue.get()
143
144
145def _test_math_equal():

Callers 1

math_equalFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected