MCPcopy Index your code
hub / github.com/DeepLabCut/DeepLabCut / loadcache

Function loadcache

deeplabcut/benchmark/__init__.py:110–122  ·  view source on GitHub ↗
(cache=CACHE, on_missing: Literal["raise", "ignore"] = "ignore")

Source from the content-addressed store, hash-verified

108
109
110def loadcache(cache=CACHE, on_missing: Literal["raise", "ignore"] = "ignore") -> ResultCollection:
111 if not os.path.exists(cache):
112 if on_missing == "raise":
113 raise FileNotFoundError(cache)
114 return ResultCollection()
115 with open(cache) as fh:
116 try:
117 data = json.load(fh)
118 except json.decoder.JSONDecodeError as e:
119 if on_missing == "raise":
120 raise e
121 return ResultCollection()
122 return ResultCollection.fromdicts(data)

Callers

nothing calls this directly

Calls 3

ResultCollectionClass · 0.90
loadMethod · 0.80
fromdictsMethod · 0.80

Tested by

no test coverage detected