403Webshell
Server IP : 217.160.0.244  /  Your IP : 216.73.217.138
Web Server : Apache
System : Linux infong-eu155 4.4.400-icpu-108 #2 SMP Wed Feb 11 11:51:01 UTC 2026 x86_64
User : u100174116 ( 6746176)
PHP Version : 8.5.10
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/breezy/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/breezy/__pycache__/fifo_cache.cpython-313.pyc
�

p��g�&��P�SrSSKJr SSKJrJr "SS\5r"SS\5rg)	z)A simple first-in-first-out (FIFO) cache.�)�deque)�Any�Callablec��\rSrSrSrSS\SS4SjjrSrSrSS	jr	S
r
SrSrS
r
SrSSjrSrSSjrSrSSjrSrSrg)�	FIFOCache�z<A class which manages a cache of entries, removing old ones.N�	max_cache�returnc���[RU5 XlUcURS-S-UlO[	X R5Ul0Ul[
5Ulg)N��
)�dict�__init__�
_max_cache�_after_cleanup_count�min�_cleanupr�_queue��selfr	�after_cleanup_counts   �3/usr/lib/python3/dist-packages/breezy/fifo_cache.pyr�FIFOCache.__init__sX���
�
�d��#���&�(,���!�(;�r�(A�D�%�(+�,?���(Q�D�%�
�	
�
�#(�'���c�$�URXSS9 g)z<Add a value to the cache, there will be no cleanup function.N)�cleanup)�add)r�key�values   r�__setitem__�FIFOCache.__setitem__&s������T��*rc�\�URRU5 URU5 g�N)r�remove�_remove�rrs  r�__delitem__�FIFOCache.__delitem__*s �������3�����S�rc���X;aX	URRU5 [RXU5 UbX0RU'[U5UR:�aUR5 gg)aEAdd a new value to the cache.

Also, if the entry is ever removed from the queue, call cleanup.
Passing it the key and value being removed.

:param key: The key to store it under
:param value: The object to store
:param cleanup: None or a function taking (key, value) to indicate
                'value' should be cleaned up
N)r�appendrr r�lenrr)rrrrs    rr�
FIFOCache.add/sb���;��	������3������E�*���!(�M�M�#���t�9�t���&��L�L�N�'rc��UR$)z(Get the number of entries we will cache.)r�rs r�
cache_size�FIFOCache.cache_sizeEs�����rc�>�[U5UR:�a+UR5 [U5UR:�aM+[UR5[U5:wa7[	SR[UR5[U555eg)z�Clear the cache until it shrinks to the requested size.

This does not completely wipe the cache, just makes sure it is under
the after_cleanup_count.
zLThe length of the queue should always equal the length of the dict. {} != {}N)r+r�_remove_oldestr�AssertionError�formatr.s rr�FIFOCache.cleanupIs|���$�i�$�3�3�3����!��$�i�$�3�3�3��t�{�{��s�4�y�(� �4�4:�F�3�t�{�{�;K�S�QU�Y�4W��
�)rc�F�U(aUR5 U(aMgg)zClear out all of the cache.N)r2r.s r�clear�FIFOCache.clearXs������!��drc�~�URRUS5n[RX5nUbU"X5 U$)z:Remove an entry, making sure to call any cleanup function.N)r�popr)rrr�vals    rr%�FIFOCache._remove^s;���-�-�#�#�C��.���h�h�t�!�����C���
rc�Z�URR5nURU5 g)zRemove the oldest entry.N)r�popleftr%r&s  rr2�FIFOCache._remove_oldesths ���k�k�!�!�#�����S�rc��XlUcUS-S-UlO[X5Ul[U5UR:�aUR	5 gg)z�Increase/decrease the number of cached entries.

:param max_cache: The maximum number of entries to cache.
:param after_cleanup_count: After cleanup, we should have at most this
    many entries. This defaults to 80% of max_cache.
Nrr
)rrrr+rrs   r�resize�FIFOCache.resizemsK��$���&�(1�A�
��(;�D�%�(+�I�(K�D�%��t�9�t���&��L�L�N�'rc�,�[UR5er#)�NotImplementedError�copyr.s rrE�FIFOCache.copy~s��!�$�)�)�,�,rc�,�[UR5er#)rDr:)rr�defaults   rr:�
FIFOCache.pop�s��"�$�(�(�+�+rc�,�[UR5er#)rD�popitemr.s rrK�FIFOCache.popitem�s��!�$�,�,�/�/rc� �X;aX$X U'U$)zSimilar to dict.setdefault.�)rr�
defaultvals   r�
setdefault�FIFOCache.setdefault�s���;��9���S�	��rc�h�[U5S:XaXUSn[U[5(aUHnURXCU5 M OFUSHupEURXE5 M O&[U5S:�a[	S[U535eU(aUHnURXBU5 M gg)zSimilar to dict.update().�rz(update expected at most 1 argument, got N)r+�
isinstancerr�	TypeError)r�args�kwargs�argrr;s      r�update�FIFOCache.update�s����t�9��>��q�'�C��#�t�$�$��C��H�H�S�c�(�+��!%�Q��H�C��H�H�S�&�!(�
��Y��]��F�s�4�y�k�R�S�S��������S�k�*��r)rrrr)�dNr#)�__name__�
__module__�__qualname__�__firstlineno__�__doc__�intrr r'rr/rr7r%r2rArEr:rKrPrY�__static_attributes__rNrrrrs^��F�
*�#�
*�$�
*�+��
�,�
�"���

�"-�,�0��+rrc�J�\rSrSrSrSSjrSSjrSrSrSr	SS	jr
S
rg)
�
FIFOSizeCache�z�An FIFOCache that removes things based on the size of the values.

This differs in that it doesn't care how many actual items there are,
it restricts the cache to be cleaned based on the size of the data.
Nc���[RXS9 XlUcURS-S-UlO[	X R5UlSUlX0lUc[Ulgg)aRCreate a new FIFOSizeCache.

:param max_size: The max number of bytes to store before we start
    clearing out entries.
:param after_cleanup_size: After cleaning up, shrink everything to this
    size (defaults to 80% of max_size).
:param compute_size: A function to compute the size of a value. If
    not supplied we default to 'len'.
)r	Nrr
r)rr�	_max_size�_after_cleanup_sizer�_value_size�
_compute_sizer+)r�max_size�after_cleanup_size�compute_sizes    rr�FIFOSizeCache.__init__�si��	���4��4�!���%�'+�~�~��'9�R�'?�D�$�'*�+=�~�~�'N�D�$����)����!$�D�� rc�X�X;aX	URU5nX@R:�agURRU5 [RXU5 UbX0RU'U=RU-
slURUR:�aUR5 gg)a�Add a new value to the cache.

Also, if the entry is ever removed from the queue, call cleanup.
Passing it the key and value being removed.

:param key: The key to store it under
:param value: The object to store, this value by itself is >=
    after_cleanup_size, then we will not store it at all.
:param cleanup: None or a function taking (key, value) to indicate
                'value' sohuld be cleaned up.
N)
rjrhrr*rr rrirgr)rrrr�	value_lens     rr�FIFOSizeCache.add�s����;��	��&�&�u�-�	��0�0�0�������3������E�*���!(�M�M�#�����I�%�����d�n�n�,��L�L�N�-rc��UR$)z&Get the number of bytes we will cache.)rgr.s rr/�FIFOSizeCache.cache_size�s���~�~�rc��URUR:�a-UR5 URUR:�aM,gg)z�Clear the cache until it shrinks to the requested size.

This does not completely wipe the cache, just makes sure it is under
the after_cleanup_size.
N)rirhr2r.s rr�FIFOSizeCache.cleanup�s:������!9�!9�9����!�����!9�!9�9rc�x�[RX5nU=RURU5-slU$)z8Remove an entry, making sure to maintain the invariants.)rr%rirj)rrr;s   rr%�FIFOSizeCache._remove�s3������*�����D�.�.�s�3�3���
rc���[RX5 XlUcUS-S-UlO[	X5UlUR
UR:�aUR
5 gg)z�Increase/decrease the amount of cached data.

:param max_size: The maximum number of bytes to cache.
:param after_cleanup_size: After cleanup, we should have at most this
    many bytes cached. This defaults to 80% of max_size.
Nrr
)rrArgrhrrir)rrkrls   rrA�FIFOSizeCache.resize�s[��	����(�!���%�'/�!�|�r�'9�D�$�'*�8�'H�D�$����d�n�n�,��L�L�N�-r)rhrjrgri)iNNr#)r\r]r^r_r`rrr/rr%rArbrNrrrdrd�s,���KO�%�2�<�"��rrdN)	r`�collectionsr�typingrrrrrdrNrr�<module>r|s-��"0�� �K+��K+�\`�I�`r

Youez - 2016 - github.com/yon3zu
LinuXploit