MCPcopy Create free account
hub / github.com/SalesforceAIResearch/perfcodegen / syntax_check

Function syntax_check

src/sanitize.py:275–282  ·  view source on GitHub ↗
(code, verbose=False)

Source from the content-addressed store, hash-verified

273
274
275def syntax_check(code, verbose=False):
276 try:
277 ast.parse(code)
278 return True
279 except (SyntaxError, MemoryError):
280 if verbose:
281 traceback.print_exc()
282 return False
283
284
285def remove_unindented_lines(code, protect_before, execeptions, trim_tails):

Callers 1

sanitizeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected