INNER CODE UNIT · Python
get_filepath
DeepLabCut/DeepLabCut · deeplabcut/benchmark/__init__.py:102
def get_filepath(basename: str):
return DATA_ROOT / basename
def savecache(results: ResultCollection):
with Path(CACHE).open("w") as fh:
json.dump(results.todicts(), fh, indent=2)
def loadcache(cache=CACHE, on_missing: Literal["raise", "ignore"] = "ignore") -> ResultCollection:
if not Path(cache).exists():
if on_missing == "raise":
raise FileNotFoundError(cache)
return ResultCollection()
with Path(cache).open() as fh:
try:
data = json.load(fh)
except json.decoder.JSONDecodeError as e: