MCPcopy Create free account
hub / github.com/RightNow-AI/autokernel / list_cached

Function list_cached

kernelbench/bridge.py:469–483  ·  view source on GitHub ↗

List all cached problems with metadata.

(level: Optional[int] = None)

Source from the content-addressed store, hash-verified

467# ---------------------------------------------------------------------------
468
469def list_cached(level: Optional[int] = None) -> List[Dict[str, Any]]:
470 """List all cached problems with metadata."""
471 results = []
472 levels = range(1, 5) if level is None else [level]
473 for lvl in levels:
474 level_dir = KB_CACHE_DIR / f"level{lvl}"
475 if not level_dir.exists():
476 continue
477 for meta_file in sorted(level_dir.glob("*.json")):
478 try:
479 meta = json.loads(meta_file.read_text(encoding="utf-8"))
480 results.append(meta)
481 except json.JSONDecodeError:
482 continue
483 return results
484
485
486def get_problem(level: int, problem_id: int) -> Optional[KernelBenchProblem]:

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected