Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes15kdownloads
annotation.cpython-313.pyc148 linesDownload Raw Back to __pycache__
1�

2��j�I���%SrSSKJr SSKrSSKJr SSKJr SSKJr SSKJr SSKJr SS	KJ	r	 SS3KJ4r5 SSKJr SSKJr SS
KJ
r
 SSKJr SSKJr SSKJr SSKJr SSKJr SSKJr SSKJr SSKJr SSKJr SSKJr SSKJr \(aSSKJr SSKJr \	\ \4r!\RDr#S\$S'"SS \5r%"S!S"\%5r&"S#S$\&5r'"S%S&\%5r(0r)S'\$S('\"S)S S*9r*S5S+jr+S6S,S,SS-.S7S.jjjr,\S6S8S/jj5r-\S6S9S0jj5r-S6S:S1jjr-S;S2jr.S<S3jr/S=S4jr0g)>a*The :class:`.Annotated` class and related routines; creates hash-equivalent6copies of SQL constructs which contain context-specific markers and7associations.8 9Note that the :class:`.Annotated` concept as implemented in this module is not10related in any way to the pep-593 concept of "Annotated".11 12 13�)�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���\rSrSr%Sr\rS\S'S\S'S\S'SS	jr\	SSS14jj5r15\	SSSjj5r16SSS
jjr17\RSSj5r
SSjrSrg)�SupportsAnnotations�5�r�_annotationsz*util.generic_fn_descriptor[FrozenSet[Any]]�	proxy_set�bool�
_is_immutablec��[5e�N��NotImplementedError��self�valuess  �_D:\code\apps\devtools\python\user_packages\Python313\site-packages\sqlalchemy/sql/annotation.py�	_annotate�SupportsAnnotations._annotate>s��!�#�#�c��gr(r"�r,r-�clones   r.�_deannotate�SupportsAnnotations._deannotateA���18r1c��gr(r"r3s   r.r5r6H���19"r1Nc��[5er(r)r3s   r.r5r6Os
��20"�#�#r1c�8�[5nURU5$r()r�_gen_annotations_cache_key)r,�	anon_map_s  r.�_annotations_cache_key�*SupportsAnnotations._annotations_cache_keyVs���J�	��.�.�y�9�9r1c21�^�S[U4Sj[UR5Vs/sHnX RU4PM sn554$s snf)Nr#c3�~># �UH2upU[U[5(aURT/5OU4v� M4 g7fr()�22isinstancer�_gen_cache_key)�.0�key�valuers   �r.�	<genexpr>�ASupportsAnnotations._gen_annotations_cache_key.<locals>.<genexpr>asG����
�#�J�C��&�e�[�9�9��,�,�X�r�:�"��#�s�:=)�tuple�sortedr#)r,rrEs ` r.r<�.SupportsAnnotations._gen_annotations_cache_key\s_���
��
� &�d�&7�&7�8�#�8���+�+�C�0�1�8�#�
�

�23�	24��#s�A�r-�_AnnotationDict�returnr�..�r-�
Literal[None]r4r%rNr�r-�
Sequence[str]r4r%rNr �NF�r-�Optional[Sequence[str]]r4r%rNr )rN�Tuple[Any, ...])rrrNrW)�__name__�25__module__�__qualname__�__firstlineno__�	__slots__rr#�__annotations__r/rr5r�memoized_propertyr>r<�__static_attributes__r"r1r.r r 5s����I�1B�L�.�B�9�9���$��!$�������26�	����!$��"��"��"�27�	"��"�+/��$�'�$��$�28�	$�29���:��:�3031� �32�	�33r1r c���\rSrSr%SrS\S'\(a\RSSj5r	S
Sjr34S
Sjr\SSSjj5r
\SSS	jj5r
SSSjjr
Srg35)�SupportsWrappingAnnotations�rr"z*Callable[..., SupportsWrappingAnnotations]�_constructorc��gr(r"�r,s r.�entity_namespace�,SupportsWrappingAnnotations.entity_namespaceys��8;r1c�,�[RX5$)�Wreturn a copy of this ClauseElement with annotations36updated by the given dictionary.37 38��	Annotated�_as_annotated_instancer+s  r.r/�%SupportsWrappingAnnotations._annotate|���39�/�/��=�=r1c�,�[RX5$)�Xreturn a copy of this ClauseElement with annotations40replaced by the given dictionary.41 42rjr+s  r.�_with_annotations�-SupportsWrappingAnnotations._with_annotations�rnr1c��gr(r"r3s   r.r5�'SupportsWrappingAnnotations._deannotate�r7r1c��gr(r"r3s   r.r5rt�r9r1Nc�8�U(aUR5nU$U$)��return a copy of this :class:`_expression.ClauseElement`43with annotations44removed.45 46:param values: optional tuple of individual values47 to remove.48 49)�_clone)r,r-r4�ss    r.r5rt�s������
�A��H��Kr1�rNrrLrOrPrRrTrU)rXrYrZr[r\r]rr�ro_non_memoized_propertyrfr/rqrr5r_r"r1r.rarars����I�<�<��	
�	&�	&�;�50'�;�>�>��!$�������51�	����!$��"��"��"�52�	"��"�+/���'����53�	�r1rac���\rSrSr%\R54(dSrS\R4/r	S\55S'SSjrSSjr\
S
SSjj5r\
S
SS	jj5rSSSjjrSrg56)�SupportsCloneAnnotations�r"r#r�%_clone_annotations_traverse_internalsc���UR5nURRU5UlURR	SS5 URR	SS5 U$)rir>N�_generate_cache_key)rxr#�union�__dict__�pop�r,r-�news   r.r/�"SupportsCloneAnnotations._annotate�sW��57�k�k�m���+�+�1�1�&�9��������1�4�8������.��5��58r1c���UR5n[R"U5UlURRSS5 URRSS5 U$)rpr>Nr�)rxr�
immutabledictr#r�r�r�s   r.rq�*SupportsCloneAnnotations._with_annotations�sQ��59�k�k�m���-�-�f�5��������1�4�8������.��5��60r1c��gr(r"r3s   r.r5�$SupportsCloneAnnotations._deannotate�r7r1c��gr(r"r3s   r.r5r��r9r1Nc���U(dUR(aHUR5n[R"5UlURRSS5 U$U$)rwr>N)r#rxrr�r�r�)r,r-r4r�s    r.r5r��sL���D�%�%��+�+�-�C�#�1�1�3�C���L�L���5�t�<��J��Kr1rLrOrPrRrTrU)rXrYrZr[�typingrr\r�dp_annotations_keyrr]r/rqrr5r_r"r1r.r}r}�s�������	�61�*�=�=�>�E�)�+A��	�	��!$�������62�	����!$��"��"��"�63�	"��"�+/���'����64�	�r1r}c��\rSrSr%SrSr\SSj5rS\S'S\S'S	\S65'SSjr	SSjr66SS
jrSSjr\
SS Sjj5r\
SS!Sjj5rS"S#Sjjr\R (d
S$Sjr\S5rS%SjrS&SjrS'SjrS(Sjr\R2S)Sj5rSrg)*rk��aclones a SupportsAnnotations and applies an 'annotations' dictionary.67 68Unlike regular clones, this clone also mimics __hash__() and69__eq__() of the original element so that it takes its place70in hashed collections.71 72A reference to the original element is maintained, for the important73reason of keeping its hash value current.  When GC'ed, the74hash value may be reused, causing conflicts.75 76.. note::  The rationale for Annotated producing a brand new class,77   rather than placing the functionality directly within ClauseElement,78   is **performance**.  The __hash__() method is absent on plain79   ClauseElement which leads to significantly reduced function call80   overhead, as the use of sets and dictionaries against ClauseElement81   objects is prevalent, but most are not "annotated".82 83Frac��[URnU"X5$![a [URU5nN*f=fr()�annotated_classes�	__class__�KeyError�_new_annotation_type)�cls�elementr-s   r.rl� Annotated._as_annotated_instance
sG��	?�#�G�$5�$5�6�C��7�#�#���	?�&�w�'8�'8�#�>�C�	?�s�� A�Arr#�_Annotated__element�int�_hashc�,�[RU5$r()�object�__new__)r��argss  r.r��Annotated.__new__s���~�~�c�"�"r1c��URR5UlURRSS5 URRSS5 Xl[R84"U5Ul[U5Ulg�Nr>r�)	r��copyr�r�rr�r#�hashr�)r,r�r-s   r.�__init__�Annotated.__init__sg�� �(�(�-�-�/��
��
�
���2�D�9��
�
���/��6� �� �.�.�v�6����'�]��85r1c�^�URRU5nURU5nU$r()r#r�rq)r,r-�_valuesr�s    r.r/�Annotated._annotate(s-���#�#�)�)�&�1���$�$�W�-���86r1c�4�URRUR5nURR5UlURR	SS5 URR	SS5 [87R"U5UlU$r�)r�r�r�r�r�rr�r#r3s   r.rq�Annotated._with_annotations-sp�����&�&�t�~�~�6�����+�+�-���
�����3�T�:�
�����0�$�7�!�/�/��7����r1c��gr(r"r3s   r.r5�Annotated._deannotate5r7r1c��gr(r"r3s   r.r5r�<s��88r1Nc89���UcUR$UR[R"URR5VVs0sHup4X1;dMX4_M snn55$s snnfr()r�rqrr�r#�items)r,r-r4rErFs     r.r5r�Csq��90�>��>�>�!��)�)��"�"�+/�*;�*;�*A�*A�*C��*C�J�C��,�#��91�*C����
��s�A)�A)c�P�URRR"X40UD6$r()r�r��_compiler_dispatch)r,�visitor�kws   r.r��Annotated._compiler_dispatchWs*���>�>�+�+�>�>���!#��
r1c�.�URR$r()r�rcres r.rc�Annotated._constructor\s���>�>�.�.�.r1c���URR"S0UD6nX RLaU$URRUR5 UR	X R925$)Nr")r�rxr��updater�r#)r,r�r4s   r.rx�Annotated._clone`sU�����%�%�+��+���N�N�"��K�
�N�N�!�!�$�-�-�0��>�>�%�):�):�;�;r1c�J�URURUR44$r()r�r�r#res r.�93__reduce__�Annotated.__reduce__ks ���~�~�����0A�0A�B�B�Br1c��UR$r()r�res r.�__hash__�Annotated.__hash__ns���z�z�r1c��UR(a%URRRX5$[	U5[	U5:H$r()�_is_column_operatorsr�r��__eq__r�)r,�others  r.r��Annotated.__eq__qs9���$�$��>�>�+�+�2�2�4�?�?���;�$�t�*�,�,r1c��SUR;a'[[URS5R$URR$)Nrf)r#rrarfr�res r.rf�Annotated.entity_namespacewsI����!2�!2�2��+��!�!�"4�5����
�94�>�>�2�2�2r1)r��	__elementr#r�)r�rar-rMrNrk)r�z95Type[Self]r�rrNr)r�rar-rMrLrOrP)r-rSr4r%rNrk)NTrU)r�rr�rrNr)r�rrNr)rNz'Tuple[Type[Annotated], Tuple[Any, ...]])rNr�)r�rrNr%rz)rXrYrZr[�__doc__r��classmethodrlr]r�r�r/rqrr5r�rr��propertyrcrxr�r�r�rr{rfr_r"r1r.rkrk�s\���&!���$�1�$�;J�$�	�$��$�/�.�*�*��J�#�#�2�#�<K�#��96��!$�������97�	����!$�������98�	���+/���'����99�	�$���	�100101�	/�102�	/�	<�C��-�103�"�"�3�#�3r1rkz8Dict[Type[SupportsWrappingAnnotations], Type[Annotated]]r��_SA)�boundc�P�URnU"U5$![a Us$f=fr()r/�AttributeError)�to_annotaterr/s   r.�_safe_annotater��s8��&��)�)�	���%�%��
����	�s��%�%F)�detect_subquery_cols�ind_cols_on_fromclause�annotate_callablec�j^^^^^^^�0mSUUUUUUU4SjjmUb[[T"U55nSmU$)z�Deep copy the given ClauseElement, annotating each element104with the given annotations dictionary.105 106Elements within the exclude collection will be cloned but not annotated.107 108c��>�T	US'[U5nUT;aTU$T109(aF[US5(a5URRT1105(aUR"SST0UD6nO_TUR111:waMT	(a&UR(aUR"SST0UD6nOUnT(a112T"UT5nO[UT5nOUnURTTSS9 UTU'U$)Nr�r$r4T)r4r��_annotations_traversalr")	�id�hasattrr$�intersectionrxr#r&r��_copy_internals)�elemr��id_�newelemr�r�rr4�113cloned_idsr��excluder�s     �������r.r4�_deep_annotate.<locals>.clone�s����&:��!�"���h���*���c�?�"�
���k�*�*����+�+�G�4�4��k�k�4��4��4�G�
�D�-�-�
-�#��(:�(:�"�k�k�<��<��<��"�� �+�K��E��(��k�B���G�����#9�#'�	 �	114�"�115�3���r1N�r�r r�rrNr �rr�)r�rr�r�r�r�r4r�s `````@@r.�_deep_annotater��s7���*24�J�)�)�V���s�E�'�N�+���E��Nr1c��gr(r"�r�r-s  r.�_deep_deannotater��s��r1c��gr(r"r�s  r.r�r��s��r1c�Z^^^�0mSUUU4SjjmUb[[T"U55nSmU$)z2Deep copy the given element, removing annotations.c�>�T(a[U5nOUnUT;a'URTSS9nURTSS9 UTU'U$TU$)NT)r-r4)r4r�)r�r5r�)r�r�rEr�r4�clonedr-s    ���r.r4�_deep_deannotate.<locals>.clone�s\�����T�(�C��C��f���&�&�f�D�&�A�G��#�#�%��#�M�!�F�3�K��N��#�;�r1Nr�r�)r�r-r4r�s `@@r.r�r��s6���116.0�F�
�
����s�E�'�N�+���E��Nr1c�F�URU5nURSS9 U$)z�Annotate the given ClauseElement and copy its internals so that117internal objects refer to the new annotated object.118 119Basically used to apply a "don't traverse" annotation to a120selectable, without digging throughout the whole121structure wasting time.122T)r�)r/r�)r�rs  r.�_shallow_annotater�123s*������,�G����4��8��Nr1c�D�[U[5(aU$U[;a	[U$URHnU[;dM[Un O [	[124[[
SUR-X4055=[U'nU[5SUR-'SUR;a/[UR5S[R4/-UlOOURRSS5(a.[UR5S[R4/-UlURRSS5(aSUlO$SUR;aURSUl[U[ R"5UlU$)zSGenerates a new class that subclasses Annotated and proxies a given125element type.126 127zAnnotated%s�_traverse_internalsr#�
inherit_cacheFT)�128issubclassrkr��__mro__rr�typerX�globalsr��listr�rr��getr�r�ColumnOperatorsr�)r��base_cls�super_�anno_clss    r.r�r�su���#�y�!�!��129�	�!�	!� ��%�%��+�+���&�&�(��0�H��
�)-��Y���]�S�\�\�
)�H�?�B�?�)���c��X�/7�G�I�m�c�l�l�*�+�����,�'+�C�,C�,C�'D�
�.�A�A�B�H130�(131��$�132
���	�	�/�5�	1�	1�'+�C�,C�,C�'D�
�.�A�A�B�H133�(134��$��|�|�����/�/�!%���	�C�L�L�	(�!$���o�!>���$.�s�I�4M�4M�$N�H�!��Or1c�T�[R"U5Hn[X!5 M gr()r�walk_subclassesr�)�target_hierarchyr�r�s   r.�_prepare_annotationsrFs"���#�#�$4�5���S�+�6r1)r�r�rrMrNr�r()r�r�rrMr�z'Optional[Sequence[SupportsAnnotations]]r�r%r�r%r�zOOptional[Callable[[SupportsAnnotations, _AnnotationDict], SupportsAnnotations]]rNr�)r�rQr-rVrNrQ)r�r�r-rVrNr�)r��
Optional[_SA]r-rVrNr)r�r�rrMrNr�)r��!Type[SupportsWrappingAnnotations]r��Type[Annotated]rNr)rrr�rrN�None)1r��135__future__rr�rrrrrr	r136rrr
rrr�r�	cache_keyr�visitorsrrrr�util.typingrr�baserr�strrM�137EMPTY_DICTrr]r rar}rkr�r�r�r�r�r�r�rr"r1r.�<module>rs���#�
������������ ���"��+�'��!���&�0��#�s�(�#��26�/�/��/�A�:138�/�:139�z7�"5�7�tH�:�H�VH3�#�H3�b��K���e�0�1��	&�8<�E�140"'�#(�	
�E�
�E� �E�5�E�141�E�!�
E��E�	�E�P142�>B��
��$;����143��144145�48��
��1����146��?C��
��$;����8147�,�	*�,�6E�,��,�^,�7�,��,�148�,r1
codekingpro/portable-devtools · Team Ai