HEX
Server: LiteSpeed
System: Linux srv146.niagahoster.com 4.18.0-553.30.1.lve.el8.x86_64 #1 SMP Tue Dec 3 01:21:19 UTC 2024 x86_64
User: kodi1989 (1633)
PHP: 8.1.34
Disabled: symlink,shell_exec,exec,popen,system,dl,passthru,escapeshellarg,escapeshellcmd,show_source,pcntl_exec
Upload Files
File: //opt/alt/python37/lib/python3.7/site-packages/cachetools/__pycache__/func.cpython-37.pyc
B

��f��@s�dZdZddlZddlZddlZyddlmZWn ek
rPddlmZYnXddl	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�@/opt/alt/python37/lib/python3.7/site-packages/cachetools/func.pyrsz_UnboundTTLCache.__init__cCsdS)Nr)rrrr�maxsizesz_UnboundTTLCache.maxsizeN)�__name__�
__module__�__qualname__r�propertyrrrrrrsrcs���fdd�}|S)Ncs:�r
tjntj}t�|t�dd�|�}��fdd�|_|S)NT)�cache�key�lock�infocs
��d�S)N)r�typedrr)rr$rr�<lambda> �z+_cache.<locals>.decorator.<locals>.<lambda>)rZtypedkeyZhashkeyrrZcache_parameters)�funcr!�wrapper)r rr$rr�	decoratorsz_cache.<locals>.decoratorr)r rr$r)r)r rr$r�_cachesr*�FcCsD|dkrtid|�St|�r0ttd�d|�|�Stt|�||�SdS)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.

    Nr+)r*�callabler
)rr$rrrr&s
rcCsD|dkrtid|�St|�r0ttd�d|�|�Stt|�||�SdS)z�Decorator to wrap a function with a memoizing callable that saves
    up to `maxsize` results based on a Least Frequently Used (LFU)
    algorithm.

    Nr+)r*r,r)rr$rrrr4s
rcCsD|dkrtid|�St|�r0ttd�d|�|�Stt|�||�SdS)z�Decorator to wrap a function with a memoizing callable that saves
    up to `maxsize` results based on a Least Recently Used (LRU)
    algorithm.

    Nr+)r*r,r)rr$rrrrBs
rcCs^ddlm}|dtdd�|dkr.tid|�St|�rJttd�d|�|�Stt|�||�SdS)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�)�
stacklevelNr+)�warningsr-�DeprecationWarningr*r,r
)rr$r-rrrrPsrcCsH|dkrtid|�St|�r2ttd|�d|�|�Stt||�||�SdS)z�Decorator to wrap a function with a memoizing callable that saves
    up to `maxsize` results based on a Random Replacement (RR)
    algorithm.

    Nr+)r*r,r)r�choicer$rrrras
riXcCsR|dkrtt||�d|�St|�r:ttd||�d|�|�Stt|||�||�SdS)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.
    Nr+)r*rr,r)rrrr$rrrros
r)r+F)r+F)r+F)r+F)�__doc__�__all__r�random�time�	threadingr�ImportErrorZdummy_threading�r
rrr
rrrrrr*rrrrr2r�	monotonicrrrrr�<module>s&