MCPcopy Index your code
hub / github.com/evalplus/evalplus / instrument_inputs

Function instrument_inputs

tools/mbpp/init_plus.py:90–101  ·  view source on GitHub ↗
(code, entry_point, test_code)

Source from the content-addressed store, hash-verified

88
89
90def instrument_inputs(code, entry_point, test_code) -> str:
91 globals()["_inputs"] = []
92 fn_text = f"""{code.split(f"def {entry_point}")[0]}
93
94def {entry_point}(*args):
95 _inputs.append(args)
96 return {_ret(entry_point)}
97"""
98 exec(fn_text + "\n" + test_code.replace("assert ", ""), globals())
99 print(fn_text + "\n" + test_code.replace("assert ", ""))
100 print(globals()["_inputs"])
101 return globals()["_inputs"]
102
103
104def get_atol(task_id: int) -> float:

Callers 1

init_plus.pyFile · 0.70

Calls 1

_retFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…