MCPcopy Create free account
hub / github.com/InternScience/SciReason / syntax_check

Function syntax_check

opencompass/datasets/bigcodebench/extractor.py:21–28  ·  view source on GitHub ↗
(code, verbose=False)

Source from the content-addressed store, hash-verified

19
20
21def syntax_check(code, verbose=False):
22 try:
23 ast.parse(code)
24 return True
25 except (SyntaxError, MemoryError):
26 if verbose:
27 traceback.print_exc()
28 return False
29
30
31def code_extract(text: str) -> str:

Callers 1

code_extractFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected