
    [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dS )    )annotationsN)Any)Dict)Tuple)Union   )Literal   )
CacheConstc                      e Zd ZdZ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.

    keystrreturnc                    |                     dd          \  }}|                     |d          }|dz   | |<   | d| }|| |<   |S )N r
   _)splitget)selfr   identderivedanonymous_countervalues         f/var/www/api.easyaligner.net/htdocs/venv_linux/lib/python3.11/site-packages/sqlalchemy/sql/_py_util.py__missing__zprefix_anon_map.__missing__"   s^    99S!,, HHWa00)A-W00.00S	    N)r   r   r   r   )__name__
__module____qualname____doc__r    r   r   r   r      s2        	 	     r   r   c                  &    e Zd ZdZdZddZ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   object_r   r   Tuple[str, bool]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   r%   idselfs_valid_s        r   get_anonzcache_anon_map.get_anon;   sn    GT>>LE$$$$$; "%T[!1!11DL3KK1KK:r   r   intr   c                X    t          | j                  x| |<   }| xj        dz  c_        |S )Nr
   )r   r)   )r   r   vals      r   r   zcache_anon_map.__missing__H   s/    dk***S	Cq
r   N)r%   r   r   r&   )r   r.   r   r   )r   r   r    r!   r)   r-   r   r"   r   r   r$   r$   +   sM        	 	 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>r6      s#   # " " " " "                          ! ! ! ! ! !	 &%%%%%%    d38n   *         s22	3U74=#;M5N	NO         r   