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/dulwich/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/dulwich/__pycache__/lru_cache.cpython-313.pyc
�

mEdgc=���SrSSKJrJr SSKJrJrJrJr \	"5r
\"S5r\"S5r"SS\\\45r
"SS	\\\45r"S
S\\\45rg)
z)A simple least-recently-used (LRU) cache.�)�Iterable�Iterator)�Callable�Generic�Optional�TypeVar�K�Vc�z�\rSrSr%SrSr\S\S'\\S'\\	\S'SS	\S
\
SS4SjjrS\4S
jr
SSjrSrg)�_LRUNode�#z:This maintains the linked-list which is the lru internals.)�cleanup�key�next_key�prev�size�valuez_LRUNode[K, V]rrrNrr�returnc�Z�SUl[UlXlX lX0lSUlg�N)r�	_null_keyrrrrr)�selfrrrs    �3/usr/lib/python3/dist-packages/dulwich/lru_cache.py�__init__�_LRUNode.__init__,s(����	�!��
����
�����	�c��URcSnOURRnURRSUR<SUR<SU<S3$)N�(z n:z p:�))rr�	__class__�__name__r)r�prev_keys  r�__repr__�_LRUNode.__repr__7sR���9�9���H��y�y�}�}�H��.�.�)�)�*�!�D�H�H�<�s�4�=�=�:K�3�x�l�Z[�\�\rc�|�URb&URURUR5 SUlU?gr)rrr�rs r�run_cleanup�_LRUNode.run_cleanup>s.���<�<�#��L�L����4�:�:�.�����Jrr�rN)r!�
__module__�__qualname__�__firstlineno__�__doc__�	__slots__r�__annotations__r	�intr
r�strr#r'�__static_attributes__�rrrr#sR��D�G�I�
�#�
$�$��K�
�3�-��	�A�	�a�	�$�	�]�#�]�rrc
���\rSrSr%Sr\\\\4\	S'\\\\4\	S'S!S\
S\\
SS4S	jjrS
\S\4Sjr
S
\S\4SjrS\
4S
jrS\\\\44SjrS"S
\S\S\\\\/S4SS4SjjrS\
4SjrS"S
\S\\S\\4SjjrS\\4SjrS\\\44SjrS#SjrS
\S\SS4SjrS\\\4SS4SjrS\\\4SS4SjrS#SjrS#SjrS"S\
S\\
SS4Sjjr S"S#Sjjr!S r"g)$�LRUCache�Fz?A class which manages a cache of entries, removing unused ones.�_least_recently_used�_most_recently_usedN�	max_cache�after_cleanup_countrc�P�0UlSUlSUlURX5 gr)�_cacher8r7�_update_max_cache�rr9r:s   rr�LRUCache.__init__Ls)��02���#'�� �$(��!����y�>rrc��XR;$r)r<)rrs  r�__contains__�LRUCache.__contains__Vs���k�k�!�!rc�N�URnX!nURnX4LaUR$URnURnU[
LaXPlO
X&nXWlU(deU(deXelURUlX4lX0lSUlUR$r)r<r8rrrrr7r)rr�cache�node�mru�	node_prevr�	node_nexts        r�__getitem__�LRUCache.__getitem__Ys��������z��
�&�&���;��:�:���I�I�	��=�=���y� �)2�%���I�&�N���y��
�s�%������
���#'� ���	��z�z�rc�,�[UR5$r)�lenr<r&s r�__len__�LRUCache.__len__zs���4�;�;��rc#�# �URnUbURb[SU35eUb�UR[LaXR
La[SU35eSnO6URURnURULa[SU35eURcXRLa[SU35eO2URRUR:wa[SU35eUv� UnUbM�gg7f)z2Walk the LRU list, only meant to be used in tests.NzGthe _most_recently_used entry is not supposed to have a previous entry z.only the last node should have no next value: z-inconsistency found, node.next.prev != node: z>only the _most_recently_used should not have a previous node: z-inconsistency found, node.prev.next != node: )r8r�AssertionErrorrrr7r<r�rrErHs   r�	_walk_lru�LRUCache._walk_lru}s+����'�'�����y�y�$�$���v����
���}�}�	�)��8�8�8�(�K�D�6�R���!�	� �K�K��
�
�6�	��>�>��-�(�J�4�&�Q����y�y� ��7�7�7�(�6�6:�V�=���8��9�9�%�%����1�(�J�4�&�Q����J��D�3��s�C;D�?Drrc�\�U[La[S5eXR;a,URUnUR5 X$lX4lO[
XUS9nX@RU'URU5 [UR5UR:�aUR5 gg)�Add a new value to the cache.

Also, if the entry is ever removed from the cache, call
cleanup(key, value).

Args:
  key: The key to store it under
  value: The object to store
  cleanup: None or a function taking (key, value) to indicate
                'value' should be cleaned up.
�cannot use _null_key as a key�rN)
r�
ValueErrorr<r'rrr�_record_accessrL�
_max_cache)rrrrrEs     r�add�LRUCache.add�s����)���<�=�=��+�+���;�;�s�#�D������J�"�L��C��8�D�#�K�K������D�!��t�{�{��d�o�o�-��L�L�N�.rc��UR$)z(Get the number of entries we will cache.)rZr&s r�
cache_size�LRUCache.cache_size�s�����r�defaultc�~�URRUS5nUcU$URU5 UR$r)r<�getrYr)rrr`rEs    rrb�LRUCache.get�s8���{�{���s�D�)���<��N����D�!��z�z�rc�6�URR5$)z�Get the list of keys currently cached.

Note that values returned here may not be available by the time you
request them later. This is simply meant as a peak into the current
state.

Returns: An unordered list of keys that are currently cached.
)r<�keysr&s rre�
LRUCache.keys�s���{�{���!�!rc��URR5VVs0sHupXR_M snn$s snnf)z"Get the key:value pairs as a dict.)r<�itemsr)r�k�ns   rrh�LRUCache.items�s1��'+�{�{�'8�'8�':�;�':�t�q��7�7�
�':�;�;��;s�:c��[UR5UR:�a6UR5 [UR5UR:�aM5gg)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.
N)rLr<�_after_cleanup_count�_remove_lrur&s rr�LRUCache.cleanup�s@���$�+�+���!:�!:�:������$�+�+���!:�!:�:rc�$�URXSS9 g)z<Add a value to the cache, there will be no cleanup function.NrW)r[)rrrs   r�__setitem__�LRUCache.__setitem__�s������T��*rrEc���URc
XlXlgXRLagXRLaURUlURbURURlUR[La*UR
URnURUlURRUlXRlXlSUlg)zRecord that key was accessed.N)r8r7rrrr<rrQs   rrY�LRUCache._record_access�s����#�#�+�'+�$�(,�%��
�-�-�
-���,�,�,�(,�	�	�D�%��9�9� �!%���D�I�I���=�=�	�)����D�M�M�2�I�!�Y�Y�I�N��0�0�4�4��
�(,� � �%�#'� ���	rc���XRLaURUlURRUR5 URcSUlUR
5 URbURURlUR[La*URURnURUlSUl[Ulgr)	r7rr<�poprr8r'rrrQs   r�_remove_node�LRUCache._remove_nodes����,�,�,�(,�	�	�D�%���������!��$�$�,�'+�D�$������9�9� �!%���D�I�I���=�=�	�)����D�M�M�2�I�!�Y�Y�I�N���	�!��
rc�`�UR(deURUR5 g)z�Remove one entry from the lru, and handle consequences.

If there are no more references to the lru, then this entry should be
removed from the cache.
N)r7rwr&s rrn�LRUCache._remove_lrus'���(�(�(�(����$�3�3�4rc�n�UR(a$UR5 UR(aM#gg)zClear out all of the cache.N)r<rnr&s r�clear�LRUCache.clears"���k�k������k�k�krc�"�URXS9 g)z1Change the number of entries that will be cached.)r:N)r=r>s   r�resize�LRUCache.resize#s�����y��Rrc��XlUcURS-S-UlO[X R5UlUR5 g�N��
)rZrm�minrr>s   rr=�LRUCache._update_max_cache's>��#���&�(,���!�(;�b�(@�D�%�(+�,?���(Q�D�%����r)rmr<r7rZr8)�dNrr))#r!r*r+r,r-rrr	r
r/r0r�boolrArIrMrrRrr[r^rbrre�dictrhrrqrYrwrnr|rr=r2r3rrr5r5Fs���I�"�8�A�q�D�>�2�2�!�(�1�a�4�.�1�1�JN�?��?�9A�#��?�	
�?�"��"�d�"��q��Q��B �� �#�8�H�Q��T�N�3�#�LMQ������)1�(�A�q�6�4�<�2H�)I��	
��<�C���q��8�A�;��(�1�+��	"�h�q�k�	"�<�t�A�q�D�z�<��+�q�+��+�t�+��8�A�q�D�>��d��4"��!�Q�$��"�D�"�$5��S��S�(�3�-�S�SW�S��rr5c
��\rSrSr%Sr\\/\4\S'SS\S\	\S\	\\/\4SS4S	jjr
SS
\S\S\	\\\/S4SS4S
jjrSSjr
S\\\4SS4SjrSS\S\	\SS4SjjrSS\S\	\SS4SjjrSrg)�LRUSizeCachei0aAAn LRUCache 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 just restricts the cache to be cleaned up after so much data is stored.

The size of items added will be computed using compute_size(value), which
defaults to len() if not supplied.
�
_compute_sizeN�max_size�after_cleanup_size�compute_sizerc	��SUlUc[UlOX0lURXS9 [RU[
[US-5S5S9 g)aDCreate a new LRUSizeCache.

Args:
  max_size: The max number of bytes to store before we start
    clearing out entries.
  after_cleanup_size: After cleaning up, shrink everything to this
    size.
  compute_size: A function to compute the size of the values. We
    use a function here, so that you can pass 'len' if you are just
    using simple strings, or a more complex function if you are using
    something like a list of strings, or even a custom object.
    The function should take the form "compute_size(value) => integer".
    If not supplied, it defaults to 'len()'
rN�r���)r9)�_value_sizerLr��_update_max_sizer5r�maxr0)rr�r�r�s    rr�LRUSizeCache.__init__<sT��(�����!$�D��!-�����h��N����$�#�c�(�S�.�.A�1�*E��Frrrrc�&�U[La[S5eURRUS5nUR	U5nXPR
:�a UbUR
U5 UbU"X5 gUc[XUS9nX@RU'O.URceU=RUR-sl	XTlU=RU-
sl	URU5 URUR:�aUR5 gg)rUrVNrW)
rrXr<rbr��_after_cleanup_sizerwrrr�rY�	_max_sizer)rrrrrE�	value_lens      rr[�LRUSizeCache.addXs����)���<�=�=��{�{���s�D�)���&�&�u�-�	��0�0�0����!�!�$�'��"���#���<��C��8�D�#�K�K����9�9�(�(�(�����	�	�)���	����I�%�����D�!����d�n�n�,��L�L�N�-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)r�r�rnr&s rr�LRUSizeCache.cleanup�s:������!9�!9�9���������!9�!9�9rrEc��URceU=RUR-sl[RX5 gr)rr�r5rw)rrEs  rrw�LRUSizeCache._remove_node�s5���y�y�$�$�$����D�I�I�%�����d�)rc�t�URXS9 [[US-5S5nURU5 g)z/Change the number of bytes that will be cached.r�r�r�N)r�r�r0r=)rr�r�r9s    rr�LRUSizeCache.resize�s6�����h��N���H�s�N�+�Q�/�	����y�)rc�z�XlUcURS-S-Ulg[X R5Ulgr�)r�r�r�)rr�r�s   rr��LRUSizeCache._update_max_size�s7��"���%�'+�~�~��'9�R�'?�D�$�'*�+=�~�~�'N�D�$r)r�r�r�r�)iNNrr))r!r*r+r,r-rr
r0r/rrr	r[rrrwrr�r2r3rrr�r�0s����Q�C��H�%�%�$�,0�59�	G��G�%�S�M�G��x���S��1�2�	G�

�G�:MQ�'��'��'�)1�(�A�q�6�4�<�2H�)I�'�	
�'�R�*��!�Q�$��*�D�*�
*�s�*���
�*�QU�*�BF�O��O�19�#��O�	
�O�Orr�N)r-�collections.abcrr�typingrrrr�objectrr	r
rr5r�r3rr�<module>r�sr��.0�.�7�7��H�	��C�L���C�L�� �w�q�!�t�}� �Fg�w�q�!�t�}�g�TmO�8�A�q�D�>�mOr

Youez - 2016 - github.com/yon3zu
LinuXploit