
    hgh                       U d Z ddlmZ ddlmZ ddlmZ ddl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 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 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 ddlmZ ddlmZ erEddlm 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( ddl)m*Z* dd l+m,Z, dd!l-m.Z. dd"l-m/Z/ dFd$Z0dGd%Z1n$ ejd                  d&      Z0 ejd                  d'      Z1ee
   Z3e4Z5ee5d(d)f   Z6ee6d*f   Z7ed(   Z8eed)e4f      Z9 ejt                  e;      Z<dHd+Z=d,Z>d-e?d.<   d/Z@ G d0 d#e      ZA G d1 d2eA      ZB G d3 d4eB      ZC eC       eA_D         G d5 d6ej                  ee4      ZF G d7 d8eA      ZG G d9 d:eA      ZH G d; d<eB      ZI G d= d>eI      ZJ G d? d@ee
e
f         ZK G dA dBeI      ZLer	 	 	 	 dGdCZMdIdDZNy ejd                  d'      ZM ejd                  dE      ZNy)Jz@Path tracking utilities, representing mapper graph traversals.

    )annotations)reduce)chainN)Any)cast)Dict)Iterator)List)Optional)overload)Sequence)Tuple)TYPE_CHECKING)Union   )base)insp_is_mapper_property   )exc)util)visitors)HasCacheKey)_InternalEntityType)StrategizedProperty)Mapper)RelationshipProperty)AliasedInsp)_CacheKeyTraversalType)BindParameter)anon_map)_LiteralStar)	TypeGuardPathRegistryc                     y N paths    ED:\EasyAligner\venv\Lib\site-packages\sqlalchemy/orm/path_registry.pyis_rootr*   0   s        c                     y r%   r&   r'   s    r)   	is_entityr-   2   s    Cr+   r*   r-   _InternalEntityType[Any]StrategizedProperty[Any].c                ,    t         j                  |       S r%   )r#   deserializer'   s    r)   _unreduce_pathr2   P   s    ##D))r+   *r!   _WILDCARD_TOKEN_sa_defaultc                  v   e Zd ZU dZdZdZdZdZdZdZ	de
d<   de
d<   de
d<   d	e
d
<   de
d<   dej                  j                  fgZde
d<   d/dZd/dZed0d       Zd1dZd2dZ	 	 	 	 	 	 	 	 d2dZ	 d3	 	 	 	 	 	 	 d4dZd5dZd5dZed6d       Zed7d       Zed8d       Ze	 	 	 	 d9d       Ze	 	 	 	 d:d       Z	 	 	 	 d;dZed5d       Z	 	 d<d Zd=d!Zd>d"Zd?d#Ze d@d$       Z!e dAd%       Z"dBd&Z#e dCd'       Z$ee dDd(              Z%ee dEd)              Z%e 	 	 	 	 dFd*       Z%e dGd+       Z&dHd,Z'dId-Z(dId.Z)y)Jr#   a  Represent query load paths and registry functions.

    Basically represents structures like:

    (<User mapper>, "orders", <Order mapper>, "items", <Item mapper>)

    These structures are generated by things like
    query options (joinedload(), subqueryload(), etc.) and are
    used to compose keys stored in the query._attributes dictionary
    for various options.

    They are then re-composed at query compile/result row time as
    the query is formed and as rows are fetched, where they again
    serve to compose keys to look up options in the context.attributes
    dictionary, which is copied from query._attributes.

    The path structure has a limited amount of caching, where each
    "root" ultimately pulls from a fixed registry associated with
    the first mapper, that also contains elements for each of its
    property keys.  However paths longer than two elements, which
    are the exception rather than the rule, are generated on an
    as-needed basis.

    r&   Fboolis_unnatural_PathRepresentationr(   natural_pathzOptional[PathRegistry]parentRootRegistryrootr   _cache_key_traversalc                    	 |d uxr | j                   |j                  k(  S # t        $ r$ t        j                  dt        |      z         Y yw xY w)N1Comparison of PathRegistry to %r is not supportedFr(   _path_for_compareAttributeErrorr   warntypeselfothers     r)   __eq__zPathRegistry.__eq__   sU    	$Me6M6M)MM 	IIC;  	   ! *AAc                    	 |d u xs | j                   |j                  k7  S # t        $ r$ t        j                  dt        |      z         Y yw xY w)Nr@   TrA   rF   s     r)   __ne__zPathRegistry.__ne__   sT    	D=HDII1H1H$HH 	IIC;  	rJ   c                    | j                   S r%   r'   rG   s    r)   rB   zPathRegistry._path_for_compare   s    yyr+   c                     | j                   |   S r%   r'   )rG   indexs     r)   odd_elementzPathRegistry.odd_element   s    yyr+   c                V    t         j                  d|| |       |||| j                  f<   y )Nzset '%s' on path '%s' to '%s')logdebugr:   rG   
attributeskeyvalues       r)   setzPathRegistry.set   s*    		13eD/4
C**+,r+   c                p    t         j                  d|| |       |j                  || j                  f|       y )Nz$setdefault '%s' on path '%s' to '%s')rS   rT   
setdefaultr:   rU   s       r)   r[   zPathRegistry.setdefault   s2     			8#tUKsD$5$56>r+   Nc                4    || j                   f}||v r||   S |S r%   )r:   rU   s       r)   getzPathRegistry.get   s+     D%%&*c?"Lr+   c                ,    t        | j                        S r%   lenr(   rN   s    r)   __len__zPathRegistry.__len__   s    499~r+   c                    t        |       S r%   )idrN   s    r)   __hash__zPathRegistry.__hash__   s    $xr+   c                     y r%   r&   rG   entitys     r)   __getitem__zPathRegistry.__getitem__   s    CFr+   c                     y r%   r&   rf   s     r)   rh   zPathRegistry.__getitem__   s    <?r+   c                     y r%   r&   rf   s     r)   rh   zPathRegistry.__getitem__   s    ADr+   c                     y r%   r&   rf   s     r)   rh   zPathRegistry.__getitem__   s     "%r+   c                     y r%   r&   rf   s     r)   rh   zPathRegistry.__getitem__   s     r+   c                    t               r%   )NotImplementedErrorrf   s     r)   rh   zPathRegistry.__getitem__   s      "##r+   c                ,    t        | j                        S r%   r_   rN   s    r)   lengthzPathRegistry.length   s    499~r+   c              #     K   t        t        | j                        }t        t        |      }t	        dt        |      d      D ]  }||   ||dz      f  y w)Nr   r   r   )r   _OddPathRepresentationr(   _EvenPathRepresentationranger`   )rG   odd_path	even_pathis       r)   pairszPathRegistry.pairs   sU     
 .		:0(;	q#h-+A1+yQ/// ,s   AAc                    t        t        | j                        }t        dt	        |      d      D cg c]  }||   	 c}D ]  }|j
                  j                  |      s y yc c}w )Nr   r   TF)r   rr   r(   rt   r`   mapperisa)rG   rz   _m_pathrw   path_mappers        r)   contains_mapperzPathRegistry.contains_mapper   sb    -tyy905aWq0IJ0I1GAJ0IJK!!%%f- K 	 Ks   A%c                "    || j                   f|v S r%   r'   )rG   rV   rW   s      r)   containszPathRegistry.contains   s    TYY:--r+   c                0    t         | j                         ffS r%   )r2   	serializerN   s    r)   
__reduce__zPathRegistry.__reduce__   s     0222r+   c                Z   t        t        |      }t        t        |      }t        t	        t        d t        dt        |      d      D cg c]  }||   	 c}D              t        d t        dt        |      d      D cg c]  }||   	 c}D              dz               S c c}w c c}w )Nc              3  z   K   | ]3  }|j                   s|j                  r|j                  n
t        |       5 y wr%   )	is_mapperis_aliased_classclass_str).0ms     r)   	<genexpr>z/PathRegistry._serialize_path.<locals>.<genexpr>  s3      L "#0B0BAHHQOLs   9;r   r   c              3  `   K   | ]&  }t        |      r|j                  n
t        |       ( y wr%   )r   rW   r   )r   ps     r)   r   z/PathRegistry._serialize_path.<locals>.<genexpr>  s,      L 5Q7AEESVCLs   ,.r   r%   )r   rr   rs   listziptuplert   r`   )clsr(   r|   _p_pathrw   s        r)   _serialize_pathzPathRegistry._serialize_path   s    -t4.5 273w<2KL2KQgaj2KL   273w<2KL2KQgaj2KL  	

 	
 M Ms   
B# B(c                    dd}dd}t        t        |D cg c]  \  }} ||       |||      f c}}       }|r
|d   |dd }|S c c}}w )Nc                z    | t         j                  vrt        j                  | d      S t         j                  |    S NT)	configure)	PathToken_internorm_base_inspect_mapped_class)mclss    r)   _deserialize_mapper_tokenzAPathRegistry._deserialize_path.<locals>._deserialize_mapper_token  s>    
 y000 ..ttD
 &&t,r+   c                    |y |t         j                  v rt         j                  |   S t        j                  | d      }|J |j                  |   S r   )r   r   r   r   attrs)r   rW   mps      r)   _deserialize_key_tokenz>PathRegistry._deserialize_path.<locals>._deserialize_key_token  sS    {	))) ((--33DDI~%~xx}$r+   r   )r   r   returnr   )r   r   rW   r   r   r   )r   r   )r   r(   r   r   r   rW   r   s          r)   _deserialize_pathzPathRegistry._deserialize_path  s{    		%  &*
 &*	c 2$7.tS9 &*

 2!BAs   A
c                <    | j                   }| j                  |      S r%   )r(   r   )rG   r(   s     r)   r   zPathRegistry.serialize2  s    yy##D))r+   c                N    |J | j                  |      }| j                  |      S r%   )r   coerce)r   r(   r   s      r)   r1   zPathRegistry.deserialize6  s,    !!$'zz!}r+   c                     y r%   r&   r   rz   s     r)   
per_mapperzPathRegistry.per_mapper<  s    GJr+   c                     y r%   r&   r   s     r)   r   zPathRegistry.per_mapper@  s    JMr+   c                r    |j                   rt        | j                  |      S t        | j                  |      S r%   )r   CachingEntityRegistryr=   SlotsEntityRegistryr   s     r)   r   zPathRegistry.per_mapperD  s/     (6::&sxx88r+   c                8    dd}t        ||| j                        S )Nc                    | |   S r%   r&   prevnext_s     r)   _redz!PathRegistry.coerce.<locals>._redO      ;r+   r   r#   r   _PathElementTyper   r#   )r   r=   )r   rawr   s      r)   r   zPathRegistry.coerceM  s    	 dC**r+   c                8    dd}t        ||j                  |       S )Nc                    | |   S r%   r&   r   s     r)   r   z"PathRegistry.__add__.<locals>._redV  r   r+   r   )r   r(   )rG   rH   r   s      r)   __add__zPathRegistry.__add__U  s    	 dEJJ--r+   c                N    ddj                  d | j                  D               dS )Nz	ORM Path[z -> c              3  2   K   | ]  }t        |        y wr%   r   )r   elems     r)   r   z'PathRegistry.__str__.<locals>.<genexpr>\  s     &GYTs4yYs   ])joinr(   rN   s    r)   __str__zPathRegistry.__str__[  s%    6;;&GTYY&GGHJJr+   c                N    | j                   j                   d| j                  dS )N())	__class____name__r(   rN   s    r)   __repr__zPathRegistry.__repr__^  s$    ..))*!DII=::r+   )rH   r   r   r7   r   zOptional[_PathRepresentation])rP   intr   r.   )rV   Dict[Any, Any]rW   r   rX   r   r   Noner%   )rV   r   rW   r   rX   zOptional[Any]r   r   )r   r   )rg   _StrPathTokenr   TokenRegistry)rg   r   r   r   )rg   slicer   r9   )rg   r.   r   AbstractEntityRegistry)rg   r/   r   PropRegistry)rg   zTUnion[_StrPathToken, int, slice, _InternalEntityType[Any], StrategizedProperty[Any]]r   zaUnion[TokenRegistry, _PathElementType, _PathRepresentation, PropRegistry, AbstractEntityRegistry])r   zOIterator[Tuple[_InternalEntityType[Any], Union[str, StrategizedProperty[Any]]]])rz   Mapper[Any]r   r7   )rV   r   rW   r   r   r7   )r   r   )r(   r9   r   _SerializedPath)r(   r   r   r9   )r   r   r(   r   r   r#   )rz   r   r   r   )rz   AliasedInsp[Any]r   r   )rz   r.   r   r   )r   r9   r   r#   )rH   r#   r   r#   )r   r   )*r   
__module____qualname____doc__	__slots__is_tokenr*   
has_entityis_propertyr-   __annotations__r   ExtendedInternalTraversaldp_has_cache_key_listr>   rI   rL   propertyrB   rQ   rY   r[   r]   ra   rd   r   rh   rp   rx   r~   r   r   classmethodr   r   r   r1   r   r   r   r   r   r&   r+   r)   r#   r#   X   sa   2 IHGJKI
%%""
 
33IIJ40    5?(?/2?;>?	? LP(/2;H	 F F? ?D D%.%	% % .	 $
$
$&  0
0.3 
 
$ ! !F*  
 J  JM  M9-9	9 9 + +.K;r+   c                  .    e Zd ZU dZded<   ded<   ddZy)CreatesTokenr&   r7   r   r*   c                    |j                  dt               rt        | |      S |j                  dt               rt        | j                  |      S t        j                  d|       )N:zinvalid token: )endswithr4   r   _DEFAULT_TOKENr=   r   ArgumentError)rG   tokens     r)   r   zCreatesToken.tokenh  s`    >>Ao./0 u--^^a/01 E22##oeW$=>>r+   N)r   r   r   r   )r   r   r   r   r   r   r&   r+   r)   r   r   b  s    IM?r+   r   c                  R    e Zd ZdZdZdZdxZZdZdZ	dZ
dZ	 	 	 	 ddZd	dZeseZyy)
r<   zXRoot registry, defers to mappers so that
    paths are maintained per-root-mapper.

    r&   TFc                    |t         j                  v r5t        rt        |t              sJ t        | t         j                  |         S 	 |j                  S # t        $ r t        d|       w xY w)Nz/invalid argument for RootRegistry.__getitem__: )	r   r   r   
isinstancer   r   _path_registryrC   
IndexErrorrf   s     r)   _getitemzRootRegistry._getitem  st     Y&&&!&-888 y'8'8'@AA,,,!  EfXN s   	A A-c                    | S r%   r&   rN   s    r)   _truncate_recursivez RootRegistry._truncate_recursive  s    r+   N)rg   r   r   z,Union[TokenRegistry, AbstractEntityRegistry])r   r<   )r   r   r   r   r   inherit_cacher(   r:   r   r   r*   r8   r   r   r   rh   r&   r+   r)   r<   r<   q  s[    
 IMD<JGL	5  r+   r<   c                  X    e Zd ZU dZi Zded<   	 	 	 	 	 	 ddZed	d       Ze	d
d       Z
y)r   zcacheable string tokenzDict[str, PathToken]r   c                    t        |       fS r%   r   )rG   r    
bindparamss      r)   _gen_cache_keyzPathToken._gen_cache_key  s     D	|r+   c                     y r%   r&   rN   s    r)   rB   zPathToken._path_for_compare  s    r+   c                t    || j                   v r| j                   |   S t        |      x| j                   |<   }|S r%   )r   r   )r   strvalueresults      r)   internzPathToken.intern  s:    s{{";;x((-6x-@@CKK!FMr+   N)r    r    r   zList[BindParameter[Any]]r   zTuple[Any, ...]r   )r   r   r   r   )r   r   r   r   r   r   r   r   rB   r   r   r&   r+   r)   r   r     sU     $&G!& .F	
    r+   r   c                  `    e Zd ZU dZdZded<   ded<   ddZdZdZdd	Z		 	 dd
Z
ddZeseZyy)r   )r   r;   r(   r:   Tr   r   r   r;   c                    t         j                  |      }|| _        || _        |j                  |fz   | _        |j
                  |fz   | _        y r%   )r   r   r   r;   r(   r:   )rG   r;   r   s      r)   __init__zTokenRegistry.__init__  sG      '
KK5(*	"//5(:r+   Fc              #    K   | j                   }t        |      r|  y t        rt        |t              sJ |j
                  sE|j                  j                         D ]'  }t        |j                   |   | j                         ) y |j
                  rot        d|j                        j                  rO|  t        d|j                        j                  D ]'  }t        |j                   |   | j                         ) y |  y wNr   )r;   r*   r   r   r   r   rz   iterate_to_rootr   r   r   rg   _is_with_polymorphic_with_polymorphic_entitiesrG   r;   mp_entents       r)   generate_for_superclassesz'TokenRegistry.generate_for_superclasses  s     6?Jf&<===&& --779#FMM&$94::FF : ##" #"#
 J"FMM(() $FMM#$6

CC)
 Js   DDc              #  ^  K   | j                   }t        |      r| j                   y t        rt	        |t
              sJ |j                  j                         D ]1  }t        |j                   |   | j                        j                   3 |j                  rt        d|j                        j                  rc| j                   t        d|j                        j                  D ]1  }t        |j                   |   | j                        j                   3 y | j                   y wr  )r;   r*   r:   r   r   r   rz   r  r   r   r   r   rg   r  r  r  s       r)   "_generate_natural_for_superclassesz0TokenRegistry._generate_natural_for_superclasses  s      6?###f&<===mm335Ff 5tzzBOOO 6 ##" #"#
 ###"FMM(() "&--"4djjANN) ###s   D+D-c                ^    	 | j                   |   S # t        $ r}t        |       |d }~ww xY wr%   )r(   	TypeErrorr   )rG   rg   errs      r)   r   zTokenRegistry._getitem  s5    	399V$$ 	3x)s2	3s    	,',N)r;   r   r   r   )r   zIterator[PathRegistry])r   zIterator[_PathRepresentation]rg   r   r   r   )r   r   r   r   r   r   r   r   r   r  r
  r   r   rh   r&   r+   r)   r   r     sO    ;IM; JH6$	&$:3  r+   r   c                  |    e Zd ZU dZdZdZded<   ded<   ded<   	 	 	 	 dd	Zdd
Ze	dd       Z
	 	 	 	 ddZeseZyy)r   )propr;   r(   r:   r   rg   rz   _wildcard_path_loader_key_default_path_loader_key_loader_keyr8   Tr/   r  zOptional[Mapper[Any]]rz   z"Optional[_InternalEntityType[Any]]rg   c                   t        d|d         }|}|j                  j                  xs t        |j                  j
                        | _        |j                  r|j                  r|j                  |j                     x}}n|j                  r|j                  ru|j                  |j                  v r]|d   j                  |j                        }|j                  |   }|j                  r!|j                  |j                     }d| _        nq|}nn|j                  rb|j                  rV|j                  |j                  ur>|j                  j                  |j                        r|j                  |j                     }|| _        || _        |j                  |fz   | _        |j                  |fz   | _        |j                  | _        |j                   r;t"        rt%        |t&              sJ |j(                  | _        |j                  | _        nd | _        d | _        d|j                  | j                  j*                  z   f| _        | j                  j.                  | _        d| j                  f| _        y )Nr.   r   Tloader)r   r;   r8   r7   rz   inheritsr   _use_mapper_pathwith_polymorphic_mappers_entity_for_mapperr{   r  r(   r:   _links_to_entityr   _is_relationshipr   r   r   rg   _wildcard_tokenr  r  r  )rG   r;   r  inspnatural_parentsubclass_entitys         r)   r   zPropRegistry.__init__  s    .r
;17 #MM66 
$MM"";
 $$(=(=&,mmDKK&@@F^!!--t<<<8>r
8U8UVZVaVa8bO]]?3F@ }}!'/E/E!F$(!!'!!%%;;,#]]4;;7N	KK4')	*774'A//  !$(<===++DK++DKDKDK $))";";;*
& )-		(J(J%$d&7&78r+   c                    d }t        t        | j                  d d             D ]  \  }}|| j                  u s|} || S | j	                  | j                  d|dz           S )Nr   r   r   )	enumeratereversedr(   r  r   )rG   earliestrw   r   s       r)   r   z PropRegistry._truncate_recursivev  sg    !(499Sb>":;HAu		! < K;;tyyx!|_=>>r+   c                <    | j                   J | | j                      S r%   )rg   rN   s    r)   entity_pathzPropRegistry.entity_path  s!    {{&&&DKK  r+   c                d    t        |t        t        f      r| j                  |   S t	        | |      S r%   )r   r   r   r(   r   rf   s     r)   r   zPropRegistry._getitem  s.     fsEl+99V$$&tV44r+   N)r;   r   r  r/   )r   r   r   r   )rg   z+Union[int, slice, _InternalEntityType[Any]]r   zDUnion[AbstractEntityRegistry, _PathElementType, _PathRepresentation])r   r   r   r   r   r   r   r   r   r   r%  r   r   rh   r&   r+   r)   r   r     s}    I MK
""!!..X9,X94LX9t	? ! !5A5	M5  r+   r   c                      e Zd ZU dZdZdZded<   ded<   ded<   ded	<   	 	 	 	 dd
ZddZe	dd       Z
e	dd       Ze	dd       ZddZ	 	 	 	 ddZeseZyy)r   )rW   r;   r   r(   rg   r:   T!Union[RootRegistry, PropRegistry]r;   r.   rW   rg   r7   r   c                   || _         || _        |j                  | _        || _        |j                  |fz   | _        |j                  r| j                  s|j
                  r|j                  j                  |j                  d   j                        r |j                  |j                  fz   | _        y |j                  |j                  d   j                  fz   | _        y | j                  | _        y )Nr   )	rW   r;   r   rg   r(   r8   rz   r{   r:   )rG   r;   rg   s      r)   r   zAbstractEntityRegistry.__init__  s    
  & 7 7KK6)+	$ ;;D11V5H5H }}  !4!4R!8!?!?@$*$7$76==:J$J!$*$7$7''+22; %! !%		Dr+   c                P    | j                   j                         | j                     S r%   )r;   r   rg   rN   s    r)   r   z*AbstractEntityRegistry._truncate_recursive  s    {{..0==r+   c                $    | j                  d      S )Nr   )rQ   rN   s    r)   root_entityz"AbstractEntityRegistry.root_entity  s    ""r+   c                    | S r%   r&   rN   s    r)   r%  z"AbstractEntityRegistry.entity_path  s    r+   c                .    | j                   j                  S r%   )rg   rz   rN   s    r)   rz   zAbstractEntityRegistry.mapper  s    {{!!!r+   c                     y)NTr&   rN   s    r)   __bool__zAbstractEntityRegistry.__bool__  s    r+   c                    t        |t        t        f      r| j                  |   S |t        j
                  v rt        | t        j
                  |         S t        | |      S r%   )r   r   r   r(   r   r   r   r   rf   s     r)   r   zAbstractEntityRegistry._getitem  sT     fsEl+99V$$y((( y'8'8'@AAf--r+   Nr;   r)  rg   r.   r'  )r   r.   )r   r#   )r   r   )r   r7   )rg   r   r   z:Union[_PathElementType, _PathRepresentation, PathRegistry])r   r   r   r   r   r-   r   r   r   r   r-  r%  rz   r1  r   r   rh   r&   r+   r)   r   r     s    I JI--	!!$$,*1,* ),*\> # #   " "..	C.  r+   r   c                      e Zd ZdZy)r   TN)r   r   r   r   r&   r+   r)   r   r     s	     Mr+   r   c                      e Zd ZddZddZy)_ERDictc                    || _         y r%   )registry)rG   r8  s     r)   r   z_ERDict.__init__  s	     r+   c                <    t        | j                  |      x| |<   }|S r%   )r   r8  )rG   rW   items      r)   __missing__z_ERDict.__missing__  s     's;;S	Dr+   N)r8  r   )rW   r   r   r   )r   r   r   r   r;  r&   r+   r)   r6  r6    s    !r+   r6  c                  P     e Zd ZdZdZ	 	 	 	 d fdZddZddZeseZ	 xZ
S  xZ
S )	r   )_cacheTc                F    t         |   ||       t        |       | _        y r%   )superr   r6  r=  )rG   r;   rg   r   s      r)   r   zCachingEntityRegistry.__init__
  s    
 	(dmr+   c                :    | j                   j                  ||      S r%   )r=  pop)rG   rW   defaults      r)   rA  zCachingEntityRegistry.pop  s    {{sG,,r+   c                    t        |t        t        f      r| j                  |   S t        |t              rt        | |      S | j                  |   S r%   )r   r   r   r(   r   r   r=  rf   s     r)   r   zCachingEntityRegistry._getitem  sE    fsEl+99V$$	* v..;;v&&r+   r3  )rW   r   rB  r   r   r   r  )r   r   r   r   r   r   rA  r   r   rh   __classcell__)r   s   @r)   r   r     s?     IM$1$ )$-'  r+   r   c                     y r%   r&   r'   s    r)   path_is_entityrF  #  s    ,/r+   c                     y r%   r&   r'   s    r)   path_is_propertyrH  '  s    r+   r   )r(   r#   r   zTypeGuard[RootRegistry])r(   r#   r   z!TypeGuard[AbstractEntityRegistry]r   )r(   r#   r   zTypeGuard[PropRegistry])Or   
__future__r   	functoolsr   	itertoolsr   loggingoperatortypingr   r   r   r	   r
   r   r   r   r   r   r    r   r   _typingr   r   r   sqlr   sql.cache_keyr   r   
interfacesr   rz   r   relationshipsr   r   r   sql.elementsr   sql.visitorsr    util.typingr!   r"   r*   r-   
attrgetterr   r   r   r   r9   rr   rs   	getLoggerr   rS   r2   r4   r   r   r#   r   r<   r=   InspectionAttrr   r   r   r   r   r6  r   rF  rH  r&   r+   r)   <module>r[     s   #                  ,    ',/3!6,'*'CO "h!!),G###K0I s)-/II  ,c12  ""<= "5)CS)H#IJ  g!* !$ #G;; G;T?< ?#< #L !N ''c .SL SlH< HV]\ ]@0 d38n 2 > 00	*0 M )X((5N*x**=9r+   