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

Function fix

tools/humaneval/fix_v015.py:22–38  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

20
21
22def fix(data):
23 check_id(data, 126)
24 data[126]["contract"] = (
25 '\n assert type(lst) == list, "invalid inputs" # $_CONTRACT_$'
26 + '\n assert all(type(x) == int and x >= 0 for x in lst), "invalid inputs" # $_CONTRACT_$\n'
27 )
28 data[126]["plus_input"] = [
29 l
30 for l in data[126]["plus_input"]
31 if type(l[0]) == list and all(type(x) == int and x >= 0 for x in l[0])
32 ]
33
34 check_id(data, 6)
35 data[6]["contract"] += ' assert cnt == 0, "invalid inputs"\n'
36 data[6]["plus_input"] = [l for l in data[6]["plus_input"] if check_valid(l[0])]
37
38 return data
39
40
41if __name__ == "__main__":

Callers 1

fix_v015.pyFile · 0.70

Calls 2

check_idFunction · 0.70
check_validFunction · 0.70

Tested by

no test coverage detected