Ë
    r™ãjð4  ã            	      ó–  — U d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlm	Z	 ddlm
Z
 ddlmZ dd	lmZ dd
lmZ ddlmZ ddlmZ ddlmZ erddlmZ ddlmZ 	 ddlZd+d„Zej4                  rddlmZ nddlmZ  G d„ d«      Z G d„ de«      Z ej@                  e!ejD                  «      Z# ej@                  ejH                  ejJ                     d«      Z& ej@                  ejH                  ejJ                     d«      Z' ej@                  ejH                  ejJ                     d«      Z( ej@                  ejH                  ejJ                     d«      Z) ej@                  ejH                  ejJ                     d«      Z* ej@                  ejH                  ejJ                     d«      Z+ ej@                  ejH                  ejJ                     d«      Z, ej@                  ejH                  ejJ                     d«      Z- G d„ d e«      Z.i e.D � ci c]  } | | j^                  “Œ c} ¥ej`                  e+ejb                  e,ejd                  e,ejf                  e,i¥Z4d!e5d"<   ejl                   G d#„ d$«      «       Z7ejl                   G d%„ d&e7«      «       Z8ejl                   G d'„ d(«      «       Z9 G d)„ d*«      Z:y# e$ r
 ddlmZ Y �Œcw xY wc c} w ),aÝ  Cython implementation of the cache key traversal.

The traversal for a single class is represented as a :class:`.ClassAttrs`
holding one :class:`.AttrInfo` per attribute that participates in the cache
key.  :class:`.AttrInfo` records the attribute name together with an integer
``kind`` identifying its handler, so that when compiled the per-attribute
dispatch in :meth:`.BaseHasCacheKey._gen_cache_key` is a comparison against a
C integer, rather than the chain of Python ``is`` comparisons against
singleton handler objects that the pure Python traversal loop has to run per
attribute, per cache key.

Traversal kinds that have no inline handler are represented by
:class:`.AttrInfoMethod`, which additionally carries the Python level visit
function to call; these are dispatched under the ``_PY_METHOD`` kind.

Recursion into child elements calls ``_gen_cache_key()`` on the child, which
is this compiled method for the classes that inherit it and the Python level
override otherwise.

é    )Úannotations)ÚSequence)ÚEnum)ÚAny)ÚCallable)ÚDict)ÚList)ÚOptional)ÚTuple)ÚTYPE_CHECKINGé   )ÚInternalTraversalé   )Úutil)ÚBindParameter)Ú_TraverseInternalsTypeN)Úcythonc                 ó"   — t         j                  S )z?Utility function to indicate if this module is compiled or not.)r   Úcompiled© ó    úg/var/www/html/python-recuperauto-other/env/lib/python3.12/site-packages/sqlalchemy/sql/_cache_key_cy.pyÚ_is_compiledr   =   s   € ä�?‰?Ðr   )Úanon_mapc                  óx   — e Zd ZdZ ej
                  d«       ej                  d«      	 	 	 	 	 	 dd„«       «       Zy)ÚBaseHasCacheKeyr   Fc                óZ  — | j                   }t        j                  rBt        j                  t        |«      }t        | «      }||v r||   |fS |j                  |«      }n|j                  | «      \  }}|r||fS 	 |j                  d   }|t        u r
d|t        <   y|}	||g}
|	j                  }|D �]Ê  }t        | |j                  «      }|j                  }|€Œ)|t         k(  rL|j"                  }|t        u rd|t        <    y|
j%                  |j                  «       |
j%                  |«       Œ~|t&        k(  rTt)        ||	j*                  «      r|j-                  |«      }|
j%                  |j                  «       |
j%                  |«       ŒÛ|t.        k(  r>|
j%                  |j                  «       |
j%                  |j1                  ||«      «       �Œ"|s�Œ&|t2        k(  r.|
j%                  |j                  «       |
j%                  |«       �Œ]|t4        k(  rl|
j%                  |j                  «       |
j%                  |d   «       |d   x}r#|
j%                  |j1                  ||«      «       �Œ¿|
j%                  d«       �ŒÒ|t6        k(  rK| j8                  r|
j;                  | j<                  «       �Œ|
j;                  | j?                  |«      «       �Œ&|t@        k(  rU|
j%                  |j                  «       |
j%                  tC        |D �cg c]  }|j1                  ||«      ‘Œ c}«      «       �Œ„|tD        k(  r2|}|
j;                  |jG                  |j                  || ||«      «       �Œ¿tI        d|› �«      ‚ tC        |
«      S # t        $ r |j                  «       }Y �Œw xY wc c}w )aB  return an optional cache key.

        The cache key is a tuple which can contain any series of
        objects that are hashable and also identifies
        this object uniquely within the presence of a larger SQL expression
        or statement, for the purposes of caching the resulting query.

        The cache key should be based on the SQL compiled structure that would
        ultimately be produced.   That is, two structures that are composed in
        exactly the same way should produce the same cache key; any difference
        in the structures that would affect the SQL string or the type handlers
        should result in a different cache key.

        If a structure cannot produce a useful cache key, the NO_CACHE
        symbol should be added to the anon_map and the method should
        return None.

        Ú_generated_cache_key_traversalTNÚcompile_state_pluginÚplugin_subjectzUnknown kind )%Ú	__class__r   r   ÚcastÚdictÚidÚ_add_missingÚget_anonÚ__dict__ÚKeyErrorÚ_generate_cache_attrsÚ	_NO_CACHEÚelementsÚgetattrÚnameÚkindÚ_STATIC_CACHE_KEYÚ_static_cache_keyÚappendÚ
_ANON_NAMEÚ
isinstanceÚ
anon_labelÚ	apply_mapÚ_CALL_GEN_CACHE_KEYÚ_gen_cache_keyÚ_CACHE_IN_PLACEÚ_PROPAGATE_ATTRSÚ_ANNOTATIONS_KEYÚ!_gen_static_annotations_cache_keyÚextendÚ_annotations_cache_keyÚ_gen_annotations_cache_keyÚ_CLAUSEELEMENT_LISTÚtupleÚ
_PY_METHODÚmethÚNotImplementedError)ÚselfÚamÚ
bindparamsÚclsÚam_dictÚidselfÚid_ÚfoundÚ
dispatcherÚdisp_clsÚresultr+   ÚelementÚobjr.   ÚsckÚpsÚelemÚ	py_methods                      r   r7   zBaseHasCacheKey._gen_cache_keyM   s;  € ð. �n‰nˆô �?Š?ô —k‘k¤$¨Ó+ˆGÜ ›XˆFØ˜Ñ Ø ™¨Ð-Ð-Ø—/‘/ &Ó)‰CàŸ™ TÓ*‰JˆC�ÙØ˜S�zÐ!ð	5ØŸ™Ð&FÑGˆJð œÑ"Ø ˆBŒy‰MØà)ˆØ  #˜JˆØ$,×$5Ñ$5ˆð  ó A	JˆGÜ˜$ §¡Ó-ˆCØ&Ÿ|™|ˆDØ‰ØÔ,Ò,Ø×/Ñ/�CØœiÑ'Ø(,˜œ9™Ù#Ø—M‘M '§,¡,Ô/Ø—M‘M #Õ&ØœZÒ'Ü! # x×':Ñ':Ô;Ø!Ÿm™m¨BÓ/˜Ø—M‘M '§,¡,Ô/Ø—M‘M #Õ&ØÔ0Ò0Ø—M‘M '§,¡,Ô/Ø—M‘M #×"4Ñ"4°R¸Ó"DÖEó
 ØœÒ.ØŸ™ g§l¡lÔ3ØŸ™ cÖ*ØÔ!1Ò1ØŸ™ g§l¡lÔ3ØŸ™ cÐ*@Ñ&AÔBØ!$Ð%5Ñ!6Ð6˜2Ð6Ø"ŸM™M¨"×*;Ñ*;¸BÀ
Ó*KÖLà"ŸM™M¨$Ö/àÔ!1Ò1ð  ×AÒAØ"ŸM™M¨$×*EÑ*EÖFà"ŸM™M¨$×*IÑ*IÈ"Ó*MÖNàÔ!4Ò4ØŸ™ g§l¡lÔ3ØŸ™Ü!ð 14ö!"à(,ð %)×$7Ñ$7¸¸JÕ$Gò!"óöð ¤Ò+Ø$+˜	ØŸ™Ø%ŸN™NØ )§¡°°T¸2¸zóöô 2°MÀ$ÀÐ2HÓIÐIðCA	JôF �V‹}Ðøôi ò 	5ð
 ×2Ñ2Ó4‹Jð	5üòH!"s   Á:N ÌN(ÎN%Î$N%N)rE   r   rF   zList[BindParameter[Any]]ÚreturnzOptional[Tuple[Any, ...]])Ú__name__Ú
__module__Ú__qualname__Ú	__slots__r   ÚboundscheckÚ
wraparoundr7   r   r   r   r   r   J   sX   „ Ø€Ià€V×Ñ˜ÓØ€V×Ñ�uÓð|Øð|Ø(@ð|à	"ò|ó ó ñ|r   r   c                  ó   — e Zd ZdZdZy)Ú
CacheConstr   r   N)rV   rW   rX   ÚNO_CACHEÚPARAMSr   r   r   r]   r]   Î   s   „ Ø€HØ�Fr   r]   é   é   é   é   é   c                  ó$   — e Zd ZdZeZeZeZ	e
ZeZy)ÚCacheTraverseTargetzëHandlers that the traversal implements inline.

    The value of each member is the integer ``kind`` recorded on the
    :class:`.AttrInfo` for an attribute using that handler, so that the
    traversal can switch on a C integer.

    N)rV   rW   rX   Ú__doc__r8   ÚCACHE_IN_PLACEr6   ÚCALL_GEN_CACHE_KEYr/   ÚSTATIC_CACHE_KEYr9   ÚPROPAGATE_ATTRSr2   Ú	ANON_NAMEr   r   r   rf   rf   ß   s$   „ ñð %€NØ,ÐØ(ÐØ&€OØ�Ir   rf   zDict[Any, int]Ú_attr_info_kindc                  ó.   — e Zd ZU dZded<   ded<   dd„Zy)	ÚAttrInfozAn attribute of a specific kindú
cython.intr.   Ústrr-   c                ó    — || _         || _        y ©N)r.   r-   )rD   r.   r-   s      r   Ú__init__zAttrInfo.__init__  s   € ØˆŒ	Øˆ�	r   N)r.   rp   r-   rq   rU   ÚNone©rV   rW   rX   rg   Ú__annotations__rt   r   r   r   ro   ro   ü   s   … á)à
ÓØ
ƒIôr   ro   c                  ó$   — e Zd ZU dZded<   dd„Zy)ÚAttrInfoMethodz+An attribute that requires a python method.ÚobjectrB   c                ó6   — t         | _        || _        || _        y rs   )rA   r.   r-   rB   )rD   r-   Úargs      r   rt   zAttrInfoMethod.__init__  s   € ÜˆŒ	ØˆŒ	Øˆ�	r   N)r-   rq   r|   rz   rU   ru   rv   r   r   r   ry   ry     s   … á5à
ƒLôr   ry   c                  ó.   — e Zd ZU dZded<   ded<   dd„Zy)	Ú
ClassAttrsz1The whole cache key traversal for a single class.ztuple[AttrInfo, ...]r+   Útyper4   c                ó2   — t        |«      | _        || _        y rs   )r@   r+   r4   )rD   r+   r4   s      r   rt   zClassAttrs.__init__  s   € Ü˜h›ˆŒØ$ˆ�r   N)r+   zSequence[AttrInfo]r4   r   rU   ru   rv   r   r   r   r~   r~     s   … á;à"Ó"ØÓô%r   r~   c                  óz   — e Zd ZdZdZer	 	 	 	 dd„Z	 	 	 	 	 	 	 	 d	d„Z ej                  d«      	 	 	 	 d
d„«       Z
y)Ú_BaseCacheKeyTraversala.  Builds the per-class traversal structure that
    :meth:`.BaseHasCacheKey._gen_cache_key` consumes.

    Mixed in alongside :class:`.HasTraversalDispatch`, which supplies
    :meth:`.dispatch`; the visit symbols themselves are declared by
    :class:`._CacheKeyTraversal` in ``sql/cache_key.py``.

    r   c                 ó   — y rs   r   )rD   Úvisit_symbols     r   Údispatchz_BaseCacheKeyTraversal.dispatch.  s   € à!$r   c                óB   — | j                  |«      }t        |||«       |S )zsBuild the :class:`.ClassAttrs` for ``target_cls`` and memoize it
        on the class under ``attrname``.

        )Ú_generate_class_attrsÚsetattr)rD   Ú
target_clsÚinternal_dispatchÚattrnameÚclass_attrss        r   Úgenerate_class_attrsz+_BaseCacheKeyTraversal.generate_class_attrs2  s'   € ð ×0Ñ0Ð1BÓCˆÜ�
˜H kÔ2ØÐr   zsqlalchemy.sql.elementsc                óx  — g }|D ]†  \  }}| j                  |«      }|€Œ|t        v r#|j                  t        t        |   |«      «       ŒEt	        |t
        t        f«      rt        d|›d|›�«      ‚|j                  t        ||«      «       Œˆ t        |t        j                  j                  j                  «      S )an  Resolve the handler for every attribute that participates in the
        cache key for a single class.

        In contrast to :meth:`.HasTraversalDispatch._generate_dispatcher`,
        which emits a function returning a list of
        ``(attrname, value, handler)`` triples that a runtime loop then has to
        interpret, this returns a :class:`.ClassAttrs` holding one
        :class:`.AttrInfo` per attribute, with the handler recorded as an
        integer kind.   Which handler applies to which attribute is a fact
        that's constant for the class, so it's resolved once here rather than
        being rediscovered by a chain of ``is`` comparisons on every cache key
        generation.

        Attributes whose handler has no inline form in the traversal are
        recorded as :class:`.AttrInfoMethod`, which carries the visit method
        itself.

        z2No cache key traversal generation rule for symbol z, used by attribute )r…   rm   r1   ro   r3   rf   r   rC   ry   r~   r   Ú	preloadedÚsql_elementsÚ_anonymous_label)rD   rŠ   Úelemsr‹   Ú	visit_symrB   s         r   r‡   z,_BaseCacheKeyTraversal._generate_class_attrsC  s¼   € ð, !#ˆð $5ò 	=ÑˆH�iØ—=‘= Ó+ˆDØˆ|Øà”Ñ&Ø—‘œX¤o°dÑ&;¸XÓFÕGÜ˜DÔ#6Ô8IÐ"JÔKÜ)ØHØ�hÐ2°8°,ð@óð ð
 —‘œ^¨H°dÓ;Õ<ð	=ô ˜%¤§¡×!<Ñ!<×!MÑ!MÓNÐNr   N)r„   r   rU   zCallable[..., Any])r‰   r   rŠ   r   r‹   rq   rU   r~   )rŠ   r   rU   r~   )rV   rW   rX   rg   rY   r   r…   r�   r   Úpreload_moduler‡   r   r   r   r‚   r‚      s‰   „ ñð €Iáð	%Ø 1ð	%àó	%ðð
 ðð 2ðð ðð 
óð" €T×ÑÐ2Ó3ð'OØ!7ð'Oà	ò'Oó 4ñ'Or   r‚   )rU   Úbool);rg   Ú
__future__r   Úcollections.abcr   Úenumr   Útypingr   r   r   r	   r
   r   r   Úvisitorsr   Ú r   r+   r   r   r   ÚModuleNotFoundErrorÚsqlalchemy.utilr   r   Ú'cython.cimports.sqlalchemy.sql._util_cyr   Ú_util_cyr   r]   Údeclarerz   r^   r*   ÚconstÚintr8   r6   r/   r9   r2   r:   r?   rA   rf   ÚvalueÚdp_annotations_keyÚdp_clauseelement_listÚdp_clauseelement_tupleÚdp_memoized_select_entitiesrm   rw   Úcclassro   ry   r~   r‚   )Úmembers   0r   ú<module>rª      sv  ðòõ. #å $Ý Ý Ý Ý Ý Ý Ý Ý  å 'Ý áÝ'Ý0ð
'ó ó
ð 
‡?‚?Þ@å"÷Añ AôH�ô ð ˆF�N‰N˜6 :×#6Ñ#6Ó7€	Ø �&—.‘. §¡¨f¯j©jÑ!9¸1Ó=€Ø$�f—n‘n V§\¡\°&·*±*Ñ%=¸qÓAÐ Ø"�F—N‘N 6§<¡<°·
±
Ñ#;¸QÓ?Ð Ø!�6—>‘> &§,¡,¨v¯z©zÑ":¸AÓ>Ð ØˆV�^‰^˜FŸL™L¨¯©Ñ4°aÓ8€
Ø!�6—>‘> &§,¡,¨v¯z©zÑ":¸AÓ>Ð Ø$�f—n‘n V§\¡\°&·*±*Ñ%=¸qÓAÐ ØˆV�^‰^˜FŸL™L¨¯©Ñ4°aÓ8€
ô˜$ô ð(#Ø*=Ö> €vˆv�|‰|ÑÒ>ð#à×(Ñ(Ð*:Ø×+Ñ+Ð-@Ø×,Ñ,Ð.AØ×1Ñ1Ð3Fñ#€�ó ð ‡�÷ð ó ðð ‡�ô�Xó ó ðð ‡�÷%ð %ó ð%÷KOò KOøðO ò 'ß&Ð&ð'üòv ?s   ÁJ4 ÈKÊ4KËK