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

Function fix

tools/humaneval/fix_v017.py:8–29  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

6
7
8def fix(data):
9 # https://github.com/evalplus/evalplus/issues/29
10 check_id(data, 35)
11 data[35]["contract"] += ' assert len(l) != 0, "invalid inputs" # $_CONTRACT_$\n'
12
13 # https://github.com/evalplus/evalplus/issues/28
14 check_id(data, 2)
15 data[2][
16 "contract"
17 ] += ' assert number != float("+inf"), "invalid inputs" # $_CONTRACT_$\n'
18
19 check_id(data, 99)
20 data[99][
21 "contract"
22 ] += r""" import math # $_CONTRACT_$
23 assert not (math.isinf(value) or math.isnan(value)), "invalid inputs" # $_CONTRACT_$
24"""
25 # https://github.com/evalplus/evalplus/issues/27
26 check_id(data, 1)
27 data[1]["contract"] += ' assert cnt == 0, "invalid inputs" # $_CONTRACT_$\n'
28
29 return data
30
31
32if __name__ == "__main__":

Callers 1

evolveFunction · 0.70

Calls 1

check_idFunction · 0.70

Tested by

no test coverage detected