Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
weakref.cpython-314.pyc134 linesDownload Raw Back to __pycache__
1+
2��ikE��0�Rt^RIHtHtHtHtHtHtHtH	t	^RI3Ht^RIt^RI
t
^RIt]]3t.ROt]P"P%]4!RR]4t!R	R]P(4t!R4R]4t!RR]P(4t!R
R4tR#)ztWeak reference support for Python.5 6This module is an implementation of PEP 205:7 8https://peps.python.org/pep-0205/9)�getweakrefcount�getweakrefs�ref�proxy�CallableProxyType�	ProxyType�
ReferenceType�_remove_dead_weakref)�WeakSetN�WeakKeyDictionary�WeakValueDictionary�10WeakMethod�finalizec�haa�]tRt^&toRtRtRRltV3RltRtRt	]11PtRtVt
V;t#)	r
z�12A custom `weakref.ref` subclass which simulates a weak reference to13a bound method, working around the lifetime problem of bound methods.14c�Baa�VPpVPpTT3Rlp\P!YT4p\
YE4Tn\T4Tn	RTn15\
T4oT# \d&\RP	\T444Rhi;i)z)argument should be a bound method, not {}Nc�h<�S!4pVP'dRVnSeS!V4R#R#R#�FN)�_alive)�arg�self�callback�self_wrs& ���Lib\weakref.py�_cb�WeakMethod.__new__.<locals>._cb5s3����9�D��{�{�{�#����'��T�N�(��T)�__self__�__func__�AttributeError�	TypeError�format�typer�__new__�	_func_ref�16_meth_typer)�cls�methr�obj�funcrrrs&&f    @rr"�WeakMethod.__new__.s����	;��-�-�C��=�=�D�	#��{�{�3�S�)���T�����t�*�������d�)�����!�	;��G�#�V�D��J�/�1�6:�
;�	;�s�A.�.0Bc�v<�\SV`4pVP4pVeVfR#VPW!4#�N)�super�__call__r#r$)rr'r(�	__class__s&  �rr-�WeakMethod.__call__Ds7����g�� ���~�~����;�$�,�����t�)�)rc���\V\4'd_VP'dVP'gWJ#\P!W4;'dVP17VP188H#\#r+)�19isinstancer
rr�__eq__r#�NotImplemented�r�others&&rr2�WeakMethod.__eq__KsR���e�Z�(�(��;�;�;�e�l�l�l��}�$��:�:�d�*�P�P�t�~�~����/P�P��rc���\V\4'd_VP'dVP'gWJ#\P!W4;'gVP20VP218g#\#r+)r1r
rr�__ne__r#r3r4s&&rr8�WeakMethod.__ne__RsS���e�Z�(�(��;�;�;�e�l�l�l��(�(��:�:�d�*�O�O�d�n�n����.O�O��r)rr#r$)r#r$r�__weakref__r+)�__name__�22__module__�__qualname__�__firstlineno__�__doc__�	__slots__r"r-r2r8r�__hash__�__static_attributes__�__classdictcell__�
__classcell__�r.�
__classdict__s@@rr
r
&s3�����23C�I��,*����|�|�H�Hrc��a�]tRt^\toRtRRltRtRtRtRt	Rt24RtR	t]t
R25tRRltR
tRt]tRtRtRtRtRRltRRltRtRtRtRtRtVtR#)rz�Mapping class that references values weakly.26 27Entries in the dictionary will be discarded when no strong28reference to the value exists anymore29c�n�\V4\3RlpW0n/VnVP!V3/VBR#)c�Z�V!4pVe V!VPVP4R#R#r+)�data�key)�wr�selfref�_atomic_removalrs&&& r�remove�,WeakValueDictionary.__init__.<locals>.removeis(���9�D��� ��	�	�2�6�6�2� rN)rr	�_removerJ�update)rr5�kwrOs"", r�__init__�WeakValueDictionary.__init__hs0��"�4�y�:N�	3�����	����E� �R� rc�T�VPV,!4pVf\V4hV#r+�rJ�KeyError�rrK�os&& r�__getitem__�WeakValueDictionary.__getitem__ss&���I�I�c�N����9��3�-���Hrc� �VPVR#r+)rJ�rrKs&&r�__delitem__�WeakValueDictionary.__delitem__zs
���I�I�c�Nrc�,�\VP4#r+��lenrJ�rs&r�__len__�WeakValueDictionary.__len__}����4�9�9�~�rc�`�VPV,!4pVRJ# \dR#i;irrWrYs&& r�__contains__� WeakValueDictionary.__contains__�s7��	��	�	�#�� �A���}����	��	�s��-�-c�R�RVPP\V43,#�z<%s at %#x>�r.r;�idrds&r�__repr__�WeakValueDictionary.__repr__�� ������ 7� 7��D��B�B�Brc�L�\W PV4VPV&R#r+)�KeyedRefrQrJ�rrK�values&&&r�__setitem__�WeakValueDictionary.__setitem__�s��!�%���s�;��	�	�#�rc��\4pVPP4P4Fwr#V!4pVfKWAV&K	V#r+)rrJ�copy�items)r�newrKrLrZs&    rry�WeakValueDictionary.copy�sD��!�#���y�y�~�~�'�-�-�/�G�C���A��}��C��0��30rc���^RIHpVP4pVPP4P	4FwrEV!4pVfKWcV!WA4&K	V#��)�deepcopy�ryr�r.rJrz)r�memor�r{rKrLrZs&&     r�__deepcopy__� WeakValueDictionary.__deepcopy__�sQ��!��n�n����y�y�~�~�'�-�-�/�G�C���A��}�+,�H�S�'�(�0��31rNc�n�VPV,pV!4pVfV#V# \dTu#i;ir+rW)rrK�defaultrLrZs&&&  r�get�WeakValueDictionary.get�sB��32	����3��B���A��y�������	��N�	�s�$�
4�4c#�"�VPP4P4FwrV!4pVfKW3x�K	R#5ir+�rJryrz)r�krL�vs&   rrz�WeakValueDictionary.items�s8����Y�Y�^�^�%�+�+�-�E�A���A��}��d�33�.��34�6A�Ac#�"�VPP4P4FwrV!4fKVx�K	R#5ir+r�)rr�rLs&  r�keys�WeakValueDictionary.keys�s2����Y�Y�^�^�%�+�+�-�E�A��t����.��35�4A�36Ac#�r"�VPP4P4Rjx�L37R#L5i)a`Return an iterator that yields the weak references to the values.38 39The references are not guaranteed to be 'live' at the time40they are used, so the result of calling the references needs41to be checked before being used.  This can be used to avoid42creating references that will cause the garbage collector to43keep the values around longer than needed.44 45N�rJry�valuesrds&r�
itervaluerefs�!WeakValueDictionary.itervaluerefs�s$����9�9�>�>�#�*�*�,�,�,�s�,7�5�7c#�"�VPP4P4FpV!4pVfKVx�K	R#5ir+r��rrLr's&  rr��WeakValueDictionary.values�s4����)�)�.�.�"�)�)�+�B��$�C����	�,�r�c�\�VPP4wrV!4pVfK*W3#�T�rJ�popitem)rrKrLrZs&   rr��WeakValueDictionary.popitem�s,����i�i�'�'�)�G�C���A��}��v�
rc��VPPV4!4pVfV'd46V^,#\V4hV# \dRpL1i;ir+)rJ�poprX)rrK�argsrZs&&* rr��WeakValueDictionary.pop�sT��	��	�	�
�
�c�"�$�A�
�9���A�w���s�m�#��H���	��A�	�s� A�
A�Ac��VPV,!4pVf&\W PV4VPV&V#V# \dRpL:i;ir+)rJrXrsrQ)rrKr�rZs&&& r�47setdefault�WeakValueDictionary.setdefault�sV��	��	�	�#�� �A�
�9�%�g�|�|�S�A�D�I�I�c�N��N��H��
�	��A�	�s�A�
A�Ac�$�VPpVeO\VR4'g\V4pVP4FwrE\	WPP48V4W4&K	VP4FwrE\	WPP49V4W4&K	R#�Nrz)rJ�hasattr�dictrzrsrQ)rr5�kwargs�drKrZs"",   rrR�WeakValueDictionary.update�so���I�I�����5�'�*�*��U����+�+�-���!�!�\�\�3�7���(��l�l�n�F�C��a���s�3�A�F�%rc�d�\VPP4P44#)aNReturn a list of weak references to the values.50 51The references are not guaranteed to be 'live' at the time52they are used, so the result of calling the references needs53to be checked before being used.  This can be used to avoid54creating references that will cause the garbage collector to55keep the values around longer than needed.56 57)�listrJryr�rds&r�	valuerefs�WeakValueDictionary.valuerefs�s#���D�I�I�N�N�$�+�+�-�.�.rc�(�VPV4V#r+�rRr4s&&r�__ior__�WeakValueDictionary.__ior__������E���rc��\V\P4'd$VP4pVP	V4V#\58#r+�r1�_collections_abc�MappingryrRr3�rr5�cs&& r�__or__�WeakValueDictionary.__or__�7���e�-�5�5�6�6��	�	��A�
�H�H�U�O��H��rc��\V\P4'd5VP4pVP	V4VP	V4V#\59#r+�r1r�r�r.rRr3r�s&& r�__ror__�WeakValueDictionary.__ror__�C���e�-�5�5�6�6���� �A�
�H�H�U�O�
�H�H�T�N��H��r�rQrJ)�r+)r;r<r=r>r?rTr[r_rerirorvry�__copy__r�r�rzr��__iter__r�r�r�r�r�rRr�r�r�r�rBrC�rFs@rrr\s������	!�����C�<���H�����60�H�61-����	�4�62/����rc�@aa�]tRtRtoRtRtRtV3RltRtVt	V;t63#)rsiaGSpecialized reference that includes a key corresponding to the value.64 65This is used in the WeakValueDictionary to avoid having to create66a function object for each key stored in the mapping.  A shared67callback object can use the 'key' attribute of a KeyedRef instead68of getting a reference to the key from an enclosing scope.69 70c�@�\P!WV4pW4nV#r+)rr"rK)r!�obrrKrs&&&& rr"�KeyedRef.__new__!s���{�{�4�X�.�����rc�&<�\SV`W4R#r+)r,rT)rr�rrKr.s&&&&�rrT�KeyedRef.__init__&s���
����&r�rK)r;r<r=r>r?r@r"rTrBrCrDrEs@@rrsrss ������I��71'�'rrsc�a�]tRtRtoRtRRltRtRtRtRt	R	t72R73t]tRt
RRltR
tRtRt]tRtRtRtRtRRltRRltRtRtRtRtVtR#)ri*alMapping class that references keys weakly.74 75Entries in the dictionary will be discarded when there is no76longer a strong reference to the key. This can be used to77associate additional data with an object owned by other parts of78an application without adding attributes to those objects. This79can be especially useful with objects that override attribute80accesses.81Nc�l�/Vn\V43RlpW nVeVPV4R#R#)c�`�V!4pVeVPVR#R# \dR#i;ir+rW)r�rMrs&& rrO�*WeakKeyDictionary.__init__.<locals>.remove7s8���9�D�����	�	�!�� �� ����s�
�-�-N)rJrrQrR)rr�rOs&& rrT�WeakKeyDictionary.__init__5s3����	�!�$�i�	������K�K���rc�2�VP\V4R#r+�rJrr^s&&rr_�WeakKeyDictionary.__delitem__Bs���I�I�c�#�h�rc�:�VP\V4,#r+r�r^s&&rr[�WeakKeyDictionary.__getitem__Es���y�y��S��"�"rc�,�\VP4#r+rbrds&rre�WeakKeyDictionary.__len__Hrgrc�R�RVPP\V43,#rlrmrds&rro�WeakKeyDictionary.__repr__Krqrc�H�W P\WP4&R#r+)rJrrQrts&&&rrv�WeakKeyDictionary.__setitem__Ns��,1�	�	�#�c�<�<�(�)rc��\4pVPP4P4Fwr#V!4pVfKW1V&K	V#r+)rrJryrz)rr{rKrurZs&    rry�WeakKeyDictionary.copyQsD���!���)�)�.�.�*�0�0�2�J�C���A��}��A��3��82rc���^RIHpVP4pVPP4P	4FwrEV!4pVfKV!WQ4W6&K	V#r~r�)rr�r�r{rKrurZs&&     rr��WeakKeyDictionary.__deepcopy__[sP��!��n�n����)�)�.�.�*�0�0�2�J�C���A��}�!�%�.���3��83rc�L�VPP\V4V4#r+)rJr�r�rrKr�s&&&rr��WeakKeyDictionary.getds���y�y�}�}�S��X�g�.�.rc�Z�\V4pY P9# \dR#i;i)F)rrrJ)rrKrLs&& rri�WeakKeyDictionary.__contains__gs2��	��S��B��Y�Y�����	��	�s��*�*c#�"�VPP4P4FwrV!4pVfKW23x�K	R#5ir+r�)rrLrurKs&   rrz�WeakKeyDictionary.itemsns9��������)�/�/�1�I�B��$�C����j� �2�r�c#�r"�VPP4FpV!4pVfKVx�K	R#5ir+)rJryr�s&  rr��WeakKeyDictionary.keysts+����)�)�.�.�"�B��$�C����	�#�s�&7�847c#�"�VPP4P4FwrV!4fKVx�K	R#5ir+r�)rrLrus&  rr��WeakKeyDictionary.values|s2��������)�/�/�1�I�B��t����2�r�c�,�\VP4#)aJReturn a list of weak references to the keys.85 86The references are not guaranteed to be 'live' at the time87they are used, so the result of calling the references needs88to be checked before being used.  This can be used to avoid89creating references that will cause the garbage collector to90keep the keys around longer than needed.91 92)r�rJrds&r�keyrefs�WeakKeyDictionary.keyrefs�s���D�I�I��rc�\�VPP4wrV!4pVfK*W23#r�r�)rrKrurZs&   rr��WeakKeyDictionary.popitem�s,������*�*�,�J�C���A��}��x�rc�P�VPP!\V4.VO5!#r+)rJr�r)rrKr�s&&*rr��WeakKeyDictionary.pop�s���y�y�}�}�S��X�-��-�-rc�`�VPP\WP4V4#r+)rJr�rrQr�s&&&rr��WeakKeyDictionary.setdefault�s"���y�y�#�#�C��\�\�$:�7�C�Crc��VPpVeT\VR4'g\/4!V4pVP4FwrEWS\	W@P934&K	\
V4'dVPV4R#R#r�)rJr�r!rzrrQrcrR)rr�r�r�rKrus"",   rrR�WeakKeyDictionary.update�sh���I�I�����4��)�)��B�x��~��"�j�j�l�94��,1�#�c�<�<�(�)�+��v�;�;��K�K���rc�(�VPV4V#r+r�r4s&&rr��WeakKeyDictionary.__ior__�r�rc��\V\P4'd$VP4pVP	V4V#\95#r+r�r�s&& rr��WeakKeyDictionary.__or__�r�rc��\V\P4'd5VP4pVP	V4VP	V4V#\96#r+r�r�s&& rr��WeakKeyDictionary.__ror__�r�rr�r+)r;r<r=r>r?rTr_r[rerorvryr�r�r�rirzr�r�r�r�r�r�r�rRr�r�r�rBrCr�s@rrr*s������� �#��C�2���H��/��!���H��97 98� �.�D� ����rc��a�]tRtRtoRtRt/tRt]P!4t99RtRt!RR4t
RtRRltR	tR100t]R4t]R4t]P*R
4tRt]R4t]R4tRtVtR#)ri�a�Class for finalization of weakrefable objects101 102finalize(obj, func, *args, **kwargs) returns a callable finalizer103object which will be called when obj is garbage collected. The104first time the finalizer is called it evaluates func(*arg, **kwargs)105and returns the result. After this the finalizer is dead, and106calling it just returns None.107 108When the program exits any remaining finalizers for which the109atexit attribute is true will be run in reverse order of creation.110By default atexit is true.111Fc��]tRtRtRtRtR#)zfinalize._Infoi�r�N)�weakrefr(r�r��atexit�index)r;r<r=r>r@rBr�rr�_Info�finalize._Info�s��L�	rrc�l�VP'g+^RIpVPVP4R\nVP4p\
W4VnW&nW6n	T;'gRVn112RVn\VP4Vn
W`PV&R\nR#)rNT)�_registered_with_atexitr�register�	_exitfuncrrrrr(r�r��next�_index_iterr�	_registry�_dirty)rr'r(r�r�r�infos"""*,  rrT�finalize.__init__�s����+�+�+�
��O�O�D�N�N�+�/3�H�,��z�z�|���3�~����	��	��n�n��������$�*�*�+��113�#���t����rNc���VPPVR4pV'dEVP'g1VP!VP/VP114;'g/B#R#R#)zRIf alive then mark as dead and return func(*args, **kwargs);115otherwise return NoneN)rr��	_shutdownr(r�r�)r�_rs&& rr-�finalize.__call__�sP���~�~�!�!�$��-��������9�9�d�i�i�?�D�K�K�,=�,=�2�?�?�'�4rc��VPPV4pT;'dVP4pVeRVPPVR4'd.Y!PVP116VP;'g/3#R#R#)zVIf alive then mark as dead and return (obj, func, args, kwargs);117otherwise return NoneN)rr�rr�r(r�r��rrr's&  r�detach�finalize.detach�sn���~�~�!�!�$�'���%�%�t�|�|�~���?�t�~�~�1�1�$��=�=����D�I�I�t�{�{�/@�/@�b�A�A� >�?rc���VPPV4pT;'dVP4pVe.Y!PVPVP118;'g/3#R#)zEIf alive then return (obj, func, args, kwargs);119otherwise return NoneN)rr�rr(r�r�rs&  r�peek�
finalize.peek�sV���~�~�!�!�$�'���%�%�t�|�|�~���?����D�I�I�t�{�{�/@�/@�b�A�A�rc��WP9#)zWhether finalizer is alive)rrds&r�alive�finalize.alive�s���~�~�%�%rc�v�VPPV4p\V4;'d
VP#)z*Whether finalizer should be called at exit�rr��boolr)rrs& rr�finalize.atexits.���~�~�!�!�$�'���D�z�)�)�d�k�k�)rc�p�VPPV4pV'd\V4VnR#R#r+r!)rrurs&& rrr#s)���~�~�!�!�$�'����u�+�D�K�rc�L�VPPV4pT;'dVP4pVf(R\V4P\V43,#R\V4P\V4\V4P\V43,#)Nz<%s object at %#x; dead>z!<%s object at %#x; for %r at %#x>)rr�rr!r;rnrs&  rro�finalize.__repr__
s����~�~�!�!�$�'���%�%�t�|�|�~���;�-��d��1D�1D�b��h�0O�O�O�6��d��$�$�b��h��S�	�0B�0B�B�s�G�L�M�
Mrc���VPP4UUu.uFwrVP'gKW3NK	pppVPRR7VUUu.uFwrVNK		upp#uuppiuuppi)c�(�V^,P#)�)r)�items&r�<lambda>�+finalize._select_for_exit.<locals>.<lambda>s��t�A�w�}�}rr�)rrzr�sort)r%�f�i�Ls&   r�_select_for_exit�finalize._select_for_exitsb��!$�
�
� 3� 3� 5�B� 5�u�����U�a�U� 5��B�	���,��-� �!�q�e�q��q�!�!��
C��!s�A,�A,�
A2c�n�RpVP'd�^RIpVP4'dRpVP4RpVe\P120'dVP
4pR\nV'gM,VP4pV!4W@P9dKiQhR\nV'dXP4R#R# \d+\P!\P!4!Loi;i R\nT'dXP4ii;i)FNT)r�gc�	isenabled�disablerrr1r��	Exception�sys�121excepthook�exc_infor�enable)r%�reenable_gcr4�pendingr.s&    rr�finalize._exitfuncs���122��	��}�}�}���<�<�>�>�"&�K��J�J�L������(�/�/�/�"%�"6�"6�"8��*/���"�����
�A�8�123���M�M�1�1�1�"&�H����	�	����
%�8��������7�8��124"&�H����	�	���sK�D�D�.D�"D�D�C�
D�-D�2D�D�125D�D�&D4r�r+)r;r<r=r>r?r@rr�	itertools�countr
rr	rrTr-rr�propertyrr�setterro�classmethodr1rrBrCr�s@rrr�s������"�I��I��I��/�/�#�K�
�F�#��M�M��"@�B�B��&��&��*��*�126�]�]�&��&�127M��"��"�� �� r)
rrrrrrrr�128ProxyTypesrr129r
r)r?�_weakrefrrrrrrrr	�_weakrefsetr130r�r8r?rD�__all__�131MutableSetr132r
�MutableMappingrrsrrr�rr�<module>rJs������� ��133���*�
+�134�0�����$�$�W�-�3��3�lv�*�9�9�v�r'�s�'�*K�(�7�7�K�\F�Fr
codekingpro/portable-devtools · Team Ai