
    h              	          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                  rd	d
l
mZ  G d deeef         Z G d deeedf   eed   ef   f         Zy)    )annotationsN)Any)Dict)Tuple)Union   )Literal   )
CacheConstc                      e Zd ZdZddZy)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.

    c                |    |j                  dd      \  }}| j                  |d      }|dz   | |<   | d| }|| |<   |S )N r
   _)splitget)selfkeyidentderivedanonymous_countervalues         @D:\EasyAligner\venv\Lib\site-packages\sqlalchemy/sql/_py_util.py__missing__zprefix_anon_map.__missing__"   sV    99S!, HHWa0)A-W)1./0S	    N)r   strreturnr   )__name__
__module____qualname____doc__r    r   r   r   r      s    	r   r   c                  $    e Zd ZdZdZddZddZy)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   c                    t        |      }|| v r| |   }|dusJ |dfS t        | j                        x| |<   }| xj                  dz  c_        |dfS )NTr
   F)idr   _index)r   object_idselfs_valid_s        r   get_anonzcache_anon_map.get_anon;   sd    GT>LE$$$$; "%T[[!11DL3KK1K:r   c                d    t        | j                        x| |<   }| xj                  dz  c_        |S )Nr
   )r   r'   )r   r   vals      r   r   zcache_anon_map.__missing__H   s,    dkk**S	Cq
r   N)r(   r   r   zTuple[str, bool])r   intr   r   )r   r   r    r!   r'   r,   r   r"   r   r   r$   r$   +   s    	 Fr   r$   zLiteral[CacheConst.NO_CACHE]T)
__future__r   typingr   r   r   r   util.typingr	   TYPE_CHECKING	cache_keyr   r   r   r/   r$   r"   r   r   <module>r5      sl    #      !	%d38n * s22	3U74=#;M5N	NO r   