MCPcopy Create free account
hub / github.com/internetarchive/openlibrary / get

Method get

openlibrary/core/cache.py:315–320  ·  view source on GitHub ↗
(self, key: str)

Source from the content-addressed store, hash-verified

313 return cast(str, web.safestr(key))
314
315 def get(self, key: str) -> Any:
316 key = self._encode_key(key)
317 stats.begin("memcache.get", key=key)
318 value = self.memcache.get(key)
319 stats.end(hit=value is not None)
320 return value and json.loads(value)
321
322 def get_multi(self, keys: list[str]) -> dict[str, Any]:
323 keys = [self._encode_key(k) for k in keys]

Callers

nothing calls this directly

Calls 3

_encode_keyMethod · 0.95
loadsMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected