403Webshell
Server IP : 3.96.16.70  /  Your IP : 216.73.216.15
Web Server : Apache
System : Linux ip-172-31-26-103.ca-central-1.compute.internal 6.1.163-186.299.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Feb 24 16:35:42 UTC 2026 x86_64
User : ec2-user ( 1000)
PHP Version : 8.4.18
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/python3.9/site-packages/prompt_toolkit/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3.9/site-packages/prompt_toolkit/__pycache__/cache.cpython-39.pyc
a

ga��@s�ddlmZddlmZddlmZmZmZmZm	Z	m
Z
mZmZm
Z
gd�Zede
d�Zed�ZGdd	�d	e	eef�Zed
ee
dfd�Zed�ZGd
d�deeef�Zededefd�Zdeeegefd�dd�ZdS)�)�deque)�wraps)	�Any�Callable�Deque�Dict�Generic�Hashable�Tuple�TypeVar�cast)�SimpleCache�
FastDictCache�memoized�_T)�bound�_Uc@sJeZdZdZd
edd�dd�Zeegefed�dd	�Z	dd
�dd�Z
dS)r
z�
    Very simple cache that discards the oldest item when the cache size is
    exceeded.

    :param maxsize: Maximum size of the cache. (Don't make it too big.)
    �N��maxsize�returncCs$|dksJ�i|_t�|_||_dS�Nr)�_datar�_keysr)�selfr�r�8/usr/lib/python3.9/site-packages/prompt_toolkit/cache.py�__init__szSimpleCache.__init__)�key�getter_funcrcCspz|j|WStyj|�}||j|<|j�|�t|j�|jkrb|j��}||jvrb|j|=|YS0dS)z�
        Get object from the cache.
        If not found, call `getter_func` to resolve it, and put that on the top
        of the cache instead.
        N)r�KeyErrorr�append�lenr�popleft)rrr�value�
key_to_removerrr�gets


zSimpleCache.get�rcCsi|_t�|_dS)zClear cache.N)rrr)rrrr�clear5szSimpleCache.clear)r)�__name__�
__module__�__qualname__�__doc__�intrrrrr&r(rrrrr
sr
�_K.�_Vc@s<eZdZdZdedefedd�dd�Zeed�d	d
�Z	dS)ra�
    Fast, lightweight cache which keeps at most `size` items.
    It will discard the oldest items in the cache first.

    The cache is a dictionary, which doesn't keep track of access counts.
    It is perfect to cache little immutable objects which are not expensive to
    create, but where a dictionary lookup is still much faster than an object
    instantiation.

    :param get_value: Callable that's called in case of a missing key.
    �@B.N)�	get_value�sizercCs$|dksJ�t�|_||_||_dSr)rrr1r2)rr1r2rrrrTszFastDictCache.__init__)rrcCsHt|�|jkr&|j��}||vr&||=|j|�}|||<|j�|�|S�N)r"r2rr#r1r!)rrr%�resultrrr�__missing__[s

zFastDictCache.__missing__)r0)
r)r*r+r,rr/r-rr.r5rrrrr?sr�_F�rcsttd��fdd�}|S)zI
    Memoization decorator for immutable classes and pure functions.
    )�objrcs4t�d��t��tttd���fdd��}tt|�S)N�r)�a�kwrcs6td����fdd�}�tt�����f}��||�S)Nr'cs��i���Sr3rr)r:r;r8rr�
create_newuszEmemoized.<locals>.decorator.<locals>.new_callable.<locals>.create_new)r�tuple�sorted�itemsr&)r:r;r<r��cacher8)r:r;r�new_callablessz1memoized.<locals>.decorator.<locals>.new_callable)r
rrrr6)r8rBr9r@r�	decoratorps
zmemoized.<locals>.decorator)r6)rrCrr9rrks
rN)r7)�collectionsr�	functoolsr�typingrrrrrr	r
rr�__all__rrr
r.r/r�objectr6r-rrrrr�<module>s,,)

Youez - 2016 - github.com/yon3zu
LinuXploit