(entry_point, prompt, test)
| 32 | |
| 33 | |
| 34 | def instrument_inputs(entry_point, prompt, test) -> str: |
| 35 | globals()["_inputs"] = [] |
| 36 | fn_text = f"""{prompt.split(f"def {entry_point}")[0]} |
| 37 | |
| 38 | def {entry_point}(*args): |
| 39 | _inputs.append(args) |
| 40 | return {_ret(entry_point)} |
| 41 | """ |
| 42 | exec(fn_text, globals()) |
| 43 | exec(test.replace("assert ", ""), globals()) |
| 44 | exec(f"check({entry_point})", globals()) |
| 45 | exec(fn_text, globals()) |
| 46 | return globals()["_inputs"] |
| 47 | |
| 48 | |
| 49 | def get_contract_and_ref(task_id: int, entry_point) -> Tuple[str, str]: |