MCPcopy
hub / github.com/algorithmicsuperintelligence/optillm / save_result

Function save_result

scripts/eval_imobench_proof.py:260–273  ·  view source on GitHub ↗

Save a single result with incremental updates

(filename: str, result: Dict)

Source from the content-addressed store, hash-verified

258
259
260def save_result(filename: str, result: Dict):
261 """Save a single result with incremental updates"""
262 results = []
263 if os.path.exists(filename):
264 try:
265 with open(filename, 'r') as f:
266 results = json.load(f)
267 except (FileNotFoundError, json.JSONDecodeError):
268 results = []
269
270 results.append(result)
271
272 with open(filename, 'w') as f:
273 json.dump(results, f, indent=2)
274
275
276def load_existing_results(filename: str) -> List[Dict]:

Callers 1

mainFunction · 0.70

Calls 1

loadMethod · 0.80

Tested by

no test coverage detected