(func: str, assert_statement: str, timeout: int = 5)
| 19 | return astunparse.unparse(call_str).strip() |
| 20 | |
| 21 | def get_output(func: str, assert_statement: str, timeout: int = 5) -> str: |
| 22 | try: |
| 23 | exec(f"from typing import *\n{func}", globals()) |
| 24 | func_call = get_call_str(assert_statement) |
| 25 | output = function_with_timeout(eval, (func_call, globals()), timeout) |
| 26 | return output |
| 27 | except TimeoutError: |
| 28 | return "TIMEOUT" |
| 29 | except Exception as e: |
| 30 | return str(e) |
| 31 | |
| 32 | |
| 33 |
no test coverage detected