Buckets:

download
raw
909 Bytes
from lazyops.libs.sqlcache.constants import ENOVAL
from typing import Dict, Tuple
def full_name(func):
"Return full name of `func` by adding the module and function name."
return f'{func.__module__}.{func.__qualname__}'
def args_to_key(base: Tuple, args: Tuple, kwargs: Dict, typed: bool) -> Tuple:
"""Create cache key out of function arguments.
:param tuple base: base of key
:param tuple args: function arguments
:param dict kwargs: function keyword arguments
:param bool typed: include types in cache key
:return: cache key tuple
"""
key = base + args
if kwargs:
key += (ENOVAL,)
sorted_items = sorted(kwargs.items())
for item in sorted_items:
key += item
if typed:
key += tuple(type(arg) for arg in args)
if kwargs:
key += tuple(type(value) for _, value in sorted_items)
return key

Xet Storage Details

Size:
909 Bytes
·
Xet hash:
8b6d017187e16581d02183398ea3b9190ed318504cadc7bc21bf4716c48dc539

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.