Function
insert_contract_into_code
(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 |
| 23 | def 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 | |
| 32 | def input_generation(args, problems): |
Tested by
no test coverage detected