Hacked By AnonymousFox

Current Path : /opt/cloudlinux/venv/lib/python3.11/site-packages/sqlalchemy/orm/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib/python3.11/site-packages/sqlalchemy/orm/__pycache__/identity.cpython-311.pyc

�

�܋f�(���ddlZddlmZddlmZddlmZddlmZGd�de��ZGd	�d
e��Z	Gd�de��Z
dS)
�N�)�
attributes)�util�)�excc��eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zdd�Zd�Zd�Zd�Zd�ZdS)�IdentityMapc�l�i|_t��|_tj|��|_dS�N)�_dict�set�	_modified�weakref�ref�_wr��selfs �N/opt/cloudlinux/venv/lib64/python3.11/site-packages/sqlalchemy/orm/identity.py�__init__zIdentityMap.__init__s)����
�������;�t�$�$�����c�4�|j���Sr)r�keysrs rrzIdentityMap.keyss���z��� � � rc��t���r��NotImplementedError�r�states  r�replacezIdentityMap.replace���!�#�#�#rc��t���rrrs  r�addzIdentityMap.addrrc�0�|�|��dS)zUoptional inlined form of add() which can assume item isn't present
        in the mapN)r!�rr�keys   r�_add_unpresentzIdentityMap._add_unpresents��	
��������rc� �td����Nz%IdentityMap uses add() to insert datar)r�dict_s  r�updatezIdentityMap.update$���!�"I�J�J�Jrc� �td����Nz(IdentityMap uses remove() to remove datarrs r�clearzIdentityMap.clear'���!�"L�M�M�Mrc�d�|j|_|jr|j�|��dSdSr)r�_instance_dict�modifiedrr!rs  r�_manage_incoming_statez"IdentityMap._manage_incoming_state*s<��#�x����>�	&��N���u�%�%�%�%�%�	&�	&rc�P�|`|jr|j�|��dSdSr)r0r1r�discardrs  r�_manage_removed_statez!IdentityMap._manage_removed_state0s8��� ��>�	*��N�"�"�5�)�)�)�)�)�	*�	*rc��|jSr)rrs r�
_dirty_stateszIdentityMap._dirty_states5s
���~�rc�*�t|j��S)z[return True if any InstanceStates present have been marked
        as 'modified'.

        )�boolrrs r�check_modifiedzIdentityMap.check_modified8s��
�D�N�#�#�#rc�
�||vSr��rr$s  r�has_keyzIdentityMap.has_key?s���d�{�rc� �td���r,rrs r�popitemzIdentityMap.popitemBr.rc� �td���r,r)rr$�argss   r�popzIdentityMap.popEr.rNc� �td���r'r�rr$�defaults   r�
setdefaultzIdentityMap.setdefaultHr*rc�*�t|j��Sr)�lenrrs r�__len__zIdentityMap.__len__Ks���4�:���rc��t���rrrs r�copyzIdentityMap.copyNrrc� �td���r'r)rr$�values   r�__setitem__zIdentityMap.__setitem__Qr*rc� �td���r,rr=s  r�__delitem__zIdentityMap.__delitem__Tr.rr)�__name__�
__module__�__qualname__rrrr!r%r)r-r2r5r7r:r>r@rCrGrJrLrOrQr<rrr	r	sN������%�%�%�
!�!�!�$�$�$�$�$�$����
K�K�K�N�N�N�&�&�&�*�*�*�
���$�$�$����N�N�N�N�N�N�K�K�K�K����$�$�$�K�K�K�N�N�N�N�Nrr	c��eZdZd�Zd�Zd�Zd�Zd�Zd�Zdd�Z	d	�Z
d
�Zd�Ze
jrd�Zd
�Zd�Zd�Zd�Zd�Zd�ZdS)�WeakInstanceDictc�j�|j|}|���}|�t|���|Sr�r�obj�KeyError�rr$r�os    r�__getitem__zWeakInstanceDict.__getitem__Ys0���
�3����I�I�K�K���9��3�-�-���rc��	||jvr"|j|}|���}ndS	|duS#t$rYdSwxYw�NFrXr[s    r�__contains__zWeakInstanceDict.__contains__`sh��		!��d�j� � ��
�3����I�I�K�K����u���D�=� ���	�	�	��5�5�	���s�+4�
A�Ac�n�|j|jvr&	|j|j|uS#t$rYdSwxYwdSr_)r$rrZrs  r�contains_statezWeakInstanceDict.contains_statelsS���9��
�"�"�
��z�%�)�,��5�5���
�
�
��u�u�
�����5s�$�
2�2c���|j|jvr?	|j|j}||ur|�|��ndS#t$rYnwxYwd}||j|j<|�|��|Sr)r$rr5rZr2�rr�existings   rrzWeakInstanceDict.replaceus����9��
�"�"�	
 ��:�e�i�0��
�5�(�(��.�.�x�8�8�8�8��4���
�
�
���
�����H� %��
�5�9���#�#�E�*�*�*��s�>�
A�
Ac�>�|j}||jvrm	|j|}||urI|���}|�2tjdtj|���d|j�d����ndS#t$rYnwxYw||j|<|�|��dS�NzCan't attach instance z; another instance with key z$ is already present in this session.FT)	r$rrY�sa_exc�InvalidRequestError�orm_util�	state_strrZr2)rrr$�existing_stater\s     rr!zWeakInstanceDict.add�s����i���$�*���
!�!%��C���
"��.�.�&�*�*�,�,�A��}�$�8�8� (�1�%�8�8�8�8�%�)�)�)�E����%�!�5���
�
�
���
���� ��
�3���#�#�E�*�*�*��ts�
A.�.
A;�:A;c�2�||j|<|j|_dSr)rrr0r#s   rr%zWeakInstanceDict._add_unpresent�s����
�3��#�x����rNc��||jvr|S	|j|}|���}|�|S|S#t$r|cYSwxYwrrX)rr$rFrr\s     r�getzWeakInstanceDict.get�sh���d�j� � ��N�		��J�s�O�E�
�	�	���A��y����H���	�	�	��N�N�N�	���s�
4�A�Ac��|���}g}|D]4}|���}|�|�|j|f���5|Sr)�
all_statesrY�appendr$�r�values�resultrrNs     r�itemszWeakInstanceDict.items�sW�����"�"�����	2�	2�E��I�I�K�K�E�� ��
�
�u�y�%�0�1�1�1���
rc��|���}g}|D]-}|���}|�|�|���.|Sr)rqrYrrrss     rrtzWeakInstanceDict.values�sP�����"�"�����	%�	%�E��I�I�K�K�E�� ��
�
�e�$�$�$���
rc�D�t|�����Sr)�iterrrs r�__iter__zWeakInstanceDict.__iter__�s���D�I�I�K�K� � � rc�D�t|�����Sr)ryrvrs r�	iteritemszWeakInstanceDict.iteritems�s����
�
���%�%�%rc�D�t|�����Sr)ryrtrs r�
itervalueszWeakInstanceDict.itervalues�s������
�
�&�&�&rc��tjr|j���St	|j�����Sr)r�py2krrt�listrs rrqzWeakInstanceDict.all_states�s<���9�	-��:�$�$�&�&�&���
�)�)�+�+�,�,�,rc��	|j|j}||ur"|j�|jd��dSdS#t$rYdSwxYwr)rr$rCrZ�rr�sts   r�
_fast_discardzWeakInstanceDict._fast_discard�si��	0���E�I�&�B�
�U�{�{��
���u�y�$�/�/�/�/�/��{��	�	�	�	��D�D�	���s�<�
A
�	A
c�0�|�|��dSr��safe_discardrs  rr4zWeakInstanceDict.discard�������%� � � � � rc���|j|jvra	|j|j}||ur7|j�|jd��|�|��dSdS#t$rYdSwxYwdSr)r$rrCr5rZr�s   rr�zWeakInstanceDict.safe_discard�s����9��
�"�"�
6��Z��	�*��
��;�;��J�N�N�5�9�d�3�3�3��.�.�u�5�5�5�5�5��;��	�
�
�
����
����#�"s�A�
A-�,A-c��dS)Nrr<rs r�prunezWeakInstanceDict.prune�s���qrr)rRrSrTr]r`rbrr!r%rorvrtrzrr�r|r~rqr�r4r�r�r<rrrVrVXs$���������
!�
!�
!�������&���2(�(�(�
����������!�!�!��y�'�	&�	&�	&�	'�	'�	'�-�-�-�
0�
0�
0�!�!�!�
6�
6�
6�����rrVc��eZdZdZejrd�Zd�Zd�Zd�Z	d�Z
dd�Zd	�Zd
�Z
d�Zd�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�ZdS)�StrongInstanceDicta&A 'strong-referencing' version of the identity map.

    .. deprecated 1.1::
        The strong
        reference identity map is legacy.  See the
        recipe at :ref:`session_referencing_behavior` for
        an event-based approach to maintaining strong identity
        references.


    c�4�|j���Sr)rr~rs rr~zStrongInstanceDict.itervaluess���:�(�(�*�*�*rc�4�|j���Sr)rr|rs rr|zStrongInstanceDict.iteritems	s���:�'�'�)�)�)rc�*�t|j��Sr)ryr(rs rrzzStrongInstanceDict.__iter__s���D�J���rc��|j|Sr�rr=s  rr]zStrongInstanceDict.__getitem__s���z�#��rc��||jvSrr�r=s  rr`zStrongInstanceDict.__contains__s���d�j� � rNc�8�|j�||��Sr)rrorEs   rrozStrongInstanceDict.gets���z�~�~�c�7�+�+�+rc�4�|j���Sr)rrtrs rrtzStrongInstanceDict.valuess���z� � �"�"�"rc�4�|j���Sr)rrvrs rrvzStrongInstanceDict.itemss���z���!�!�!rc�>�d�|���D��S)Nc�6�g|]}tj|����Sr<)r�instance_state)�.0r\s  r�
<listcomp>z1StrongInstanceDict.all_states.<locals>.<listcomp>s#��D�D�D��
�)�!�,�,�D�D�Dr)rtrs rrqzStrongInstanceDict.all_statess��D�D�d�k�k�m�m�D�D�D�Drc�V�|j|vo tj||j��|uSr)r$rr�rs  rrbz!StrongInstanceDict.contains_state!s0���I���
D��)�$�u�y�/�:�:�e�C�	
rc��|j|jvrB|j|j}tj|��}||ur|�|��ndSd}|���|j|j<|�|��|Sr)r$rrr�r5rYr2rds   rrzStrongInstanceDict.replace's����9��
�"�"��z�%�)�,�H�!�0��:�:�H��u�$�$��*�*�8�4�4�4�4����H� %�	�	����
�5�9���#�#�E�*�*�*��rc�8�|j|vrZtj|j|j��|ur2t	jdt
j|���d|j�d����dS|���|j|j<|�	|��dSrg)
r$rr�rrhrirjrkrYr2rs  rr!zStrongInstanceDict.add6s����9�����(���E�I�)>�?�?�u�L�L��0�0� �)�%�0�0�0�0�%�)�)�)�=�����5�$)�I�I�K�K�D�J�u�y�!��'�'��.�.�.��4rc�V�|���|j|<|j|_dSr)rYrrr0r#s   rr%z!StrongInstanceDict._add_unpresentEs%���)�)�+�+��
�3��#�x����rc��	|j|j}tj|��|ur"|j�|jd��dSdS#t
$rYdSwxYwr)rr$rr�rCrZ)rrrYs   rr�z StrongInstanceDict._fast_discardJsw��	0��*�U�Y�'�C�
�(��-�-��6�6��
���u�y�$�/�/�/�/�/�7�6��	�	�	�	��D�D�	���s�A�
A�Ac�0�|�|��dSrr�rs  rr4zStrongInstanceDict.discardVr�rc���|j|jvra|j|j}tj|��}||ur9|j�|jd��|�|��dSdSdSr)r$rrr�rCr5)rrrYr�s    rr�zStrongInstanceDict.safe_discardYsy���9��
�"�"��*�U�Y�'�C��*�3�/�/�B��U�{�{��
���u�y�$�/�/�/��*�*�5�1�1�1�1�1�#�"��{rc�^�t|��}d�|���D��}tj��}|�|��|j���|j�|��t|��|_|t|��z
S)z%prune unreferenced, non-dirty states.c�D�g|]}|j�	|�����Sr<)r1rY)r��ss  rr�z,StrongInstanceDict.prune.<locals>.<listcomp>es'��B�B�B�Q�q�z�B������B�B�Br)	rIrqr�WeakValueDictionaryr)rr-r9r1)r�	ref_count�dirty�keeperss    rr�zStrongInstanceDict.pruneas�����I�I�	�B�B�$�/�/�"3�"3�B�B�B���-�/�/�����t�����
�������
���'�"�"�"��U����
��3�t�9�9�$�$rr)rRrSrT�__doc__rr�r~r|rzr]r`rortrvrqrbrr!r%r�r4r�r�r<rrr�r��s1������
�
��y�*�	+�	+�	+�	*�	*�	*� � � ����!�!�!�,�,�,�,�#�#�#�"�"�"�E�E�E�
�
�
�
�
�
�
�
�
�(�(�(�

0�
0�
0�!�!�!�2�2�2�
%�
%�
%�
%�
%rr�)r�rrrjrrh�objectr	rVr�r<rr�<module>r�s������������������������������EN�EN�EN�EN�EN�&�EN�EN�EN�P\�\�\�\�\�{�\�\�\�~w%�w%�w%�w%�w%��w%�w%�w%�w%�w%r

Hacked By AnonymousFox1.0, Coded By AnonymousFox