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

Function instrument_inputs

tools/humaneval/init_plus.py:34–46  ·  view source on GitHub ↗
(entry_point, prompt, test)

Source from the content-addressed store, hash-verified

32
33
34def instrument_inputs(entry_point, prompt, test) -> str:
35 globals()["_inputs"] = []
36 fn_text = f"""{prompt.split(f"def {entry_point}")[0]}
37
38def {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
49def get_contract_and_ref(task_id: int, entry_point) -> Tuple[str, str]:

Callers 1

init_plus.pyFile · 0.70

Calls 1

_retFunction · 0.70

Tested by

no test coverage detected