Your IP : 3.141.21.106


Current Path : /opt/cloudlinux/venv/lib64/python3.11/site-packages/dill/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib64/python3.11/site-packages/dill/__pycache__/__diff.cpython-311.pyc

�

��bg����dZddlZddlZddlZddlZ	ddlZdZn
#e$rdZYnwxYweedd���Z	iZ
iZee
eeeeef��Zed�e
ejejejefD����Zd�Ze
dededededededejdejdejdi
fd	�Zdd
�Zd�Zdd�Z d
�Z!e"Z"d�Z#e#e_"e$ed��re`%eej�&����D]
Z'ee'���e��dS)z@
Module to show if an object has changed since it was memorised
�NTF�getrefcountc��dS)Nr�)�xs �\/builddir/build/BUILD/cloudlinux-venv-1.0.7/venv/lib/python3.11/site-packages/dill/__diff.py�<lambda>rs��1��c#�4K�|]}t|��V��dS�N)�id)�.0�is  r�	<genexpr>r!s8����%�%�!��1���%�%�%�%�%�%r	c��t|��tvst|��tur|tvrdSt|dd��S)zQ
    Gets all the attributes of an object though its __dict__ or return None
    N�__dict__)�type�builtins_types�getattr)�objs r�	get_attrsr%sG���C�y�y�N�"�"�
�s�)�)�t�
�
��~� 5� 5����3�
�D�)�)�)r	c�&�	|j}n#t$rt|��}YnwxYwt}||vr,||r"||d��r|���S|SdSt
r6|tjtjj	j
fvr|jr	|jr|SgS||d��rc||d��rW||d��rK||d��r?||d��r3||d��r'd||<||d��r|���S|Sd||<dS)z9
    Gets all the items in a sequence or return None
    �copy�__contains__�__iter__�__len__TFN)
�	__class__�AttributeErrorr�hasattrr�	HAS_NUMPY�numpy�ndarray�ma�core�MaskedConstant�shape�size)r�cache�o_type�hsattrs    r�get_seqr*/s{�������������c����������
�F�
������=�	��v�c�6�"�"�
"��x�x�z�z�!��J�	�	�
��v�%�-����1M�!N�N�N��9�	���	��J��I�	���^�	$�	$�	����Z�)@�)@�	��6�#�y�!�!�	�&,�f�V�^�&D�&D�	��6�&�*�%�%�	�*0�&���*C�*C�	���f�
��6�#�v���	��8�8�:�:���
���f�
��ts�
�&�&c�
���t|��}|tvr|r	|tvrdSt�t|��}|�d}n-t	�fd�|���D����}t
|��}|�d}n_t|d��r.t	�fd�|���D����}n!t|d��sd}n�fd�|D��}||ft|<|t|<t�|� �fd�|���D��|�_t|d��r"�fd�|���D��dSt|d��r�fd	�|D��dS�|��dSdS)
z�
    Adds an object to the memo, and recursively adds all the objects
    attributes, and if it is a container, its items. Use force=True to update
    an object already in the memo. Updating is not recursively done.
    Nc3�8�K�|]\}}|�|��fV��dSrr�r
�key�value�id_s   �rrzmemorise.<locals>.<genexpr>_s4�����E�E�Z�S�%��S�S��Z�Z�(�E�E�E�E�E�Er	�itemsc3�J�K�|]\}}�|���|��fV��dSrrr-s   �rrzmemorise.<locals>.<genexpr>es<�����H�H�
��U�s�s�3�x�x���E�
�
�+�H�H�H�H�H�Hr	rc�&��g|]
}�|����Srr)r
rr0s  �r�
<listcomp>zmemorise.<locals>.<listcomp>is!���$�$�$�Q�#�#�a�&�&�$�$�$r	c�,��g|]\}}�|����Srr)r
r.r/�mems   �rr4zmemorise.<locals>.<listcomp>os%���0�0�0�
��U���U���0�0�0r	c�B��g|]\}}�|���|��f��Srr)r
r.�itemr6s   �rr4zmemorise.<locals>.<listcomp>ssB���
)�
)�
)���d��c�#�h�h���D�	�	�
"�
)�
)�
)r	c�&��g|]
}�|����Srr)r
r8r6s  �rr4zmemorise.<locals>.<listcomp>ws!���)�)�)�t���T���)�)�)r	)
r�memo�	dont_memor�dictr1r*r�	id_to_obj�memorise)	r�force�obj_id�g�attrs_id�s�seq_idr0r6s	       @@rr>r>Qs�������W�W�F�
��~�~�e�~�v��':�':���
�C��#���A��y�����E�E�E�E�1�7�7�9�9�E�E�E�E�E������A��y����	��G�	�	�%��H�H�H�H�a�g�g�i�i�H�H�H�H�H���
�Q�	�
"�
"�%����$�$�$�$�!�$�$�$���V�#�D��L��I�f��
�C��}�0�0�0�0�a�g�g�i�i�0�0�0�0��}��1�g���	�
)�
)�
)�
)��g�g�i�i�
)�
)�
)�
)�
)�
)��q�)�$�$�
�)�)�)�)�q�)�)�)�)�)�)��#�a�&�&�&�&�&��}r	c�����tjtjtc������fd�t	t�����D��dS)Nc�`��g|]*\}}�|��dk��|���|��f��+S)�r)r
r0r�itop�mp�srcs   ���rr4z release_gone.<locals>.<listcomp>}sJ������h�c�3���C���1����d�3�i�i���C������r	)r=�popr:r�listr1)rHrIrJs@@@r�release_gonerM{sh������M�4�8�[�M�D�"�c�������$�y���/@�/@�*A�*A������r	c���|rdtjvrt`|�i}t|��}||vr|rt	||��S||S|t
vridg||<|rdS||S|tvr#|rdStdt|��z���idf||<t}t}t|�����i}n{t|d}|j}	t�fd�|D����}��
��D]1\}
}||��|	|
d��ks|||dd��r|||
<�2t|��}d}
|��t|d��r�t|d	}t!|��t!|��krd}
n�t|d
��rc|j}	|�
��D]F\}
}||��|	||
����ks||
|dd��s|||dd��rd}
n�Gn7t#||��D]&\}}||��|ks|||dd��rd}
n�'||
f||<|r|p|
S||
fS)aG
    Check an object against the memo. Returns a list in the form
    (attribute changes, container changed). Attribute changes is a dict of
    attribute name to attribute value. container changed is a boolean.
    If simple is true, just returns a boolean. None for either item means
    that it has not been checked yet
    �_NFTzObject not memorised rc3�(�K�|]}|�v�|dfV��
dSrr)r
r.�attrss  �rrz whats_changed.<locals>.<genexpr>�s1�����K�K�c�#�U�:J�:J��D�z�:J�:J�:J�:J�K�Kr	r�r1)�builtinsrrOr�anyr;r:�RuntimeError�str�
whats_changedr�getr<r1r*r�len�zip)r�seen�simple�firstr@�chngdr0�changed�	obj_attrs�obj_getr.�or1�seq_diff�obj_seqr8r�jrQs                  @rrWrW�s����
���(�#�#�#��
��<��D�
��W�W�F�
��~�~��	%��t�F�|�$�$�$��F�|�������E�{��V���	��5��F�|��	�t�	�	��	C��4��6��S���A�B�B�B���;�D��L��E�
�C�
�c�N�N�E��}������L��O�	��-���K�K�K�K�Y�K�K�K�K�K���k�k�m�m�	!�	!�F�C���s�1�v�v����d�+�+�+�+�u�u�Q��d�E�/J�/J�+� �����
�C�L�L�E��H�
����y� 9� 9���v�,�q�/����J�J�#�g�,�,�&�&��H�H�
�S�'�
"�
"�	��k�G�"�[�[�]�]�
�
�	��T��3�t�9�9�����C��� 1� 1�1�1��e�C��t�U�3�3�2��e�D�$��e�4�4�2� $�H��E�	2���E�7�+�+�
�
���1��3�q�6�6�Q�;�;�%�%��4��u�"=�"=�;�#�H��E���H�$�D��L�
�#��"�(�"��H��r	c�$�d|d<t|i|��S)NTr\)rW)�args�kwdss  r�has_changedri�s���D��N��$�'�$�'�'�'r	c�8�ttj�����}t	|i|��}ttj������|��}|D]!}t
tj|���"|S)zn
    Replaces the default __import__, to allow a module to be memorised
    before the user can change it
    )�set�sys�modules�keys�
__import__�
differencer>)rgrh�before�mod�after�ms      r�_impru�s���
���!�!�#�#�
$�
$�F�
�d�
#�d�
#�
#�C���� � �"�"�#�#�.�.�v�6�6�E�
�!�!�����Q�� � � � ��Jr	rO)F)NFT)(�__doc__rS�osrl�typesr r�ImportErrorrrr:r=rkrVrLr<�	frozenset�intrrm�path_importer_cache�environr;r�tupler�
ModuleType�FunctionType�BuiltinFunctionTyper*r>rMrWrirorurrO�valuesrrrr	r�<module>r�s��������	�	�	�	�
�
�
�
�������L�L�L��I�I�������I�I�I������g�c�=�*�*�5�5��

���	���c�4��s�I�s�;�<�<���C�%�%��c�k�3�3J�
�Z�� $�%�%�%�
%�
%�	�*�*�*��U�I�u�d�D�#�t��d�E�4��u��(�%��1C�U��1�5�:�����D'�'�'�'�T���K�K�K�K�\(�(�(��
�
�
�
����
�7�8�S�����
��4���"�"�$�$�%�%���C��H�S�M�M�M�M�������s��%�%

?>