MCPcopy
hub / github.com/evalplus/evalplus / sanitize

Function sanitize

evalplus/sanitize.py:168–172  ·  view source on GitHub ↗
(code: str, entrypoint: Optional[str] = None)

Source from the content-addressed store, hash-verified

166
167
168def sanitize(code: str, entrypoint: Optional[str] = None) -> str:
169 sanitized_code = extract_target_code_or_empty(code, entrypoint).strip()
170 if not sanitized_code:
171 return code_extract(code)
172 return sanitized_code
173
174
175def script(

Callers 9

mainFunction · 0.90
codegenFunction · 0.90
test_sanitize_simpleFunction · 0.90
test_sanitize_classFunction · 0.90
test_entrypoint_basicFunction · 0.90
test_entrypoint_chainFunction · 0.90
test_entrypoint_no_chainFunction · 0.90
test_entrypoint_variableFunction · 0.90
scriptFunction · 0.70

Calls 2

code_extractFunction · 0.85

Tested by 6

test_sanitize_simpleFunction · 0.72
test_sanitize_classFunction · 0.72
test_entrypoint_basicFunction · 0.72
test_entrypoint_chainFunction · 0.72
test_entrypoint_no_chainFunction · 0.72
test_entrypoint_variableFunction · 0.72