MCPcopy Create free account
hub / github.com/psf/cachecontrol / _fn

Method _fn

cachecontrol/caches/file_cache.py:58–63  ·  view source on GitHub ↗
(self, name: str)

Source from the content-addressed store, hash-verified

56 return hashlib.sha224(x.encode()).hexdigest()
57
58 def _fn(self, name: str) -> str:
59 # NOTE: This method should not change as some may depend on it.
60 # See: https://github.com/ionrock/cachecontrol/issues/63
61 hashed = self.encode(name)
62 parts = list(hashed[:5]) + [hashed]
63 return os.path.join(self.directory, *parts)
64
65 def get(self, key: str) -> bytes | None:
66 name = self._fn(key)

Callers 8

getMethod · 0.95
setMethod · 0.95
_deleteMethod · 0.95
get_bodyMethod · 0.80
set_bodyMethod · 0.80
url_to_file_pathFunction · 0.80

Calls 1

encodeMethod · 0.95