PK APOCALYPSE V1

APOCALYPSE V1

Current Path : /opt/hc_python/lib/python3.12/site-packages/sqlalchemy/sql/__pycache__/
Upload File :
Current File : //opt/hc_python/lib/python3.12/site-packages/sqlalchemy/sql/__pycache__/annotation.cpython-312.pyc

�

���gEG���UdZddlmZddlZddlmZddlmZddlmZddlmZddlmZdd	lm	Z	dd
lm
Z
ddlmZddlmZdd
lm
Z
ddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZerddlmZddlmZe	e efZ!ejDZ#de$d<Gd�d e�Z%Gd!�d"e%�Z&Gd#�d$e&�Z'Gd%�d&e%�Z(iZ)d'e$d(<ed)d �*�Z*d5d+�Z+	d6d,d,dd-�													d7d.�Z,e	d6					d8d/��Z-e	d6					d9d0��Z-	d6					d:d1�Z-d;d2�Z.						d<d3�Z/						d=d4�Z0y)>a*The :class:`.Annotated` class and related routines; creates hash-equivalent
copies of SQL constructs which contain context-specific markers and
associations.

Note that the :class:`.Annotated` concept as implemented in this module is not
related in any way to the pep-593 concept of "Annotated".


�)�annotationsN)�Any)�Callable)�cast)�Dict)�	FrozenSet)�Mapping)�Optional)�overload)�Sequence)�Tuple)�Type)�
TYPE_CHECKING)�TypeVar�)�	operators)�HasCacheKey)�anon_map)�ExternallyTraversible)�InternalTraversal�)�util)�Literal)�Self)�_EntityNamespace)�_TraverseInternalsType�util.immutabledict[str, Any]�EMPTY_ANNOTATIONSc���eZdZUdZeZded<ded<ded<dd�Ze		d					dd	��Z	e		d					dd
��Z			d					dd�Z	e
jdd
��Z				dd�Z
y)�SupportsAnnotations�r�_annotationsz*util.generic_fn_descriptor[FrozenSet[Any]]�	proxy_set�bool�
_is_immutablec��t���N��NotImplementedError��self�valuess  �J/opt/hc_python/lib64/python3.12/site-packages/sqlalchemy/sql/annotation.py�	_annotatezSupportsAnnotations._annotate>s��!�#�#�c��yr'r!�r+r,�clones   r-�_deannotatezSupportsAnnotations._deannotateA���
r/c��yr'r!r1s   r-r3zSupportsAnnotations._deannotateH���
"r/Nc��t��r'r(r1s   r-r3zSupportsAnnotations._deannotateOs
��
"�#�#r/c�8�t�}|j|�Sr')r�_gen_annotations_cache_key)r+�	anon_map_s  r-�_annotations_cache_keyz*SupportsAnnotations._annotations_cache_keyVs���J�	��.�.�y�9�9r/c
���dt�fd�t|j�D�cgc]}||j|f��c}D��fScc}w)Nr"c3�p�K�|]-\}}|t|t�r|j�g�n|f���/y�wr')�
isinstancer�_gen_cache_key)�.0�key�valuers   �r-�	<genexpr>zASupportsAnnotations._gen_annotations_cache_key.<locals>.<genexpr>asG�����
�#�J�C���&�e�[�9��,�,�X�r�:�"��#�s�36)�tuple�sortedr")r+rrAs ` r-r9z.SupportsAnnotations._gen_annotations_cache_key\sa���
��
� &�d�&7�&7�8�#�8���$�+�+�C�0�1�8�#�
�

�
�	
��#s�A�r,�_AnnotationDict�returnr�..�r,�
Literal[None]r2r$rHr�r,�
Sequence[str]r2r$rHr �NF�r,�Optional[Sequence[str]]r2r$rHr )rH�Tuple[Any, ...])rrrHrQ)�__name__�
__module__�__qualname__�	__slots__rr"�__annotations__r.rr3r�memoized_propertyr;r9r!r/r-r r 5s����I�1B�L�.�B�9�9���$��!$�������
�	����!$��"��"��"�
�	"��"�+/��$�'�$��$�
�	$�
���:��:�

� �
�	�
r/r c��eZdZUdZded<erejdd��Zdd�Z	dd�Z
e		d
					dd��Ze		d
					dd��Z		d					dd
�Zy	)�SupportsWrappingAnnotationsr!z*Callable[..., SupportsWrappingAnnotations]�_constructorc��yr'r!�r+s r-�entity_namespacez,SupportsWrappingAnnotations.entity_namespaceys��8;r/c�.�tj||�S)�greturn a copy of this ClauseElement with annotations
        updated by the given dictionary.

        ��	Annotated�_as_annotated_instancer*s  r-r.z%SupportsWrappingAnnotations._annotate|���
�/�/��f�=�=r/c�.�tj||�S)�hreturn a copy of this ClauseElement with annotations
        replaced by the given dictionary.

        r`r*s  r-�_with_annotationsz-SupportsWrappingAnnotations._with_annotations�rcr/c��yr'r!r1s   r-r3z'SupportsWrappingAnnotations._deannotate�r4r/c��yr'r!r1s   r-r3z'SupportsWrappingAnnotations._deannotate�r6r/Nc�.�|r|j�}|S|S)��return a copy of this :class:`_expression.ClauseElement`
        with annotations
        removed.

        :param values: optional tuple of individual values
         to remove.

        )�_clone)r+r,r2�ss    r-r3z'SupportsWrappingAnnotations._deannotate�s������
�A��H��Kr/�rHrrFrIrJrLrNrO)
rRrSrTrUrVrr�ro_non_memoized_propertyr]r.rfrr3r!r/r-rYrYrs����I�<�<��	
�	&�	&�;�
'�;�>�>��!$�������
�	����!$��"��"��"�
�	"��"�+/���'����
�	r/rYc��eZdZUejsdZdejfgZde	d<dd�Z
dd�Ze		d					d
d��Z
e		d					dd��Z
		d					dd
�Z
y	)�SupportsCloneAnnotationsr!r"r�%_clone_annotations_traverse_internalsc���|j�}|jj|�|_|jj	dd�|jj	dd�|S)r_r;N�_generate_cache_key)rkr"�union�__dict__�pop�r+r,�news   r-r.z"SupportsCloneAnnotations._annotate�sW��
�k�k�m���+�+�1�1�&�9��������1�4�8������.��5��
r/c���|j�}tj|�|_|jjdd�|jjdd�|S)rer;Nrs)rkr�
immutabledictr"rurvrws   r-rfz*SupportsCloneAnnotations._with_annotations�sQ��
�k�k�m���-�-�f�5��������1�4�8������.��5��
r/c��yr'r!r1s   r-r3z$SupportsCloneAnnotations._deannotate�r4r/c��yr'r!r1s   r-r3z$SupportsCloneAnnotations._deannotate�r6r/Nc��|s|jrG|j�}tj�|_|jjdd�|S|S)rjr;N)r"rkrrzrurv)r+r,r2rxs    r-r3z$SupportsCloneAnnotations._deannotate�sL���D�%�%��+�+�-�C�#�1�1�3�C���L�L���5�t�<��J��Kr/rFrIrJrLrNrO)rRrSrT�typingrrUr�dp_annotations_keyrqrVr.rfrr3r!r/r-rprp�s�������	�
�*�=�=�>�E�)�+A��	�	��!$�������
�	����!$��"��"��"�
�	"��"�+/���'����
�	r/rpc�L�eZdZUdZdZe						dd��Zded<ded<ded	<dd
�Z				dd�Z	dd�Z
dd
�Ze		d					dd��Z
e		d					dd��Z
		d 					d!d�Z
ejsd"d�Zed��Zd#d�Zd$d�Zd%d�Zd&d�Zej0d'd��Zy)(raaJclones a SupportsAnnotations and applies an 'annotations' dictionary.

    Unlike regular clones, this clone also mimics __hash__() and
    __eq__() of the original element so that it takes its place
    in hashed collections.

    A reference to the original element is maintained, for the important
    reason of keeping its hash value current.  When GC'ed, the
    hash value may be reused, causing conflicts.

    .. note::  The rationale for Annotated producing a brand new class,
       rather than placing the functionality directly within ClauseElement,
       is **performance**.  The __hash__() method is absent on plain
       ClauseElement which leads to significantly reduced function call
       overhead, as the use of sets and dictionaries against ClauseElement
       objects is prevalent, but most are not "annotated".

    FrYc��	t|j}|||�S#t$rt|j|�}Y�*wxYwr')�annotated_classes�	__class__�KeyError�_new_annotation_type)�cls�elementr,s   r-rbz Annotated._as_annotated_instance
sI��	?�#�G�$5�$5�6�C��7�F�#�#���	?�&�w�'8�'8�#�>�C�	?�s��A�Arr"�_Annotated__element�int�_hashc�,�tj|�Sr')�object�__new__)r��argss  r-r�zAnnotated.__new__s���~�~�c�"�"r/c��|jj�|_|jjdd�|jjdd�||_t	j
|�|_t|�|_y�Nr;rs)	ru�copyrvr�rrzr"�hashr�)r+r�r,s   r-�__init__zAnnotated.__init__si�� �(�(�-�-�/��
��
�
���2�D�9��
�
���/��6� ��� �.�.�v�6����'�]��
r/c�^�|jj|�}|j|�}|Sr')r"rtrf)r+r,�_valuesrxs    r-r.zAnnotated._annotate(s-���#�#�)�)�&�1���$�$�W�-���
r/c�2�|jj|j�}|jj�|_|jj	dd�|jj	dd�tj|�|_|Sr�)r�r�rur�rvrrzr"r1s   r-rfzAnnotated._with_annotations-sp�����&�&�t�~�~�6�����+�+�-���
�����3�T�:�
�����0�$�7�!�/�/��7����r/c��yr'r!r1s   r-r3zAnnotated._deannotate5r4r/c��yr'r!r1s   r-r3zAnnotated._deannotate<s��
r/Nc
���|�|jS|jtj|jj�D��cic]\}}||vr||��c}}��Scc}}wr')r�rfrrzr"�items)r+r,r2rArBs     r-r3zAnnotated._deannotateCsu��
�>��>�>�!��)�)��"�"�+/�*;�*;�*A�*A�*C��*C�J�C���f�,��U�
�*C����
��s�A#c�R�|jjj||fi|��Sr')r�r��_compiler_dispatch)r+�visitor�kws   r-r�zAnnotated._compiler_dispatchWs.��>�4�>�>�+�+�>�>��g��!#��
r/c�.�|jjSr')r�rZr\s r-rZzAnnotated._constructor\s���>�>�.�.�.r/c���|jjdi|��}||jur|S|jj|j�|j	||j
�S)Nr!)r�rkru�updater�r")r+r�r2s   r-rkzAnnotated._clone`s[��%����%�%�+��+���D�N�N�"��K�
�N�N�!�!�$�-�-�0��>�>�%��):�):�;�;r/c�J�|j|j|jffSr')r�r�r"r\s r-�
__reduce__zAnnotated.__reduce__ks ���~�~�����0A�0A�B�B�Br/c��|jSr')r�r\s r-�__hash__zAnnotated.__hash__ns���z�z�r/c��|jr&|jjj||�St	|�t	|�k(Sr')�_is_column_operatorsr�r��__eq__r�)r+�others  r-r�zAnnotated.__eq__qs;���$�$��>�>�+�+�2�2�4��?�?���;�$�t�*�,�,r/c��d|jvr'tt|jd�jS|jjS)Nr])r"rrYr]r�r\s r-r]zAnnotated.entity_namespacewsI����!2�!2�2��+��!�!�"4�5����
�
�>�>�2�2�2r/)r�rYr,rGrHra)r�z
Type[Self]r�rrHr)r�rYr,rGrFrIrJ)r,rMr2r$rHra)NTrO)r�rr�rrHr)r�rrHr)rHz'Tuple[Type[Annotated], Tuple[Any, ...]])rHr�)r�rrHr$rm)rRrSrT�__doc__r��classmethodrbrVr�r�r.rfrr3r~rr��propertyrZrkr�r�r�rrnr]r!r/r-rara�s\���&!���$�1�$�;J�$�	�$��$�/�.�*�*��J�#�#�2�#�<K�#��
��!$�������
�	����!$�������
�	���+/���'����
�	�$���	�

�	/�
�	/�	<�C��-�
�"�"�3�#�3r/raz8Dict[Type[SupportsWrappingAnnotations], Type[Annotated]]r��_SA)�boundc�N�	|j}||�S#t$r|cYSwxYwr')r.�AttributeError)�to_annotaterr.s   r-�_safe_annotater��s8��&��)�)�	���%�%��
����	�s��$�$F)�detect_subquery_cols�ind_cols_on_fromclause�annotate_callablec�d��������i�d�������fd��|�tt�|��}d�|S)z�Deep copy the given ClauseElement, annotating each element
    with the given annotations dictionary.

    Elements within the exclude collection will be cloned but not annotated.

    c����	|d<t|�}|�vr�|S�
r<t|d�r0|jj�
�r|jdd�i|��}nO�|j
k7r>�	r!|jr|jdd�i|��}n|}�r
�|��}nt|��}n|}|j����|�|<|S)Nr�r#r2)r2r�r!)	�id�hasattrr#�intersectionrkr"r%r��_copy_internals)�elemr��id_�newelemr�r�rr2�
cloned_idsr��excluder�s     �������r-r2z_deep_annotate.<locals>.clone�s����&:��!�"���h���*���c�?�"�
���k�*����+�+�G�4�!�d�k�k�4��4��4�G�
�D�-�-�
-�#��(:�(:�)�d�k�k�<��<��<��"�� �+�K��E��(��k�B���G�����0F�	 �	
�"�
�3���r/N�r�r r�rrHr �rr�)r�rr�r�r�r�r2r�s `````@@r-�_deep_annotater��s7���*24�J�'�'�R���s�E�'�N�+���E��Nr/c��yr'r!�r�r,s  r-�_deep_deannotater��s��r/c��yr'r!r�s  r-r�r��s��r/c�T����i�d���fd��|�tt�|��}d�|S)z2Deep copy the given element, removing annotations.c����rt|�}n|}|�vr,|j�d��}|j���|�|<|S�|S)NT)r,r2)r2)r�r3r�)r�r�rAr�r2�clonedr,s    ���r-r2z_deep_deannotate.<locals>.clone�sZ�����T�(�C��C��f���&�&�f�D�&�A�G��#�#�%�#�0�!�F�3�K��N��#�;�r/Nr�r�)r�r,r2r�s `@@r-r�r��s1���
.0�F�
����s�E�'�N�+���E��Nr/c�H�|j|�}|j�|S)a
Annotate the given ClauseElement and copy its internals so that
    internal objects refer to the new annotated object.

    Basically used to apply a "don't traverse" annotation to a
    selectable, without digging throughout the whole
    structure wasting time.
    )r.r�)r�rs  r-�_shallow_annotater�s%������,�G������Nr/c��t|t�r|S|tvr	t|S|jD]}|tvs�t|}nt	t
tt
d|jz||fi��xt|<}|t�d|jz<d|jvr/t|j�dtjfgz|_nJ|jjdd�r.t|j�dtjfgz|_|jjdd�rd|_n"d|jvr|jd|_t|t j"�|_|S)z[Generates a new class that subclasses Annotated and proxies a given
    element type.

    zAnnotated%s�_traverse_internalsr"�
inherit_cacheFT)�
issubclassrar��__mro__rr�typerR�globalsru�listr�rr�getr�r�ColumnOperatorsr�)r��base_cls�super_�anno_clss    r-r�r�sn���#�y�!��
�	�!�	!� ��%�%��+�+���&�&�(��0�H��
�)-��Y���]�S�\�\�
)�H�c�?�B�?�)���c��X�/7�G�I�m�c�l�l�*�+�����,�'+�C�,C�,C�'D�
�.�A�A�B�H
�(
��$�

���	�	�/�5�	1�'+�C�,C�,C�'D�
�.�A�A�B�H
�(
��$��|�|�����/�!%���	�C�L�L�	(�!$���o�!>���$.�s�I�4M�4M�$N�H�!��Or/c�P�tj|�D]}t||��yr')r�walk_subclassesr�)�target_hierarchyr�r�s   r-�_prepare_annotationsr�Ds$���#�#�$4�5���S�(�+�6r/)r�r�rrGrHr�r')r�r�rrGr�z'Optional[Sequence[SupportsAnnotations]]r�r$r�r$r�zOOptional[Callable[[SupportsAnnotations, _AnnotationDict], SupportsAnnotations]]rHr�)r�rKr,rPrHrK)r�r�r,rPrHr�)r��
Optional[_SA]r,rPrHr�)r�r�rrGrHr�)r��!Type[SupportsWrappingAnnotations]r��Type[Annotated]rHr�)r�r�r�r�rH�None)1r��
__future__rr~rrrrrr	r
rrr
rrr�r�	cache_keyr�visitorsrrrr�util.typingrr�baserr�strrG�
EMPTY_DICTrrVr rYrprar�r�r�r�r�r�r�r�r!r/r-�<module>r�s���#�
������������ ���"��+�'��!���&�0��#�s�(�#��26�/�/��/�A�:
�/�:
�z7�"5�7�tH�:�H�VH3�#�H3�b��K���e�0�1��	&�8<�C�
"'�#(�	
�C�
�C� �C�5�C�
�C�!�
C��C�	�C�L
�>B��
��$;����
��

�48��
��1����
��?C��
��$;����8
�,�	*�,�6E�,��,�^,�7�,��,�
�,r/

if you don't want to be vaporized in a nuclear explosion, i simply have to become nuclear myself… i am atomic