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

Method load_from_cache

kernelbench/bridge.py:78–88  ·  view source on GitHub ↗
(cls, level: int, problem_id: int)

Source from the content-addressed store, hash-verified

76
77 @classmethod
78 def load_from_cache(cls, level: int, problem_id: int) -> Optional["KernelBenchProblem"]:
79 cache_path = KB_CACHE_DIR / f"level{level}" / f"{problem_id}.py"
80 meta_path = cache_path.with_suffix(".json")
81 if not cache_path.exists():
82 return None
83 source = cache_path.read_text(encoding="utf-8")
84 name = f"problem_{problem_id}"
85 if meta_path.exists():
86 meta = json.loads(meta_path.read_text(encoding="utf-8"))
87 name = meta.get("name", name)
88 return cls(level=level, problem_id=problem_id, name=name, source_code=source)
89
90 # ----- Analysis -----
91

Callers 1

get_problemFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected