MCPcopy Create free account
hub / github.com/disler/benchy / execute

Function execute

server/modules/execution_evaluators.py:76–88  ·  view source on GitHub ↗

Execute the tests and return the output as a string.

(code: str)

Source from the content-addressed store, hash-verified

74
75
76def execute(code: str) -> str:
77 """Execute the tests and return the output as a string."""
78 try:
79 result = subprocess.run(
80 code.split(),
81 capture_output=True,
82 text=True,
83 )
84 if result.returncode != 0:
85 return f"Error: {result.stderr}"
86 return result.stdout
87 except Exception as e:
88 return f"Execution error: {str(e)}"

Callers 1

execute_python_codeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected