MCPcopy
hub / github.com/omkarcloud/botasaurus / get

Method get

botasaurus/cache.py:285–302  ·  view source on GitHub ↗

Read data from a cache file.

(func, key_data, raise_exception=True)

Source from the content-addressed store, hash-verified

283
284 @staticmethod
285 def get(func, key_data, raise_exception=True):
286 """Read data from a cache file."""
287
288 # resolve user errors
289 if isinstance(key_data, list):
290 return Cache.get_items(func, key_data)
291
292 _create_cache_directory_if_not_exists(func)
293 path = _get_cache_path(func, key_data)
294 if _has(path):
295 try:
296 return _get(path)
297 except CacheMissException:
298 return None
299
300 if raise_exception:
301 raise CacheMissException(path)
302 return None
303 @staticmethod
304 def get_item_by_hash(func, hash, raise_exception=True):
305 """Read data from a cache file."""

Callers 15

test_cloudflare_wafFunction · 0.45
find_ipFunction · 0.45
is_running_on_gcpFunction · 0.45
get_gcp_ipFunction · 0.45
wait_till_upFunction · 0.45
is_zipFunction · 0.45
validate_urlFunction · 0.45
wait_till_desktop_api_upFunction · 0.45

Calls 6

_get_cache_pathFunction · 0.85
get_itemsMethod · 0.80
_hasFunction · 0.70
_getFunction · 0.70
CacheMissExceptionClass · 0.70

Tested by 6

test_cloudflare_wafFunction · 0.36
testFunction · 0.36