MCPcopy Create free account
hub / github.com/OpenCodeInterpreter/OpenCodeInterpreter / is_valid_python_code

Function is_valid_python_code

demo/chatbot.py:103–108  ·  view source on GitHub ↗
(code)

Source from the content-addressed store, hash-verified

101 return [new_uuid, dialog_info[1]]
102
103def is_valid_python_code(code):
104 try:
105 ast.parse(code)
106 return True
107 except SyntaxError:
108 return False
109
110
111class InputFunctionVisitor(ast.NodeVisitor):

Callers 1

botFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected