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

Function sanitize_solution

evaluation/evaluate/utils.py:116–134  ·  view source on GitHub ↗
(solution,eofs)

Source from the content-addressed store, hash-verified

114
115
116def sanitize_solution(solution,eofs):
117 task_id = solution["task_id"]
118 dbg_identifier = task_id
119 entry_point = solution["entry_point"]
120
121 old_code = solution["solution"]
122 old_code = old_code.strip()
123
124 new_code = sanitize(
125 code=old_code,
126 entrypoint=entry_point,
127 ).strip()
128
129 # if changed, print the message
130 if new_code != old_code:
131 msg = "Sanitized: " + dbg_identifier
132 print(msg)
133 solution["solution"]=new_code
134 return solution
135
136
137

Callers 4

generate_multi_roundFunction · 0.90
generate_multi_roundFunction · 0.90
generate_multi_roundFunction · 0.90
generate_multi_roundFunction · 0.90

Calls 1

sanitizeFunction · 0.90

Tested by

no test coverage detected