HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //usr/local/lib/python3.10/dist-packages/sqlalchemy/sql/__pycache__/_py_util.cpython-310.pyc
o

���g}�@s�ddlmZddlZddlmZddlmZddlmZddlmZddlmZej	r1d	d
l
mZGdd�deeef�Z
Gd
d�deeedfeedeff�ZdS)�)�annotationsN)�Any)�Dict)�Tuple)�Union�)�Literal�)�
CacheConstc@seZdZdZddd�ZdS)	�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.

    �key�str�returncCsB|�dd�\}}|�|d�}|d||<|�d|��}|||<|S)N� r	�_)�split�get)�selfr�ident�derived�anonymous_counter�value�r�B/usr/local/lib/python3.10/dist-packages/sqlalchemy/sql/_py_util.py�__missing__"szprefix_anon_map.__missing__N)rr
rr
)�__name__�
__module__�__qualname__�__doc__rrrrrrsrc@s(eZdZdZdZddd�Zddd
�ZdS)�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.

    r�object_rr�Tuple[str, bool]cCsTt|�}||vr||}|dusJ�|dfSt|j�||<}|jd7_|dfS)NTr	F)�idr
�_index)rr �idself�s_val�id_rrr�get_anon;szcache_anon_map.get_anonr�intr
cCs$t|j�||<}|jd7_|S)Nr	)r
r#)rr�valrrrrHszcache_anon_map.__missing__N)r rrr!)rr(rr
)rrrrr#r'rrrrrr+s


rzLiteral[CacheConst.NO_CACHE]T)�
__future__r�typingrrrr�util.typingr�
TYPE_CHECKING�	cache_keyr
r
rr(rrrrr�<module>s
�