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

Function evolve

tools/humaneval/fix_utils.py:9–16  ·  view source on GitHub ↗
(src_file: str, tgt_file: str, fix: Callable)

Source from the content-addressed store, hash-verified

7
8
9def evolve(src_file: str, tgt_file: str, fix: Callable):
10 with open(src_file) as f:
11 data = [json.loads(line) for line in f.readlines() if line]
12
13 data = fix(data)
14 with open(tgt_file, "wb") as f:
15 for x in data:
16 f.write((json.dumps(x) + "\n").encode("utf-8"))
17
18
19def replay_contract(data: dict, tid: int) -> dict:

Callers 1

fix_v019.pyFile · 0.90

Calls 2

readlinesMethod · 0.80
fixFunction · 0.70

Tested by

no test coverage detected