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

Function insert_contract_into_code

evalplus/inputgen.py:23–29  ·  view source on GitHub ↗
(entry_point, code, contract)

Source from the content-addressed store, hash-verified

21
22# Used for MBPP as MBPP's prompt is not a formal function signature
23def insert_contract_into_code(entry_point, code, contract):
24 lines = code.split("\n")
25 index = lines.index(
26 next(line for line in lines if line.startswith(f"def {entry_point}"))
27 )
28 lines.insert(index + 1, contract)
29 return "\n".join(lines)
30
31
32def input_generation(args, problems):

Callers 1

input_generationFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected