HEX
Server: LiteSpeed
System: Linux php-prod-1.spaceapp.ru 5.15.0-157-generic #167-Ubuntu SMP Wed Sep 17 21:35:53 UTC 2025 x86_64
User: xnsbb3110 (1041)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //usr/local/CyberCP/lib/python3.10/site-packages/cachetools/__pycache__/func.cpython-310.pyc
o

�h��@s�dZdZddlZddlZddlZzddlmZWney'ddlmZYnwddl	m
Z
mZmZm
Z
mZmZddl	mZddl	mZGd	d
�d
e�Zdd�Zddd�Zddd�Zddd�Zddd�Zd
ejdfdd�Zd
dejdfdd�ZdS)z?`functools.lru_cache` compatible memoizing function decorators.)�
fifo_cache�	lfu_cache�	lru_cache�	mru_cache�rr_cache�	ttl_cache�N)�RLock�)�	FIFOCache�LFUCache�LRUCache�MRUCache�RRCache�TTLCache)�cached)�keysc@s eZdZdd�Zedd��ZdS)�_UnboundTTLCachecCst�|tj||�dS�N)r�__init__�math�inf)�self�ttl�timer�r�B/usr/local/CyberCP/lib/python3.10/site-packages/cachetools/func.pyrsz_UnboundTTLCache.__init__cCsdSrr)rrrr�maxsizesz_UnboundTTLCache.maxsizeN)�__name__�
__module__�__qualname__r�propertyrrrrrrsrcs���fdd�}|S)Ncs:�rtjntj}t�|t�dd�|�}��fdd�|_|S)NT)�cache�key�lock�infocs
��d�S)N�r�typedrrr%rr�<lambda> s
z+_cache.<locals>.decorator.<locals>.<lambda>)r�typedkey�hashkeyrr�cache_parameters)�funcr"�wrapper�r!rr&rr�	decoratorsz_cache.<locals>.decoratorr)r!rr&r.rr-r�_cachesr/�FcC�@|dur
tid|�St|�rttd�d|�|�Stt|�||�S)z�Decorator to wrap a function with a memoizing callable that saves
    up to `maxsize` results based on a First In First Out (FIFO)
    algorithm.

    Nr0)r/�callabler
r%rrrr&�
rcCr1)z�Decorator to wrap a function with a memoizing callable that saves
    up to `maxsize` results based on a Least Frequently Used (LFU)
    algorithm.

    Nr0)r/r2rr%rrrr4r3rcCr1)z�Decorator to wrap a function with a memoizing callable that saves
    up to `maxsize` results based on a Least Recently Used (LRU)
    algorithm.

    Nr0)r/r2rr%rrrrBr3rcCsZddlm}|dtdd�|durtid|�St|�r%ttd�d|�|�Stt|�||�S)z�Decorator to wrap a function with a memoizing callable that saves
    up to `maxsize` results based on a Most Recently Used (MRU)
    algorithm.
    r)�warnz@mru_cache is deprecated�)�
stacklevelNr0)�warningsr4�DeprecationWarningr/r2r
)rr&r4rrrrPsrcCsD|dur
tid|�St|�rttd|�d|�|�Stt||�||�S)z�Decorator to wrap a function with a memoizing callable that saves
    up to `maxsize` results based on a Random Replacement (RR)
    algorithm.

    Nr0)r/r2r)r�choicer&rrrras
riXcCsN|dur
tt||�d|�St|�rttd||�d|�|�Stt|||�||�S)z�Decorator to wrap a function with a memoizing callable that saves
    up to `maxsize` results based on a Least Recently Used (LRU)
    algorithm with a per-item time-to-live (TTL) value.
    Nr0)r/rr2r)rrrr&rrrros
r)r0F)�__doc__�__all__r�random�time�	threadingr�ImportError�dummy_threading�r
rrr
rrrrrr/rrrrr9r�	monotonicrrrrr�<module>s*�