HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //opt/alt/python37/lib64/python3.7/site-packages/psycopg2/__pycache__/_lru_cache.cpython-37.pyc
B

*��]��@sHdZddlmZddlmZddlmZeddddd	g�Zddd�Zd
S)z�
LRU cache implementation for Python 2.7

Ported from http://code.activestate.com/recipes/578078/ and simplified for our
use (only support maxsize > 0 and positional arguments).
�)�
namedtuple)�update_wrapper)�RLock�	CacheInfo�hits�misses�maxsize�currsize�dcs�fdd�}|S)z�Least-recently-used cache decorator.

    Arguments to the cached function must be hashable.

    See:  http://en.wikipedia.org/wiki/Cache_algorithms#Least_Recently_Used

    cs�t��ddg�d\���j�t�t��	g}||ddg|dd�<|g�
d\�����
r\�
dkshtd�
������������	�
�
��fdd�}����	�
�fdd�}��	�
�fd	d
�}�|_||_||_t|��S)Nr)r�)rr��zmaxsize %s not supportedc
	sB|}�	�t�|�}|dk	rx�\}|\}}}}||�<||�<|�}||�<|�<||�<||�<��d7<|SWdQRX�
|�}�	���\}|�kr�n�����
kr�|}||�<||�<|�}�d<|�}	d|�<|�<�|	=|�|<n,|�}||||g}||�<|�<�|<��d7<WdQRX|S)Nrr�)
�args�key�link�rootZ	link_prevZ	link_next�result�lastZoldrootZoldkey)�HITS�KEY�MISSES�NEXT�PREV�RESULT�_len�cache�	cache_get�lockr�
nonlocal_root�stats�
user_functionr�F/opt/alt/python37/lib64/python3.7/site-packages/psycopg2/_lru_cache.py�wrapper&sB
z7lru_cache.<locals>.decorating_function.<locals>.wrapperc	s*��t�����t���SQRXdS)zReport cache statisticsN)�
_CacheInfo�lenr)rrrrrr rr"�
cache_infoVsz:lru_cache.<locals>.decorating_function.<locals>.cache_infoc	sH��:����d}||ddg|dd�<ddg�dd�<WdQRXdS)z$Clear the cache and cache statisticsrN)�clear)r)rrrr rr"�cache_clear[s
z;lru_cache.<locals>.decorating_function.<locals>.cache_clear)	�dict�getr%r�AssertionError�__wrapped__r&r(r)r!rr#r&r()r)
rrrrrrrrrrrr r!r"�decorating_functions$&0z&lru_cache.<locals>.decorating_functionr)rr-r)rr"�	lru_cachesQr.N)r
)	�__doc__�collectionsr�	functoolsr�	threadingrr$r.rrrr"�<module>s