Viewing File: /opt/hc_python/lib/python3.12/site-packages/sqlalchemy/sql/__pycache__/_py_util.cpython-312.pyc

�

a��g}�	���ddlmZddlZddlmZddlmZddlmZddlmZddlmZejrd	d
l
mZGd�deeef�Z
Gd
�deeedfeedeff�Zy)�)�annotationsN)�Any)�Dict)�Tuple)�Union�)�Literal�)�
CacheConstc��eZdZdZdd�Zy)�prefix_anon_mapafA map that creates new keys for missing key access.

    Considers keys of the form "<ident> <name>" to produce
    new symbols "<name>_<index>", where "index" is an incrementing integer
    corresponding to <name>.

    Inlines the approach taken by :class:`sqlalchemy.util.PopulateDict` which
    is otherwise usually used for this type of operation.

    c�|�|jdd�\}}|j|d�}|dz||<|�d|��}|||<|S)N� r
�_)�split�get)�self�key�ident�derived�anonymous_counter�values      �H/opt/hc_python/lib64/python3.12/site-packages/sqlalchemy/sql/_py_util.py�__missing__zprefix_anon_map.__missing__"sV���9�9�S�!�,���� �H�H�W�a�0��)�A�-��W�
��)�1�.�/�0����S�	���N)r�str�returnr)�__name__�
__module__�__qualname__�__doc__r�rrr
r
s��	�rr
c�$�eZdZdZdZdd�Zdd�Zy)�cache_anon_mapaUA map that creates new keys for missing key access.

    Produces an incrementing sequence given a series of unique keys.

    This is similar to the compiler prefix_anon_map class although simpler.

    Inlines the approach taken by :class:`sqlalchemy.util.PopulateDict` which
    is otherwise usually used for this type of operation.

    rc��t|�}||vr||}|dusJ�|dfSt|j�x||<}|xjdz
c_|dfS)NTr
F)�idr�_index)r�object_�idself�s_val�id_s     r�get_anonzcache_anon_map.get_anon;sd���G����T�>���L�E���$�$�$��$�;��"%�T�[�[�!1�1�D��L�3��K�K�1��K���:�rc�d�t|j�x||<}|xjdz
c_|S)Nr
)rr')rr�vals   rrzcache_anon_map.__missing__Hs,���d�k�k�*�*��S�	�C����q����
rN)r(rrzTuple[str, bool])r�intrr)rrr r!r'r,rr"rrr$r$+s��	��F��rr$zLiteral[CacheConst.NO_CACHE]T)�
__future__r�typingrrrr�util.typingr	�
TYPE_CHECKING�	cache_keyrrr
r/r$r"rr�<module>r5sl��#�
�����!�	���%��d�3��8�n��* ���s�2�2�	3�U�7�4�=�#�;M�5N�	N�O� r
Back to Directory File Manager