403Webshell
Server IP : 146.190.157.162  /  Your IP : 216.73.216.238
Web Server : Apache
System : Linux ubuntu-s-2vcpu-4gb-amd-sfo3-01-KIT-DIGITAL 6.5.0-44-generic #44-Ubuntu SMP PREEMPT_DYNAMIC Fri Jun 7 15:10:09 UTC 2024 x86_64
User : businessweek ( 639)
PHP Version : 8.2.10-2ubuntu2.2
Disable Function : exec,passthru,shell_exec,system,proc_open,popen,pcntl_exec,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_signal,pcntl_signal_dispatch,pcntl_getpriority,pcntl_setpriority,dl,putenv,parse_ini_file,show_source
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/prompt_toolkit/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/prompt_toolkit/__pycache__/cache.cpython-311.pyc
�

���d���Z�ddlmZddlmZddlmZddlmZmZm	Z	m
Z
mZmZm
Z
mZmZgd�Zede���Zed��ZGd	�d
eeef��Zede
edf���Zed
��ZGd�de
eef��Zededef���Zddd�ZdS)�)�annotations)�deque)�wraps)	�Any�Callable�Deque�Dict�Generic�Hashable�Tuple�TypeVar�cast)�SimpleCache�
FastDictCache�memoized�_T)�bound�_Uc�,�eZdZdZddd�Zdd
�Zdd�ZdS)rz�
    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.)
    ��maxsize�int�return�Nonec�X�|dksJ�i|_t��|_||_dS�Nr)�_datar�_keysr)�selfrs  �6/usr/lib/python3/dist-packages/prompt_toolkit/cache.py�__init__zSimpleCache.__init__s,����{�{�{�{�#%��
� %����
�#������keyr�getter_func�Callable[[], _U]rc�,�	|j|S#t$rz|��}||j|<|j�|��t	|j��|jkr*|j���}||jvr|j|=|cYSwxYw)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.
        )r�KeyErrorr�append�lenr�popleft)rr#r$�value�
key_to_removes     r �getzSimpleCache.get s���	��:�c�?�"���	�	�	��K�M�M�E�#�D�J�s�O��J���c�"�"�"��4�:�����-�-� $�
� 2� 2� 4� 4�
� �D�J�.�.��
�=�1��L�L�L�	���s��BB�Bc�:�i|_t��|_dS)zClear cache.N)rrr)rs r �clearzSimpleCache.clear7s����
��W�W��
�
�
r"N)r)rrrr)r#rr$r%rr)rr)�__name__�
__module__�__qualname__�__doc__r!r-r/�r"r rrs_��������$�$�$�$�$�����.�����r"r�_K.�_Vc�$�eZdZdZddd	�Zdd
�ZdS)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�	get_value�Callable[..., _V]�sizerrrc�X�|dksJ�t��|_||_||_dSr)rrr9r;)rr9r;s   r r!zFastDictCache.__init__Vs,���a�x�x�x�x� %����
�"�����	�	�	r"r#r5r6c���t|��|jkr |j���}||vr||=|j|�}|||<|j�|��|S�N)r)r;rr*r9r()rr#r,�results    r �__missing__zFastDictCache.__missing__]sm���t�9�9�t�y� � � �J�.�.�0�0�M���$�$���'�����%����S�	��
���#�����
r"N)r8)r9r:r;rrr)r#r5rr6)r0r1r2r3r!r@r4r"r rrAsK������
�
�(�����
�
�
�
�
�
r"r�_F�rrr�Callable[[_F], _F]c���d�fd�}|S)zI
    Memoization decorator for immutable classes and pure functions.
    �objrArc�����t�����t���d��fd���}tt|��S)N)r�ar�kwrc�����d���fd�}�tt��������f}��||��S)Nrrc�����i���Sr>r4)rGrHrEs���r �
create_newzEmemoized.<locals>.decorator.<locals>.new_callable.<locals>.create_newws����s�A�}��}�}�$r")rr)�tuple�sorted�itemsr-)rGrHrKr#�cacherEs``  ��r �new_callablez1memoized.<locals>.decorator.<locals>.new_callableuse�����
%�
%�
%�
%�
%�
%�
%�
%��e�F�2�8�8�:�:�.�.�/�/�0�C��9�9�S�*�-�-�-r")rGrrHrrr)rrrrA)rErPrOrs` @�r �	decoratorzmemoized.<locals>.decoratorrsZ�����,7��,H�,H�,H��	�s���	.�	.�	.�	.�	.�	.�
��	.��B��%�%�%r")rErArrAr4)rrQs` r rrms)���
&�&�&�&�&�&��r"N)rB)rrrrC)�
__future__r�collectionsr�	functoolsr�typingrrrr	r
rrr
r�__all__rrrr5r6r�objectrArr4r"r �<module>rXs���"�"�"�"�"�"�������������V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�����
�W�T��"�"�"���W�T�]�]��)�)�)�)�)�'�"�b�&�/�)�)�)�X
�W�T��x��}�-�.�.�.���W�T�]�]��&�&�&�&�&�D��R��L�&�&�&�R
�W�T��#�v�+�.�/�/�/��������r"

Youez - 2016 - github.com/yon3zu
LinuXploit