a
    [g}                     @  s   d dl mZ d dl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j	rbd	d
l
mZ G dd deeef ZG dd deeedf eed ef f ZdS )    )annotationsN)Any)Dict)Tuple)Union   )Literal   )
CacheConstc                   @  s    e Zd ZdZdddddZdS )prefix_anon_mapaf  A 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.

    strkeyreturnc                 C  sB   | dd\}}| |d}|d | |< | d| }|| |< |S )N r	   _)splitget)selfr   identZderivedZanonymous_countervalue r   e/var/www/html/cobodadashboardai.evdpl.com/venv/lib/python3.9/site-packages/sqlalchemy/sql/_py_util.py__missing__"   s    zprefix_anon_map.__missing__N)__name__
__module____qualname____doc__r   r   r   r   r   r      s   r   c                   @  s4   e Zd ZdZdZdddddZdd	d
ddZdS )cache_anon_mapaU  A 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   r   zTuple[str, bool])object_r   c                 C  sX   t |}|| v r,| | }|dus$J |dfS t| j | |< }|  jd7  _|dfS d S )NTr	   F)idr   _index)r   r   ZidselfZs_valZid_r   r   r   get_anon;   s    zcache_anon_map.get_anonintr   r   c                 C  s$   t | j | |< }|  jd7  _|S )Nr	   )r   r!   )r   r   valr   r   r   r   H   s    zcache_anon_map.__missing__N)r   r   r   r   r!   r"   r   r   r   r   r   r   +   s   r   zLiteral[CacheConst.NO_CACHE]T)
__future__r   typingr   r   r   r   Zutil.typingr   TYPE_CHECKING	cache_keyr
   r   r   r#   r   r   r   r   r   <module>   s   
