HEX
Server: LiteSpeed
System: Linux standart9.isimtescil.net 3.10.0-962.3.2.lve1.5.26.7.el7.x86_64 #1 SMP Wed Oct 2 07:53:12 EDT 2019 x86_64
User: karalev (5310)
PHP: 8.2.29
Disabled: NONE
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�resultZlastZoldrootZoldkey)�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)rrrrrrrr!�
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)rrrrrr!�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)
rrrrrrrrrrrrr r!�decorating_functions$&0z&lru_cache.<locals>.decorating_functionr)rr,r)rr!�	lru_cachesQr-N)r
)	�__doc__�collectionsr�	functoolsrZ	threadingrr#r-rrrr!�<module>s