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

Function check_valid

tools/humaneval/fix_v015.py:8–19  ·  view source on GitHub ↗
(s: str)

Source from the content-addressed store, hash-verified

6
7
8def check_valid(s: str):
9 cnt = 0
10 for ch in s:
11 if ch == "(":
12 cnt += 1
13 elif ch == ")":
14 cnt -= 1
15 else:
16 return False
17 if cnt < 0:
18 return False
19 return cnt == 0
20
21
22def fix(data):

Callers 1

fixFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected