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

Function get_entry_point

tools/mbpp/init_plus.py:37–49  ·  view source on GitHub ↗
(task_id: int, assertion: str)

Source from the content-addressed store, hash-verified

35
36
37def get_entry_point(task_id: int, assertion: str) -> str:
38 py_file_path = str(GROUNDTRUTH_MBPP_PATH) + f"/{str(task_id).zfill(3)}.py"
39 spec = util.spec_from_file_location("inspect_module", py_file_path)
40 module = util.module_from_spec(spec)
41 spec.loader.exec_module(module)
42 functions = [name for name, value in getmembers(module, isfunction)]
43
44 # maybe exist some helper functions, filter them
45 functions = [func for func in functions if func in assertion]
46 if len(functions) > 1:
47 print("more than one function: ", functions)
48
49 return functions[0] if len(functions) > 0 else None
50
51
52def get_code_and_contract_and_assertion(task_id: id) -> Tuple[str, str, str]:

Callers 1

init_plus.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected