+
    i                   
  a  0 t $ R t^ RIHt ^ RIt^ RIt^ RIHt ^ RIt^ RI	t	^ RI
t
^ RIt^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ R	IHt ^ R
IHt ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RIH t  ^ RIH!t! ^ RIH"t" ^ RIH#t# ^ RIH$t$ ^ RI%t%^RI&H't' ^RI&H(t( ^RI)H*t* ^RIH+t+ ^RI&H,t, ]#! R4      t-]#! RRR 7      t.]#! R!]R"]3,          R#7      t/]#! R$R%R#7      t0]#! R&R'R#7      t1]#! R(R)R#7      t2]#! R*R+R#7      t3](Ph                  '       d=   ^ R,I5H6t6 ^ R-I5H7t7 R. t8]9Pt                  R/,          Pv                  t<R0 t=R1 R2 lt>R3 R4 lt?M](P                  '       d   R5 R6 lt?MR7 R8 lt?R9 R: ltA ! R; R<4      tBR= R> ltCR? R@ ltDRRA RB lltERC RD ltFRE RF ltGRG RH ltHRI RJ ltI]#! RKRLR#7      tJRM RN ltKRO RP ltL]#! RQ4      tM]#! RR4      tN ! RS RT4      tORU tP]RVRRWR"/RX RY ll4       tQ]RVRRWRZ/R[ R\ ll4       tQRVRRWRZ/R] R^ lltQR_ R` ltRRRa Rb lltSRRc Rd lltTRRe ltURRf Rg lltVRh tWRi tXRRj Rk lltY ! Rl Rm4      tZRn t[Ro t\RRp lt]Rq t^RRr lt_]#! RsRtR#7      t` ! Ru Rv]].,          4      ta ! Rw Rx]a].,          4      tb ! Ry Rz]a].,          4      tc]"'       d
   ]atd]ate]ftg]fthM]c;tdtg]b;tethR{ R| lti ! R} R~4      tj]"'       d   ]ftkM]jP                  tk ! R R4      tmR R ltnR R ltoR R ltpRR R lltqR R ltrR R ltsR R lttRR R lltuR R ltvR tw ! R R]f4      tx ! R R]]-,          4      ty ! R R]]-,          4      tz ! R R]]-,          4      t{ ! R R]|4      t} ! R R]94      t~ ! R R]~R7      t]"'       d
   ^ RIHt ]tM]t]#! R]EP                  R#7      tRR R llt^sR R ltR R ltRR lt ! R R]4      tRR R lltR R lt/ tR]R&   R R lt]EP                   ! R4      tRR R lltR R lt]EP                   ! R4      t]EP                   ! R4      t]]3R R llt]9! R4      tR t]EP                   ! R4      t ! R R4      t ! R R4      tR tR tR R ltR R ltR R lt]EP                   ! R4      tR R ltR R ltRR lt ! R R]EP                  4      t]EPL                  t]$]-]+]EPL                  ,          3,          tR# )zRoutines to help with the creation, loading and introspection of
modules, classes, hierarchies, attributes, functions, and methods.

)annotationsNupdate_wrapper)CodeType)Any)Callable)cast)Dict)	FrozenSet)Generic)Iterator)List)Mapping)NoReturn)Optional)overload)Sequence)Set)Tuple)Type)TYPE_CHECKING)TypeVar)Union)_collections)compat)HAS_CYEXTENSION)Literal)exc_T_T_coT)	covariant_F.)bound_MPzmemoized_property[Any]_MAz#HasMemoized.memoized_attribute[Any]_HPzhybridproperty[Any]_HMzhybridmethod[Any])call_annotate_function)Formatc                    \        V R R4      pVe5   \        W!V R7      p\        V\        4      '       g   \	        V : R24      hV# R# )__annotate__N)ownerz!.__annotate__ returned a non-dict)getattrr'   
isinstancedict
ValueError)objformatannotateanns   &&  ڄC:\Users\petid\OneDrive\Desktop\Maestro\MAESTRO CLAUDE\MAESTRO\maestro-backend\venv\Lib\site-packages\sqlalchemy\util\langhelpers.py_get_and_call_annotater5   F   sJ    35(ECc4(( C7*K!LMMJ    __annotations__c                    \        V \        4      '       d    \        V 4      pM\	        V R R4      pVf   / # \        V\
        4      '       g   \        V : R24      h\        V4      #   \         d    / u # i ; i)r7   Nz+.__annotations__ is neither a dict nor None)r-   type_BASE_GET_ANNOTATIONSAttributeErrorr,   r.   r/   r0   r3   s   & r4   _get_dunder_annotationsr=   R   s    c4  +C0
 #0$7C{	#t$$'DE  Cy " 	s   A' 'A76A7c               $    V ^8  d   QhRRRRRR/# )   r0   r   r1   r(   returnMapping[str, Any] )r1   s   "r4   r*   r*   d   s$      #	r6   c               2    \        V 4      pVe   \        V4      #  \        W4      pVf   \        V 4      pVf9   \	        V \
        4      '       g   \        V 4      '       d   / # \        V : R24      hV'       g   / # \        V4      #   \         d     Lxi ; i)z:A sparse implementation of annotationlib.get_annotations()z does not have annotations)r=   r.   	Exceptionr5   r-   r9   callable	TypeError)r0   r1   r3   s   &$ r4   _vendored_get_annotationsrG   d   s    
	!)#.C Cy   %S1; *#.C;#t$$	sg%?@AAICy1  		s   B BBc                    V ^8  d   QhRRRR/# r?   r0   r   r@   rA   rB   )r1   s   "r4   r*   r*      s     H HS H%6 Hr6   c                8    \        V \        P                  R 7      # ))r1   )rG   r(   
FORWARDREFr0   s   &r4   get_annotationsrM      s     )V5F5FGGr6   c                    V ^8  d   QhRRRR/# rI   rB   )r1   s   "r4   r*   r*      s     , ,S ,%6 ,r6   c                .    \         P                  ! V 4      # N)inspectrM   rL   s   &r4   rM   rM      s    &&s++r6   c                    V ^8  d   QhRRRR/# rI   rB   )r1   s   "r4   r*   r*      s     2 2S 2%6 2r6   c                    \        V \        4      '       d   V P                  P                  R R4      pM\	        V R R4      pVf   \
        P                  # \        RV4      # )r7   NrA   )r-   r9   __dict__getr,   r   
EMPTY_DICTr   r<   s   & r4   rM   rM      sV     c4  ,,""#4d;C#0$7C;***+S11r6   c                    V ^8  d   QhRRRR/# )r?   xr   r@   strrB   )r1   s   "r4   r*   r*      s     $ $s $s $r6   c                    V P                  R 4      p \        P                  ! 4       pVP                  V 4       \	        \
        VP                  4       4      # )zutf-8)encoder   md5_not_for_securityupdater   rY   	hexdigest)rX   ms   & r4   md5_hexr`      s<    	A##%AHHQKQ[[]##r6   c                  B    ] tR t^t$ RtRtR]R&   R R ltR R ltRt	R	# )
safe_reraisea  Reraise an exception after invoking some
handler code.

Stores the existing exception info before
invoking so that it is maintained across a potential
coroutine context switch.

e.g.::

    try:
        sess.commit()
    except:
        with safe_reraise():
            sess.rollback()

TODO: we should at some point evaluate current behaviors in this regard
based on current greenlet, gevent/eventlet implementations in Python 3, and
also see the degree to which our own asyncio (based on greenlet also) is
impacted by this. .rollback() will cause IO / context switch to occur in
all these scenarios; what happens to the exception context from an
"except:" block if we don't explicitly store it? Original issue was #2703.

	_exc_infozdUnion[None, Tuple[Type[BaseException], BaseException, types.TracebackType], Tuple[None, None, None]]c                   V ^8  d   QhRR/# r?   r@   NonerB   )r1   s   "r4   r*   safe_reraise.__annotate__   s     ( (4 (r6   c                	:    \         P                  ! 4       V n        R # rP   )sysexc_inforc   selfs   &r4   	__enter__safe_reraise.__enter__   s    r6   c               (    V ^8  d   QhRRRRRRRR/# )	r?   type_zOptional[Type[BaseException]]valuezOptional[BaseException]	tracebackzOptional[types.TracebackType]r@   r   rB   )r1   s   "r4   r*   rg      s2     2 2,2 '2 1	2
 
2r6   c                	    V P                   f   Q hVf.   V P                   w  rEpVf   Q hR V n         VP                  V4      hR V n         Vf   Q hVP                  V4      hrP   )rc   with_traceback)rl   rp   rq   rr   exc_type	exc_valueexc_tbs   &&&&   r4   __exit__safe_reraise.__exit__   so     ~~)))=*...'H(((!DN**622!DN$$$&&y11r6   )rc   N)
__name__
__module____qualname____firstlineno____doc__	__slots__r7   rm   rx   __static_attributes__rB   r6   r4   rb   rb      s'    0 I (2 2r6   rb   c                    V ^8  d   QhRRRR/# )r?   clsType[_T]r@   zIterator[Type[_T]]rB   )r1   s   "r4   r*   r*      s       &8 r6   c              #     "   \        4       pV .pV'       dO   VP                  4       p W9   d   K   VP                  V 4       VP                  V P	                  4       4       V x  KV  R # 5irP   )setpopaddextend__subclasses__)r   seenstacks   &  r4   walk_subclassesr      sS     UDEE
iik;HHSMS'')*	 s   A(AA(c                    V ^8  d   QhRRRR/# )r?   elementr   r@   rY   rB   )r1   s   "r4   r*   r*      s     6 63 63 6r6   c                ~    \        V \        4      '       d   V #  \        V 4      #   \         d    R T ,          u # i ; i)zunprintable element %r)r-   rY   rD   )r   s   &r4   string_or_unprintabler      s=    '3	6w< 	6+g55	6s   
% <<c               $    V ^8  d   QhRRRRRR/# )r?   r   	Type[Any]use_nameOptional[str]r@   rY   rB   )r1   s   "r4   r*   r*      s)     O O	O+OOr6   c                    T;'       g    V P                   pR P                  R \        P                  ! RV4       4       4      # ) c              3  @   "   T F  qP                  4       x  K  	  R # 5irP   )lower).0ns   & r4   	<genexpr>(clsname_as_plain_name.<locals>.<genexpr>  s     N'M!GGII'Ms   z([A-Z][a-z]+|SQL))rz   joinrefindall)r   r   names   && r4   clsname_as_plain_namer      s6     ##s||D88Nrzz2F'MNNNr6   c               $    V ^8  d   QhRRRRRR/# )r?   instance_or_clszUnion[Type[Any], object]against_methodCallable[..., Any]r@   boolrB   )r1   s   "r4   r*   r*     s&     , ,-,&, 
,r6   c                    \        V \        4      '       g   V P                  pMT pVP                  p\	        W#4      pWA8g  # )z1Return True if the two class methods don't match.)r-   r9   	__class__rz   r,   )r   r   current_clsmethod_namecurrent_methods   &&   r4   method_is_overriddenr     s?     ot,,%//% ))K'.{'HN++r6   c                    V ^8  d   QhRRRR/# )r?   slcslicer@   Tuple[Any, ...]rB   )r1   s   "r4   r*   r*     s      e  r6   c                    . pV P                   V P                  V P                  3 F6  p\        VR4      '       d   VP	                  4       pVP                  V4       K8  	  \        V4      # )zjdecode a slice object as sent to __getitem__.

takes into account the 2.5 __index__() method, basically.

	__index__)startstopstephasattrr   appendtuple)r   retrX   s   &  r4   decode_slicer     sU     CYY#((*1k""A

1 + :r6   c               $    V ^8  d   QhRRRRRR/# )r?   usedSequence[str]basesrY   r@   zIterator[str]rB   )r1   s   "r4   r*   r*   &  s&     M M- M M Mr6   c           
   '    a"   \        V 4      pV Fi  o\        P                  ! S3\        V3R  l\	        R4      4      4      pV F!  pWB9  g   K  VP                  V4       Vx   KW  	  \        RS,          4      h	  R# 5i)c                (   < S\        V 4      ,           # rP   rY   )ibases   &r4   <lambda>!_unique_symbols.<locals>.<lambda>+  s    $Q-r6   i  z&exhausted namespace for symbol base %sN)r   	itertoolschainmapranger   	NameError)r   r   used_setpoolsymr   s   &*   @r4   _unique_symbolsr   &  st     4yHG't5
 C"S!		  DtKLL s   AB 0B c               $    V ^8  d   QhRRRRRR/# )r?   fnzCallable[[int], Any]r   intr@   zIterator[Any]rB   )r1   s   "r4   r*   r*   6  s"      % # - r6   c              #  f   "   V'       d%   W( ^,           ,          pV ! V4      x  W,          pK,  R# 5i)z6Call the given function given each nonzero bit from n.NrB   )r   r   bs   && r4   map_bitsr   6  s,      aLe	 s   1&1_Fnr   c                    V ^8  d   QhRRRR/# )r?   targetr   r@   zCallable[[_Fn], _Fn]rB   )r1   s   "r4   r*   r*   D  s      Y, Y,( Y,-A Y,r6   c                .   a  R V 3R llp\        VS 4      # )z'A signature-matching decorator factory.c                    V ^8  d   QhRRRR/# )r?   r   r   r@   rB   )r1   s   "r4   r*   decorator.<locals>.__annotate__G  s     T- T-S T-S T-r6   c                  < \         P                  ! V 4      '       g(   \         P                  ! V 4      '       g   \        R 4      h\	        V RR4      pVe&   RV n         \        P                  ! V 4      pWn        M\        P                  ! V 4      pR\        VP                  ;'       g    R4      ,          p\        P                  VP                  ;'       g    R4      pVP                  / VVR7      p\        \        RV^ ,          4      4      \        RVR,          4      ,           V P                   3,           p\#        VRR4      w  rg\        WgR7      pVP%                  \'        VR	R
7      4       V P                   VR&   \         P(                  ! V 4      '       d   RVR&   RVR&   M
RVR&   RVR&   R\+        V^ ,          4      9   d   RV,          p	M	RV,          p	VSWpRV P,                  /p
\        \.        P0                  \3        WV P                   4      4      pV P4                  Vn        V P6                  Vn        \9        W4      #   Yn        i ; i)znot a decoratable functionr*   N)r   defaultskwonlydefaultszTuple[str, ...]:      Nr   r   )r   r   Fgroupedr   zasync prefixzawait target_prefix __zf%(prefix)sdef %(name)s%(grouped_args)s:
    return %(target_prefix)s%(target)s(%(fn)s, %(apply_pos)s)
ze%(prefix)sdef %(name)s%(grouped_args)s:
    return %(target_prefix)s%(target)s(%(fn)s, %(apply_kw)s)
rz   rP   rB   )rQ   
isfunctionismethodrD   r,   r*   r   inspect_getfullargspeclenr   r.   fromkeysr   _replacer   r   rz   r   r]   format_argspec_plusiscoroutinefunctionreprr{   typesFunctionType_exec_code_in_env__defaults____kwdefaults__r   )r   annofuncspecempty_defaultsempty_kwdefaultsnames	targ_namefn_namemetadatacodeenv	decoratedr   s   &           r4   decoratedecorator.<locals>.decorateG  s*   !!"%%g.>.>r.B.B899 2~t4"BO+44R8"*004D !3t}}':':#;;==)<)<)B)BC}}#+  
 $($q'23$d3i01{{n 	
 -UHdC	-1-O+D%@A;;&&r**!)HX(0H_%!#HX(*H_% 4Q=  	  	  v
 d5
	 "$	#%#4#4	 i,,Q #+s   I Ir   )r   r   s   f r4   	decoratorr  D  s    T- T-l (F++r6   c               (    V ^8  d   QhRRRRRRRR/# )	r?   r   zUnion[str, types.CodeType]r   Dict[str, Any]r   rY   r@   r   rB   )r1   s   "r4   r*   r*     s,      
$+9DGr6   c                (    \        W4       W,          # rP   )exec)r   r   r   s   &&&r4   r   r     s     	O<r6   _PF_TEc                  P    ] tR tRtRR R lltR tR R ltR R	 ltR
 R ltRt	R# )PluginLoaderi  Nc                    V ^8  d   QhRRRR/# )r?   grouprY   auto_fnzOptional[Callable[..., Any]]rB   )r1   s   "r4   r*   PluginLoader.__annotate__  s      #?r6   c                	,    Wn         / V n        W n        R # rP   )r  implsr  )rl   r  r  s   &&&r4   __init__PluginLoader.__init__  s     
%'
r6   c                	:    V P                   P                  4        R # rP   )r  clearrk   s   &r4   r  PluginLoader.clear  s    

r6   c                    V ^8  d   QhRRRR/# )r?   r   rY   r@   r   rB   )r1   s   "r4   r*   r    s     
 
 
 
r6   c                	   WP                   9   d   V P                   V,          ! 4       # V P                  '       d/   V P                  V4      pV'       d   W P                   V&   V! 4       # \        P                  ! V P                  4       F?  pVP
                  V8X  g   K  VP                  V P                   V&   VP                  4       u # 	  \        P                  ! R V P                  : RV: 24      h)zCan't load plugin: :)	r  r  r   importlib_metadata_getr  r   loadr   NoSuchModuleError)rl   r   loaderimpls   &&  r4   r  PluginLoader.load  s    ::::d#%%<<<\\$'F#)

4 x11$**=DyyD #'99

4 yy{" >
 ##*.**d;
 	
r6   c               (    V ^8  d   QhRRRRRRRR/# )r?   r   rY   
modulepathobjnamer@   rf   rB   )r1   s   "r4   r*   r    s(        S  c  C  D  r6   c                	4   aa VV3R  lpW@P                   V&   R# )c                    < \        S4      p SP                  R 4      R,           F  p\        W4      p K  	  \        V S4      # ).r   NN)
__import__splitr,   )modtokenr  r   s     r4   r  #PluginLoader.register.<locals>.load  sA    Z(C#))#.r22c) 33((r6   Nr  )rl   r   r  r   r  s   &&ff r4   registerPluginLoader.register  s    	)  

4r6   c                    V ^8  d   QhRRRR/# )r?   r   rY   r@   rf   rB   )r1   s   "r4   r*   r    s      s t r6   c                	     V P                   V R # rP   r*  )rl   r   s   &&r4   
deregisterPluginLoader.deregister  s    JJtr6   )r  r  r  rP   )
rz   r{   r|   r}   r  r  r  r+  r/  r   rB   r6   r4   r	  r	    s     
&  r6   r	  c                @    \         P                  pV P                  pVP                  p\	        VP
                  R V 4      \        VP                  V,          4      3#   \         d5    \        P                  ! T 4      pT^ ,          \        T^,          4      3u # i ; irP   )rQ   CO_VARKEYWORDS__code__co_argcountlistco_varnamesr   co_flagsr;   r   r   )r   co_varkeywordsconargsr   s   &    r4   _inspect_func_argsr;    s    
 // [['(~-.
 	
  &
 ,,R0AwT!W%%&s   A <BB_setraiseerrc               (    V ^8  d   QhRRRRRRRR/# )	r?   r   r9   r<  Optional[Set[str]]r=  zLiteral[True]r@   zSet[str]rB   )r1   s   "r4   r*   r*     s2      	  	
 r6   c                   R # rP   rB   r   r<  r=  s   &$$r4   get_cls_kwargsrB    s     r6   Fc               (    V ^8  d   QhRRRRRRRR/# r?   r   r9   r<  r?  r=  r   r@   rB   )r1   s   "r4   r*   r*     s,      	*=Ar6   c                   R # rP   rB   rA  s   &$$r4   rB  rB    s     r6   c               (    V ^8  d   QhRRRRRRRR/# rD  rB   )r1   s   "r4   r*   r*     s,     2 2	2*2=A22r6   c               B   VRJ pV'       d   \        4       pVf   Q hV P                  P                  RR4      pT;'       dG    \        V\        P
                  4      ;'       d%    \        VP                  \        P                  4      pV'       dI   \        V4      w  rgVP                  V4       V'       g"   V'       g   V'       d   \        RV  R24      hR# MRpV'       d	   V'       d$   V P                   F  p\        WR7      e   K   M	  VP                  R4       V# )aA  Return the full set of inherited kwargs for the given `cls`.

Probes a class's __init__ method, collecting all named arguments.  If the
__init__ defines a \**kwargs catch-all, then the constructor is presumed
to pass along unrecognized keywords to its base classes, and the
collection process is repeated recursively on each of the bases.

Uses a subset of inspect.getfullargspec() to cut down on method overhead,
as this is used within the Core typing system to create copies of type
objects which is a performance-sensitive operation.

No anonymous tuple arguments please !

Nr  Fz
given cls z  doesn't have an __init__ method)r<  rl   )r   rT   rU   r-   r   r   r3  r   r;  r]   rF   	__bases__rB  discard)	r   r<  r=  toplevelctrhas_initr   has_kwcs	   &$$      r4   rB  rB    s    " t|Hu
,,

:u
-C 	 	5 	5sE../	5 	5s||U^^4  *3/Eh %EF  vAa+3  	LLKr6   c                    V ^8  d   QhRRRR/# )r?   funcr   r@   	List[str]rB   )r1   s   "r4   r*   r*   .  s     2 2, 2 2r6   c                <    \         P                  ! V 4      ^ ,          # )zwReturn the set of legal kwargs for the given `func`.

Uses getargspec so is safe to call for methods, functions,
etc.

)r   r   )rP  s   &r4   get_func_kwargsrS  .  s     ((.q11r6   c               (    V ^8  d   QhRRRRRRRR/# )r?   r   r   no_selfr   _is_initr@   zcompat.FullArgSpecrB   )r1   s   "r4   r*   r*   9  s,     5; 5;5;%)5;=A5;5;r6   c           	     `   \         P                  ! V 4      '       d   \        RV ,          4      h\         P                  ! V 4      '       d   V'       d   V'       d   \        P
                  ! V 4      p\        P                  ! VP                  R,          VP                  VP                  VP                  VP                  VP                  VP                  4      # \        P
                  ! V 4      # \         P                  ! V 4      '       d   V'       d   V'       g   V P                  '       d   \        P
                  ! V P                   4      p\        P                  ! VP                  R,          VP                  VP                  VP                  VP                  VP                  VP                  4      # \        P
                  ! V P                   4      # \         P"                  ! V 4      '       d   \%        V P&                  VRR7      # \)        V R4      '       d!   \        P
                  ! V P                   4      # \)        V R4      '       dP   \         P                  ! V P*                  4      '       d   \%        V P*                  VR7      # \        RV ,          4      h\        RV ,          4      h)	zReturn the argument signature for any callable.

All pure-Python callables are accepted, including
functions, methods, classes, objects with __call__;
builtins and other edge cases like functools.partial() objects
raise a TypeError.

zCan't inspect builtin: %sr$  T)rU  rV  __func____call__)rU  zCan't inspect callable: %s)rQ   	isbuiltinrF   r   r   r   FullArgSpecargsvarargsvarkwr   
kwonlyargsr   r   r   __self__rX  isclassget_callable_argspecr  r   rY  )r   rU  rV  r   s   &&& r4   rb  rb  9  s    3b899			B		004D%%		"

##    0044			"		BKKK00=D%%		"

##    00==			#KK4
 	
 
Z	 	 ,,R[[99	Z	 	 BKK(('WEE82=>>4r9::r6   c               $    V ^8  d   QhRRRRRR/# )r?   r   z-Union[Callable[..., Any], compat.FullArgSpec]r   r   r@   zDict[str, Optional[str]]rB   )r1   s   "r4   r*   r*   q  s)     r
 r
5r
@Dr
r
r6   c           
     h   \        V 4      '       d   \        P                  ! V 4      pMT p\        P                  ! V!  p\        P                  ! V^ ,          V^,          V^,          RV^,          4      pV^ ,          '       dO   V^ ,          ^ ,          p\        P                  ! V^ ,          R,          V^,          V^,          RV^,          4      pM&V^,          '       d   RV^,          ,          pTpMRpTp^ pV^,          '       d3   V\	        \        \        \        ,          V^,          4      4      ,          pV^,          '       d   V\	        V^,          4      ,          pV^ ,          V^,          ,           pV'       d   V^ V,
          R p	MRp	\        P                  ! VV^,          V^,          V	R R7      p
V^ ,          '       d3   \        P                  ! VR,          V^,          V^,          V	R R7      pMT
pV'       d   \        VVVV
VVR7      # \        VVV^R	 V
^R	 V^R	 V^R	 R7      # )
a  Returns a dictionary of formatted, introspected function arguments.

A enhanced variant of inspect.formatargspec to support code generation.

fn
   An inspectable callable or tuple of inspect getargspec() results.
grouped
  Defaults to True; include (parens, around, argument) lists

Returns:

args
  Full inspect.formatargspec for fn
self_arg
  The name of the first positional argument, varargs[0], or None
  if the function defines no positional arguments.
apply_pos
  args, re-written in calling rather than receiving syntax.  Arguments are
  passed positionally.
apply_kw
  Like apply_pos, except keyword-ish args are passed as keywords.
apply_pos_proxied
  Like apply_pos but omits the self/cls argument

Example::

  >>> format_argspec_plus(lambda self, a, b, c=3, **d: 123)
  {'grouped_args': '(self, a, b, c=3, **d)',
   'self_arg': 'self',
   'apply_kw': '(self, a, b, c=c, **d)',
   'apply_pos': '(self, a, b, c, **d)'}

Nr$  z%s[0]c                &    R \        V 4      ,           # =r   rX   s   &r4   r   %format_argspec_plus.<locals>.<lambda>  s    cCFlr6   )formatvaluec                &    R \        V 4      ,           # rf  r   rh  s   &r4   r   ri    s    #A,r6   )grouped_argsself_arg	apply_posapply_kwapply_pos_proxiedapply_kw_proxiedrB   )	rE   r   r   inspect_formatargspecr   r   r   r   r.   )r   r   r   r\  rn  rm  rp  num_defaults	name_argsdefaulted_valsro  rq  s   &&          r4   r   r   q  s   H ||,,R0''.D,,Qa$q'4aI Aww71:"88GBKa$q'4a
 
aT!W$%%LAwwDsT!W566AwwDG$Q$q'!I "1|#3#56++QQ*H Aww!77bMGG.
 $/-
 	
 "oa^/"5-a3
 	
r6   c           	         V \         P                  J d   RpV'       d   RMRpV'       d   RMRpM \        WR7      # \	        RVVVVVR
7      #   \         d    RpT'       d   TMRpT'       d   RMR	p L8i ; i)a  format_argspec_plus with considerations for typical __init__ methods

Wraps format_argspec_plus with error handling strategies for typical
__init__ cases:

.. sourcecode:: text

  object.__init__ -> (self)
  other unreflectable (usually C) -> (self, *args, **kwargs)

z(self)rl   z()r   r   z(self, *args, **kwargs)zself, *args, **kwargsz(*args, **kwargs)z*args, **kwargs)rm  rl  rn  ro  rp  rq  )objectr  r   rF   r.   )methodr   rl  r\  proxieds   &&   r4   format_argspec_initr{    s      "x!$r	L&v??
 !!  	  	L4L#*<0GD-4):KG	Ls   A A6#A6/A65A6c               8    V ^8  d   QhRRRRRRRRRRR	RR
RRR/# )r?   
target_clsr   target_cls_sphinx_namerY   proxy_cls_sphinx_nameclassmethodsr   methods
attributesuse_intermediate_variabler@   zCallable[[_T], _T]rB   )r1   s   "r4   r*   r*     sX         	
    - r6   c                    R pV# )a;  A class decorator indicating attributes should refer to a proxy
class.

This decorator is now a "marker" that does nothing at runtime.  Instead,
it is consumed by the tools/generate_proxy_methods.py script to
statically generate proxy methods and attributes that are fully
recognized by typing tools such as mypy.

c                    V # rP   rB   )r   s   &r4   r   &create_proxy_methods.<locals>.decorate  s    
r6   rB   )r}  r~  r  r  r  r  r  r   s   &&&&&&& r4   create_proxy_methodsr    s    & Or6   c                     \         P                  ! V 4      #   \         d(    T \        P                  J d
   R.RRR3u # R.RRR3u # i ; i)zinspect.getargspec with considerations for typical __init__ methods

Wraps inspect.getargspec with error handling for typical __init__ cases:

.. sourcecode:: text

  object.__init__ -> (self)
  other unreflectable (usually C) -> (self, *args, **kwargs)

rl   Nr\  kwargs)r   r   rF   rx  r  )ry  s   &r4   getargspec_initr     sU    6,,V44 6V__$HdD$//Hfh55	6s    &A
 A
	A
c                    \        V \        P                  4      '       d   V P                  '       g   V P                  # V # )zKAdjust the incoming callable such that a 'self' argument is not
required.

)r-   r   
MethodTyper`  rX  )func_or_clss   &r4   unbound_method_to_callabler  4  s4     +u//009M9M9M###r6   c          
     ,    V ^8  d   QhRRRRRRRRR	R
/# )r?   r0   r   additional_kwzSequence[Tuple[str, Any]]
to_inspectz%Optional[Union[object, List[object]]]
omit_kwargr   r@   rY   rB   )r1   s   "r4   r*   r*   @  sH     KB KB	KB,KB 6KB 	KB
 	KBr6   c           	     J  a  Vf   S .pM\         P                  ! V4      p\        4       p. p\         P                  ! 4       pRp\	        V4       EFW  w  r \
        P                  ! V	P                  4      p
V
P                  '       d   \        V
P                  4      M^ pV^ 8X  dj   V
P                  '       d   V
P                  pV'       d!   VP                  V
P                  ^V)  4       MSVP                  V
P                  R,          4       M0TP                  V
P                  ^V)   Uu. uF  qV3NK  	  up4       V'       d`   V
P                  '       g   Q hTP                  \        V
P                  V) R V
P                  4       UUu. uF  w  rW3NK
  	  upp4       EKW  EKZ  	  . pVP                  V 3R lV 4       4       VeG   \!        S V4      '       d5   TP                  \#        S V4       Uu. uF  p\%        V4      NK  	  up4       VP'                  4        FC  w  ppW9   d   K   \#        S W4      pWJd$   VV8w  d   VP)                  V: RV: 24       KA  KC  KE  	  V'       dB   V F;  w  pp \#        S W4      pWJd$   VV8w  d   VP)                  V: RV: 24       K9  K;  K=  	  S P,                  P.                  : RRP1                  V4      : R2# u upi u uppi   \         d     EK  i ; iu upi   \*         d     K  i ; i  \*         d     K  i ; i)zuProduce a __repr__() based on direct association of the __init__()
specification vs. same-named attributes present.

Nr$  c              3  P   <"   T F  p\        \        SVR 4      4      x  K  	  R # 5irP   )r   r,   )r   argr0   s   & r4   r   generic_repr.<locals>.<genexpr>s  s"     D8C$wsC.//8s   #&rg  (, ))r   to_listrx  OrderedDict	enumerater   r   r  r   r   r]  r   r\  r]   ziprF   r   r,   r   itemsr   rD   r   rz   r   )r0   r  r  r  missingpos_argskw_argsvargsr   inspr   default_lenr  defaultoutputvaldefvals   f&&&             r4   generic_reprr  @  s    U
!))*5
hGH2>2J2J2LGEZ(	00?D 15#dmm,1KAv<<< LLEOODIIa$=>OODIIbM2/3yyK</HI/H7^/HI }}}$} -0 II{lm4dmm--LC - ' ): F
MMD8DDWS%00GC,?@,?StCy,?@A}}V	#s,C!cVmc23 '4! ' (KCc30%#-MMS#"67 +8% ) }}--tyy/@AAO J'  		> A  		  sH    K)+K
K#6K<00L90L)K98K9LLL"!L"c                  :    ] tR tRtRtR	tR tR tR
R ltR t	Rt
R# )portable_instancemethodi  zWTurn an instancemethod into a (parent, name) pair
to produce a serializable callable.

c                	N    R V P                   RV P                  RV P                  /# r   r   r  r  rk   s   &r4   __getstate__$portable_instancemethod.__getstate__  s'    dkkDIIdkk
 	
r6   c                	l    VR ,          V n         VR,          V n        VP                  RR4      V n        R# )r   r   r  NrB   )r   r   rU   r  )rl   states   &&r4   __setstate__$portable_instancemethod.__setstate__  s*    Ho&M	ii"-r6   c                	V    VP                   V n        VP                  V n        W n        R # rP   )r`  r   rz   r   r  )rl   methr  s   &&&r4   r   portable_instancemethod.__init__  s    mmMM	r6   c                	    VP                  V P                  4       \        V P                  V P                  4      ! V/ VB # rP   )r]   r  r,   r   r   )rl   r  kws   &*,r4   rY   portable_instancemethod.__call__  s1    
		$++t{{DII.:r::r6   )r  r   r   N)r   r   r  __weakref__)rB   )rz   r{   r|   r}   r~   r   r  r  r  rY  r   rB   r6   r4   r  r    s"    
 :I
.

;r6   r  c                F  a V 0o\        V P                  4      pV'       d   VP                  4       pV3R lVP                   4       pV F%  pVP	                  V4       SP                  V4       K'  	  VP                  R8X  g   \        VR4      '       g   K~  \        V\        4      '       g   VP                  4       MVP                  V4       Uu. uF  pVS9  g   K  VNK  	  up F%  pVP	                  V4       SP                  V4       K'  	  K  \        S4      # u upi )a  Return an unordered sequence of all classes related to cls.

Traverses diamond hierarchies.

Fibs slightly: subclasses of builtin types are not returned.  Thus
class_hierarchy(class A(object)) returns (A, object), not A plus every
class systemwide that derives from object.

c              3  8   <"   T F  qS9  g   K  Vx  K  	  R # 5irP   rB   )r   _hiers   & r4   r   "class_hierarchy.<locals>.<genexpr>  s     9KqD=Ks   
builtinsr   )r5  __mro__r   rH  r   r   r{   r   
issubclassr9   r   )r   processrN  r   r   r  sr  s   &      @r4   class_hierarchyr    s     5D3;;G
KKM9AKK9ANN1HHQK  <<:%WQ8H-I-I "!T**   "%%a()
) 
 } A)
A NN1HHQK
 :
s   	DDc              #     "   \        V 4      pV F?  pV P                   F,  pW#P                  9   g   K  W#P                  V,          3x   K=  	  KA  	  R# 5i)ziterate all the keys and attributes associated
with a class, without using getattr().

Does not use getattr() so that class-sensitive
descriptors (i.e. property.__get__()) are not called.

N)dirr  rT   )r   keyskeyrN  s   &   r4   iterate_attributesr    sF      s8DAjj JJsO,,  s
   -A!Ac                   V'       d   TpMmVf   R	p\        V4       Uu. uFR  pVP                  R4      '       g   K  VP                  R4      '       g   K5  \        W4      '       d   KH  Wr9  g   KP  VNKT  	  ppV EF  p \	        W4      p	\        V	R4      '       g   K$  \	        V	RV	4      p	\        \        P                  V	4      p
 \        P                  ! T
4      p\        P                  ! T^ ,          4      p\        P                  ! T^ ,          R,          4      pR\        4       ,          pTRJ;'       d    YE/;'       g    / p\        Y4        T
P                  Y,          n        \!        YY,          4       EK  	  R# u upi   \         d     EK  i ; i  \         d    RpRp Li ; i  \         d     LSi ; i)
z9Automates delegation of __specials__ for a proxying type.Nr   rY  rX  r$  z(self, *args, **kw)z(*args, **kw)z?def %(method)s%(fn_args)s: return %(name)s.%(method)s%(d_args)s)r   __del____getattribute____metaclass__r  r  )r  
startswithendswithr   r,   r   r   r   r;   r   r   rs  rF   localsr  r   setattr)into_clsfrom_clsskiponlyr   from_instancedundersr_   ry  maybe_fnr   r   fn_argsd_argspyr   s   &&&&&&          r4   monkeypatch_proxied_specialsr    s    <D ]	
"T"  JJt$	 
  ,  M A" 	 	
 	x0H8Z00xX>He(((3B	%004D2247;G11$q'"+>F35;X> 	 %??4*?EE2 	 	R	')CK$ 	#+.? 	
&  		  	%+G$F	%  		sY   FFF)F1F F	'F	AFF1	FFF.-F.1F?>F?c                6    \        V RV 4      \        VRV4      J # )z;Return True if the two methods are the same implementation.rX  )r,   )meth1meth2s   &&r4   methods_equivalentr  %  s(     5*e,z51  r6   c           	        V'       g   V'       g   \        R4      h\        V\        4      '       d   \        W4      '       d   V # \        T;'       g4    \	        V4       Uu. uF  qDP                  R4      '       d   K  VNK  	  up4      p\        \	        V 4      4      p\        P                  p\        V\        4      '       d   TpM.V'       g   \        4       p\        P                  pM\        V4      pV! VP                  V4      V4      '       d   V # \        V \        4      '       gL   V\        P                  J ;'       d    R;'       g    Rp\        V : RV: RRP                  V4      : 24      h ! R R	4      p	V'       d   R
VP                  ,           V	n        \        4       p
\        V 4       Fg  w  rW9  d   \        RV,          4      h\        V4      '       g   \        V: RV: R24      h\        W\!        V4      4       V
P#                  V4       Ki  	  V! W4      '       d   V	# \        RRP                  W:,
          4      ,          4      hu upi )a*  Ensure basic interface compliance for an instance or dict of callables.

Checks that ``obj`` implements public methods of ``cls`` or has members
listed in ``methods``. If ``required`` is not supplied, implementing at
least one interface method is sufficient. Methods present on ``obj`` that
are not in the interface are ignored.

If ``obj`` is a dict and ``dict`` does not meet the interface
requirements, the keys of the dictionary are inspected. Keys present in
``obj`` that are not in the interface will raise TypeErrors.

Raises TypeError if ``obj`` does not meet the interface criteria.

In all passing cases, an object with callable members is returned.  In the
simple case, ``obj`` is returned as-is; if dict processing kicks in then
an anonymous class is returned.

obj
  A type, instance, or dictionary of callables.
cls
  Optional, a type.  All public methods of cls are considered the
  interface.  An ``obj`` instance of cls will always pass, ignoring
  ``required``..
methods
  Optional, a sequence of method names to consider as the interface.
required
  Optional, a sequence of mandatory implementations. If omitted, an
  ``obj`` that provides at least one interface method is considered
  sufficient.  As a convenience, required may be a type, in which case
  all public methods of the type are required.

z2a class or collection of method names are requiredr  zany ofzall ofz does not implement z: r  c                      ] tR tRtRtRtR# )(as_interface.<locals>.AnonymousInterfaceik  zA callable-holding shell.rB   Nrz   r{   r|   r}   r~   r   rB   r6   r4   AnonymousInterfacer  k  s    'r6   r  	Anonymousz%r: unknown in this interfacerg  z is not callablez,dictionary does not contain required keys %s)rF   r-   r9   r   r  r  operatorgegtintersectionr.   r   rz   dictlike_iteritemsrE   r  staticmethodr   )r0   r   r  requiredr_   	interfaceimplementedcomplies	qualifierr  foundry  r  s   &&&&         r4   as_interfacer  -  s   B wLMM#tC!5!5
GMM3s8M8a<<;L8MNIc#h-K{{H(D!!5;;x=((3X>>
 c4  +88DDH	Ityy35
 	

( ( &1CLL&@#EE*3/";fDEE~~vtDEE"L,>?		& 0   !!
6
))H$
%	& S  Ns   !I>I_GFDzgeneric_fn_descriptor[Any]c                      ] tR tRt$ RtR]R&   R]R&   R]R&   RR
 R llt]R R l4       t]R R l4       tR R lt]	'       d   R R lt
R R ltR R lt]R R l4       tRtR	# )generic_fn_descriptori  aO  Descriptor which proxies a function when the attribute is not
present in dict

This superclass is organized in a particular way with "memoized" and
"non-memoized" implementation classes that are hidden from type checkers,
as Mypy seems to not be able to handle seeing multiple kinds of descriptor
classes used for the same attribute.

Callable[..., _T_co]fgetr   r~   rY   rz   Nc                    V ^8  d   QhRRRR/# )r?   r  r  docr   rB   )r1   s   "r4   r*   "generic_fn_descriptor.__annotate__  s     & &1 & &r6   c                	j    Wn         T;'       g    VP                  V n        VP                  V n        R # rP   r  r~   rz   rl   r  r  s   &&&r4   r  generic_fn_descriptor.__init__  s%    	**dllr6   c               (    V ^8  d   QhRRRRRRRR/# )r?   rl   r  r0   rf   r   r   r@   rB   )r1   s   "r4   r*   r    s    ==d==C=D=r6   c                	    R # rP   rB   rl   r0   r   s   &&&r4   __get__generic_fn_descriptor.__get__  s    :=r6   c               $    V ^8  d   QhRRRRRR/# )r?   r0   rx  r   r   r@   r   rB   )r1   s   "r4   r*   r    s    ::6:::r6   c                	    R # rP   rB   r  s   &&&r4   r  r    s    7:r6   c               (    V ^8  d   QhRRRRRRRR/# )r?   rl   r  r0   r   r   r@   zUnion[_GFD, _T_co]rB   )r1   s   "r4   r*   r    s)     $ $d $ $3 $3E $r6   c                	    \        4       hrP   NotImplementedErrorr  s   &&&r4   r  r        !##r6   c               $    V ^8  d   QhRRRRRR/# r?   instancer   rq   r@   rf   rB   )r1   s   "r4   r*   r    s    AACAAAr6   c                	    R # rP   rB   rl   r  rq   s   &&&r4   __set__generic_fn_descriptor.__set__  s    cr6   c                    V ^8  d   QhRRRR/# r?   r  r   r@   rf   rB   )r1   s   "r4   r*   r    s    88s8t8r6   c                	    R # rP   rB   )rl   r  s   &&r4   
__delete__ generic_fn_descriptor.__delete__  s    Sr6   c                    V ^8  d   QhRRRR/# )r?   r0   r   r@   rf   rB   )r1   s   "r4   r*   r    s     $ $# $$ $r6   c                	    \        4       hrP   r
  rl   r0   s   &&r4   _resetgeneric_fn_descriptor._reset  r  r6   c               $    V ^8  d   QhRRRRRR/# )r?   r0   r   r   rY   r@   rf   rB   )r1   s   "r4   r*   r    s!     $ $ $3 $4 $r6   c                	    \        4       hrP   r
  r   r0   r   s   &&&r4   resetgeneric_fn_descriptor.reset  s    !##r6   r~   rz   r  rP   )rz   r{   r|   r}   r~   r7   r  r   r  r   r  r  r  classmethodr!  r   rB   r6   r4   r  r    sf     M&
 = =: :$ A8$ $ $r6   r  c                  8    ] tR tRtRt]'       g   R tRtR# RtR# )_non_memoized_propertyi  za plain descriptor that proxies a function.

primary rationale is to provide a plain attribute that's
compatible with memoized_property which is also recognized as equivalent
by mypy.

c                	0    Vf   V # V P                  V4      # rP   r  r  s   &&&r4   r  _non_memoized_property.__get__  s    {99S>!r6   rB   N)rz   r{   r|   r}   r~   r   r  r   rB   r6   r4   r&  r&    s     	" r6   r&  c                  F    ] tR tRtRt]'       g   R tR t]R 4       t	Rt
R# )_memoized_propertyi  z2A read-only @property that is only evaluated once.c                	f    Vf   V # V P                  V4      ;VP                  V P                  &   pV# rP   )r  rT   rz   rl   r0   r   results   &&& r4   r  _memoized_property.__get__  s0    {3799S>ACLL'&Mr6   c                	D    \         P                  WP                  4       R # rP   )r+  r!  rz   r  s   &&r4   r  _memoized_property._reset  s      mm4r6   c                	>    VP                   P                  VR 4       R # rP   )rT   r   r   s   &&&r4   r!  _memoized_property.reset  s    t$r6   rB   N)rz   r{   r|   r}   r~   r   r  r  r$  r!  r   rB   r6   r4   r+  r+    s&    <	5 % %r6   r+  c                    V ^8  d   QhRRRR/# r?   r   r!   r@   rB   )r1   s   "r4   r*   r*     s     ' ' 'r 'r6   c                (   a  V 3R lp\        VS 4      # )zDecorate a method memoize its return value.

Best applied to no-arg methods: memoization is not sensitive to
argument values, and will always return the same value even when
called with different arguments.

c                   <a S! V .VO5/ VB oV3R  lpSP                   Vn         SP                  Vn        W0P                  SP                   &   S# )c                    < S# rP   rB   ar  r.  s   *,r4   memo6memoized_instancemethod.<locals>.oneshot.<locals>.memo  s    Mr6   )rz   r~   rT   rl   r\  r  r;  r.  r   s   &*, @r4   oneshot(memoized_instancemethod.<locals>.oneshot  sI    D&4&2&	 zz%)bkk"r6   r   )r   r>  s   f r4   memoized_instancemethodr@    s    	 '2&&r6   c                      ] tR tRt$ Rt]'       g   Rt]! 4       tR]	R&   R R lt
R R ltR	 R
 lt ! R R]],          4      t]R R l4       tRtR# )HasMemoizedi  zwA mixin class that maintains the names of memoized elements in a
collection for easy cache clearing, generative, etc.

zFrozenSet[str]_memoized_keysc                   V ^8  d   QhRR/# re   rB   )r1   s   "r4   r*   HasMemoized.__annotate__  s     * *T *r6   c                	d    V P                    F  pV P                  P                  VR 4       K!  	  R # rP   )rC  rT   r   rl   elems   & r4   _reset_memoizationsHasMemoized._reset_memoizations  s&    ''DMMdD) (r6   c                   V ^8  d   QhRR/# re   rB   )r1   s   "r4   r*   rE    s     - - -r6   c                	P    V P                    F  pWP                  9  d   K  Q h	  R # rP   )rC  rT   rG  s   & r4   _assert_no_memoizations#HasMemoized._assert_no_memoizations  s"    ''D}},,, (r6   c               $    V ^8  d   QhRRRRRR/# )r?   r  rY   rq   r   r@   rf   rB   )r1   s   "r4   r*   rE    s!     % %3 %s %t %r6   c                	V    W P                   V&   V ;P                  V0,          un        R # rP   )rT   rC  )rl   r  rq   s   &&&r4   _set_memoized_attribute#HasMemoized._set_memoized_attribute  s!    "cu$r6   c                  |    ] tR tRt$ RtR]R&   R]R&   R]R&   RR
 R llt]R R l4       t]R R l4       tR tRt	R	# )HasMemoized.memoized_attributei!  zDA read-only @property that is only evaluated once.

:meta private:

Callable[..., _T]r  r   r~   rY   rz   Nc                    V ^8  d   QhRRRR/# )r?   r  rU  r  r   rB   )r1   s   "r4   r*   +HasMemoized.memoized_attribute.__annotate__,  s     	* 	*!2 	* 	*r6   c                	j    Wn         T;'       g    VP                  V n        VP                  V n        R # rP   r  r  s   &&&r4   r  'HasMemoized.memoized_attribute.__init__,  s%    I..$,,DL MMDMr6   c               (    V ^8  d   QhRRRRRRRR/# )r?   rl   r$   r0   rf   r   r   r@   rB   )r1   s   "r4   r*   rW  2  s    ??#?D?s?s?r6   c                	    R # rP   rB   r  s   &&&r4   r  &HasMemoized.memoized_attribute.__get__1  s    <?r6   c               $    V ^8  d   QhRRRRRR/# )r?   r0   r   r   r@   r   rB   )r1   s   "r4   r*   rW  5  s    88s888r6   c                	    R # rP   rB   r  s   &&&r4   r  r\  4  s    58r6   c                	    Vf   V # V P                  V4      ;VP                  V P                  &   pV;P                  V P                  0,          un        V# rP   )r  rT   rz   rC  r-  s   &&& r4   r  r\  7  sG    {3799S>ACLL'&4==/1Mr6   r#  rP   )
rz   r{   r|   r}   r~   r7   r  r   r  r   rB   r6   r4   memoized_attributerT  !  sB    	  	*
 
? 
?	8 
8	r6   r`  c                    V ^8  d   QhRRRR/# r5  rB   )r1   s   "r4   r*   rE  ?  s     + + + +r6   c                .   a R V3R llp\        VS4      # )z=Decorate a method memoize its return value.

:meta private:

c               (    V ^8  d   QhRRRRRRRR/# )r?   rl   r   r\  r  r@   rB   )r1   s   "r4   r*   9HasMemoized.memoized_instancemethod.<locals>.__annotate__F  s(     
	 
	# 
	c 
	 
	 
	r6   c                   <a S! V .VO5/ VB oV3R  lpSP                   Vn         SP                  Vn        W0P                  SP                   &   V ;P                  SP                   0,          un        S# )c                    < S# rP   rB   r9  s   *,r4   r;  BHasMemoized.memoized_instancemethod.<locals>.oneshot.<locals>.memoI  s    r6   )rz   r~   rT   rC  r=  s   &*, @r4   r>  4HasMemoized.memoized_instancemethod.<locals>.oneshotF  s`    *t*r*F KKDM::DL)-MM"++&BKK=0Mr6   r   )r   r   r>  s   &f r4   r@  #HasMemoized.memoized_instancemethod>  s    
	 
	 gr**r6   rB   N)rz   r{   r|   r}   r~   r   r   	frozensetrC  r7   rI  rM  rQ  memoized_propertyr   r`  r$  r@  r   rB   r6   r4   rB  rB    sT    
  	%.[NN0*-%.r2 : + +r6   rB  c                  0    ] tR tRtRtRtR tR R ltRtR# )MemoizedSlotsi[  a@  Apply memoized items to an object using a __getattr__ scheme.

This allows the functionality of memoized_property and
memoized_instancemethod to be available to a class using __slots__.

The memoized get is not threadsafe under freethreading and the
creator method may in extremely rare cases be called more than once.

c                	    \        V4      hrP   )r;   )rl   r  s   &&r4   _fallback_getattrMemoizedSlots._fallback_getattrh  s    S!!r6   c                    V ^8  d   QhRRRR/# )r?   r  rY   r@   r   rB   )r1   s   "r4   r*   MemoizedSlots.__annotate__k  s     / /s /s /r6   c                	  a aa SP                  R 4      '       g   SP                  R4      '       d   \        S4      h\        S P                  R S 24      '       d$   \	        S R S 24      ! 4       p\        S SV4       V# \        S P                  RS 24      '       d+   \	        S RS 24      oVVV 3R lpSP                  Vn        V# S P                  S4      # )_memoized_attr__memoized_method_c                    <a S! V / VB oV3R  lpSP                   Vn         SP                  Vn        \        SSV4       S# )c                    < S# rP   rB   r9  s   *,r4   r;  8MemoizedSlots.__getattr__.<locals>.oneshot.<locals>.memo}  s    !Mr6   )rz   r~   r  )r\  r  r;  r.  r  r  rl   s   *, @r4   r>  *MemoizedSlots.__getattr__.<locals>.oneshotz  s@    t*r*" !%#||c4(r6   )r  r;   r   r   r,   r  r~   ro  )rl   r  rq   r>  r  s   ff  @r4   __getattr__MemoizedSlots.__getattr__k  s    >>+,,1
 1
 !%% T^^se%<==DOC5"9:<ED#u%LT^^'8%>??4#4SE!:;D	 #llGON))#..r6   rB   N)	rz   r{   r|   r}   r~   r   ro  rz  r   rB   r6   r4   rm  rm  [  s     I"/ /r6   rm  c                    V ^8  d   QhRRRR/# )r?   r0   r   r@   r   rB   )r1   s   "r4   r*   r*     s     	 	 	 	r6   c                    \        V \        4      '       dC   V P                  4       P                  4       p V R9   d   R# V R9   d   R# \	        RV ,          4      h\        V 4      # )trueTFzString is not true/false: %r)r~  yesonyt1)falsenooffr   f0)r-   rY   stripr   r/   r   rL   s   &r4   asboolr    sV    #siik!6699;cABB9r6   c                    V ^8  d   QhRRRR/# )r?   textrY   r@   z!Callable[[str], Union[str, bool]]rB   )r1   s   "r4   r*   r*     s      s @ r6   c                    a  R V 3R llpV# )ziReturn a callable that will evaluate a string as
boolean, or one of a set of "alternate" string values.

c                    V ^8  d   QhRRRR/# )r?   r0   rY   r@   zUnion[str, bool]rB   )r1   s   "r4   r*   !bool_or_str.<locals>.__annotate__  s      3 #3 r6   c                ,   < V S9   d   V # \        V 4      # rP   )r  )r0   r  s   &r4   bool_or_value"bool_or_str.<locals>.bool_or_value  s    $;J#;r6   rB   )r  r  s   j r4   bool_or_strr    s      r6   c                    V ^8  d   QhRRRR/# )r?   rq   r   r@   Optional[int]rB   )r1   s   "r4   r*   r*     s        r6   c                $    V f   V # \        V 4      # )zCoerce to integer.)r   )rq   s   &r4   asintr    s     }u:r6   c               0    V ^8  d   QhRRRRRRRRR	R
RR/# )r?   r  r  r  rY   rp   r   
flexi_boolr   destzOptional[Dict[str, Any]]r@   rf   rB   )r1   s   "r4   r*   r*     sD     ' ''	' ' 	'
 #' 
'r6   c                   Vf   T pW9   dv   \        V\        4      '       d   \        W,          V4      '       gF   W,          e:   V\        J d   V'       d   \        W,          4      WA&   R# V! W,          4      WA&   R# R# R# R# )zIf 'key' is present in dict 'kw', coerce its value to type 'type\_' if
necessary.  If 'flexi_bool' is True, the string '0' is considered false
when coercing to boolean.
N)r-   r9   r   r  )r  r  rp   r  r  s   &&&&&r4   coerce_kw_typer    sk     | 		E4((
27E0J0JGD=ZrwDIbgDI   1K 	r6   c               $    V ^8  d   QhRRRRRR/# )r?   r0   r   r   r   r@   r   rB   )r1   s   "r4   r*   r*     s!       9  r6   c                   a  \        V4      pV3\        ;QJ d    . V 3R lV 4       F  NK  	  5,           # ! V 3R lV 4       4      ,           # )zZProduce a tuple structure that is cacheable using the __dict__ of
obj to retrieve values

c              3  r   <"   T F,  qSP                   9   g   K  VSP                   V,          3x  K.  	  R # 5irP   rT   r   kr0   s   & r4   r   "constructor_key.<locals>.<genexpr>  s-      &+CLL/@CLLOe   77)rB  r   )r0   r   r   s   f& r4   constructor_keyr    sO    
 3E6EE &+E  E &+   r6   c          
     ,    V ^8  d   QhRRRRRRRRRR/# )	r?   r0   r   r   r   r\  r   r  r@   rB   )r1   s   "r4   r*   r*     s/      " 8 C s r r6   c                ~   a  \        V4      pVP                  V 3R lVP                  V4       4       4       V! V/ VB # )z|Instantiate cls using the __dict__ of obj as constructor arguments.

Uses inspect to match the named arguments of ``cls``.

c              3  r   <"   T F,  qSP                   9   g   K  VSP                   V,          3x  K.  	  R # 5irP   r  r  s   & r4   r   #constructor_copy.<locals>.<genexpr>  s.      &:3<<>OCLLO&:r  )rB  r]   
difference)r0   r   r\  r  r   s   f&*, r4   constructor_copyr    sE     3EII &+&6&6r&:  r6   c                   V ^8  d   QhRR/# )r?   r@   zCallable[[], int]rB   )r1   s   "r4   r*   r*     s      " r6   c                 n   aa \         P                  ! 4       o\        P                  ! ^4      oVV3R lp V # )z%Return a threadsafe counter function.c                 l   < S;_uu_ 4        \        S 4      uuR R R 4       #   + '       g   i     R # ; irP   )next)counterlocks   r4   _nextcounter.<locals>._next  s    T= TTTs   "3	)	threadingLockr   count)r  r  r  s    @@r4   r  r    s+     >>Dooa G! Lr6   c               $    V ^8  d   QhRRRRRR/# )r?   specimenr   r  zOptional[Type[Any]]r@   rB   )r1   s   "r4   r*   r*     s$         /  r6   c                   \        V R4      '       dA   V P                  e'   \        V P                  \        4      '       d   \        # V P                  # \	        V \
        4      '       d   \        M\        pV! V \        4      '       d   \        # V! V \        4      '       d   \        # V! V \        4      '       d   \        # \        V R4      '       d   \        # \        V R4      '       d   \        # \        V R4      '       d   \        # V# )zGiven an instance or class, guess if it is or is acting as one of
the basic collection types: list, set and dict.  If the __emulates__
property is present, return that preferentially.
__emulates__r   r   r   )r   r  r  r   r-   r9   r5  r.   )r  r  isas   && r4   duck_type_collectionr    s     x((  ,!!32
 2
 J((("8T22*
C
8T	Xs		
	Xt		x""	5	!	!
	5	!	!r6   c               (    V ^8  d   QhRRRRRRRR/# )r?   r  r   argtypez'Union[Tuple[Type[Any], ...], Type[Any]]r   rY   r@   rB   )r1   s   "r4   r*   r*     s,      	>FIr6   c           
     0   \        W4      '       d   V # \        V\        4      '       dC   \        P                  ! R V: RRP	                  R V 4       4      : R\        V 4      : R24      h\        P                  ! R V: RV: R\        V 4      : R24      h)z
Argument 'z ' is expected to be one of type z or c              3  4   "   T F  pR V,          x  K  	  R# 5i)z'%s'NrB   )r   r:  s   & r4   r   "assert_arg_type.<locals>.<genexpr>  s     $AAVaZZs   z, got ''z' is expected to be of type 'z', got ')r-   r   r   ArgumentErrorr   r9   )r  r  r   s   &&&r4   assert_arg_typer    sy     #
gu%%##$A$AA49N 
 ##$s)- r6   c           	       a a \        S R4      '       d   \        S P                  4       4      # \        S R\        S RR4      4      oSf   \	        RS ,          4      h\        S R4      '       d   V V3R lpV! 4       # \        S R4      '       d$   \        V3R	 lS P                  4        4       4      # \	        RS ,          4      h)
z?Return a (key, value) iterator for almost any dict-like object.r  __getitem__rU   NzObject '%r' is not dict-likeiterkeysc               3  b   <"   SP                  4        F  p Sf   Q hV S! V 4      3x  K  	  R # 5irP   )r  )r  dictlikegetters    r4   iterator$dictlike_iteritems.<locals>.iterator1  s4     ((*)))6#;&& +s   ,/r  c              3  6   <"   T F  qS! V4      3x  K  	  R # 5irP   rB   )r   r  r  s   & r4   r   %dictlike_iteritems.<locals>.<genexpr>8  s     B/3&+&/s   )r   r5  r  r,   rF   iterr  )r  r  r  s   f @r4   r  r  %  s     x!!HNN$%%X}ght.LMF~6ABBx$$	'
 z	6	"	"B(--/BBB6ABBr6   c                  N   a  ] tR tRt$ RtR]R&   R V 3R lltR
R R lltR	tV ;t	# )classpropertyi=  a)  A decorator that behaves like @property except that operates
on classes rather than instances.

The decorator is currently special when using the declarative
module, but note that the
:class:`~.sqlalchemy.ext.declarative.declared_attr`
decorator should be used for this purpose with declarative.

Callable[[Any], Any]r  c               $    V ^8  d   QhRRRRRR/# )r?   r  r  r  r   r  rB   )r1   s   "r4   r*   classproperty.__annotate__J  s"     $ $1 $ $C $r6   c                	R   < \         SV `  ! V.VO5/ VB  VP                  V n        R # rP   )superr  r~   )rl   r  r  r  r   s   &&*,r4   r  classproperty.__init__J  s%    **r*||r6   c               $    V ^8  d   QhRRRRRR/# )r?   r0   r   r   zOptional[type]r@   rB   )r1   s   "r4   r*   r  N  s!      3 ^ s r6   c                	$    V P                  V4      # rP   r(  r  s   &&&r4   r  classproperty.__get__N  s    yy~r6   )r~   rP   )
rz   r{   r|   r}   r~   r7   r  r  r   __classcell__r   s   @r4   r  r  =  s$     $ $ r6   r  c                  :    ] tR tRtR R ltR R ltR R ltRtR	# )
hybridpropertyiR  c                   V ^8  d   QhRR/# r?   rP  rU  rB   )r1   s   "r4   r*   hybridproperty.__annotate__S        . r6   c                	    Wn         Wn        R # rP   )rP  clslevelrl   rP  s   &&r4   r  hybridproperty.__init__S  s    	r6   c               $    V ^8  d   QhRRRRRR/# r?   r  r   r+   r@   r   rB   )r1   s   "r4   r*   r  W  !     ' ' 'C 'B 'r6   c                	R    Vf   V P                  V4      pV# V P                  V4      # rP   r  rP  rl   r  r+   clsvals   &&& r4   r  hybridproperty.__get__W  *    ]]5)FM99X&&r6   c                    V ^8  d   QhRRRR/# )r?   rP  r   r@   zhybridproperty[_T]rB   )r1   s   "r4   r*   r  ^  s      1 6H r6   c                	    Wn         V # rP   r  r  s   &&r4   
classlevelhybridproperty.classlevel^      r6   r  N)rz   r{   r|   r}   r  r  r  r   rB   r6   r4   r  r  R  s    ' r6   r  c                  R    ] tR tRtR R ltR R ltR R ltR R	 ltR
 R ltRt	R# )rw_hybridpropertyic  c                   V ^8  d   QhRR/# r  rB   )r1   s   "r4   r*   rw_hybridproperty.__annotate__d  s     8 8. 8r6   c                	,    Wn         Wn        R V n        R # rP   )rP  r  setfnr  s   &&r4   r  rw_hybridproperty.__init__d  s    	37
r6   c               $    V ^8  d   QhRRRRRR/# r  rB   )r1   s   "r4   r*   r  i  r  r6   c                	R    Vf   V P                  V4      pV# V P                  V4      # rP   r  r  s   &&& r4   r  rw_hybridproperty.__get__i  r  r6   c               $    V ^8  d   QhRRRRRR/# r  rB   )r1   s   "r4   r*   r  p  s!     $ $ $C $D $r6   c                	H    V P                   f   Q hV P                  W4       R # rP   r  r  s   &&&r4   r  rw_hybridproperty.__set__p  s    zz%%%

8#r6   c                    V ^8  d   QhRRRR/# r?   rP  r   r@   zrw_hybridproperty[_T]rB   )r1   s   "r4   r*   r  t  s      - 2G r6   c                	    Wn         V # rP   r  r  s   &&r4   setterrw_hybridproperty.settert  s    
r6   c                    V ^8  d   QhRRRR/# r  rB   )r1   s   "r4   r*   r  x  s      1 6K r6   c                	    Wn         V # rP   r  r  s   &&r4   r  rw_hybridproperty.classlevelx  r  r6   )r  rP  r  N)
rz   r{   r|   r}   r  r  r  r  r  r   rB   r6   r4   r  r  c  s     8
'$ r6   r  c                  >    ] tR tRtRtR R ltR R ltR R ltR	tR
# )hybridmethodi}  z/Decorate a function as cls- or instance- level.c                   V ^8  d   QhRR/# r  rB   )r1   s   "r4   r*   hybridmethod.__annotate__  r  r6   c                	.    V;V n         V n        Wn        R # rP   )rP  rX  r  r  s   &&r4   r  hybridmethod.__init__  s    $((	DMr6   c               $    V ^8  d   QhRRRRRR/# )r?   r  r   r+   r@   rU  rB   )r1   s   "r4   r*   r    s"     6 6 6C 64E 6r6   c                	    Vf&   V P                   P                  W"P                  4      # V P                  P                  W4      # rP   )r  r  r   rP  )rl   r  r+   s   &&&r4   r  hybridmethod.__get__  s6    ==((@@99$$X55r6   c                    V ^8  d   QhRRRR/# )r?   rP  r   r@   zhybridmethod[_T]rB   )r1   s   "r4   r*   r    s      1 6F r6   c                	    Wn         V # rP   r  r  s   &&r4   r  hybridmethod.classlevel  r  r6   )rX  r  rP  N)	rz   r{   r|   r}   r~   r  r  r  r   rB   r6   r4   r  r  }  s    96 r6   r  c                  x    ] tR tRt$ RtR]R&   / tR]R&   ]P                  ! 4       t	RR R	 llt
R
 tR tR tRtR# )symboli  a)  A constant symbol.

>>> symbol("foo") is symbol("foo")
True
>>> symbol("foo")
<symbol 'foo>

A slight refinement of the MAGICCOOKIE=object() pattern.  The primary
advantage of symbol() is its repr().  They are also singletons.

Repeated calls of symbol('name') will all return the same instance.

rY   r   zDict[str, symbol]symbolsNc               (    V ^8  d   QhRRRRRRRR/# )	r?   r   rY   r  r   	canonicalr  r@   r  rB   )r1   s   "r4   r*   symbol.__annotate__  s2        !	
 
r6   c                	   V P                   ;_uu_ 4        V P                  P                  V4      pVfe   \        V\        4      '       g   Q hVf   \        V4      p\        P                  \        V4      pWn	        V'       d   W$n
        W@P                  V&   M V'       d   W48w  d   \        RV: RV 24      hVuuR R R 4       #   + '       g   i     R # ; i)Nz#Can't replace canonical symbol for z with new int value )_lockr  rU   r-   rY   hashr   __new__r  r   r~   rF   )r   r   r  r  r   s   &&&& r4   r!  symbol.__new__  s     YYY++//$'C{!$,,,,$ $T
Ikk&)4"%K %(D!!1#=dX F..7[:  - YYYs   BC!CC	c                	>    \         V P                  R \        V 4      33# rh  )r  r   r   rk   s   &r4   
__reduce__symbol.__reduce__  s    		3D	222r6   c                	    \        V 4      # rP   )r   rk   s   &r4   __str__symbol.__str__  s    Dzr6   c                	$    R V P                   : R2# )zsymbol(r  )r   rk   s   &r4   __repr__symbol.__repr__  s    Q''r6   rB   )NN)rz   r{   r|   r}   r~   r7   r  r  r  r  r!  r$  r'  r*  r   rB   r6   r4   r  r    s9     I!#G#NNE<3(r6   r  c                  .    ] tR tRtR R ltR R ltRtR# )_IntFlagMetai  c          
     ,    V ^8  d   QhRRRRRRRRR	R
/# )r?   	classnamerY   r   zTuple[Type[Any], ...]dict_r  r  r   r@   rf   rB   )r1   s   "r4   r*   _IntFlagMeta.__annotate__  s<     
 

 %
 	

 
 

r6   c                	   . ;V n         pVP                  4        F  w  rg\        P                  ! R V4      '       d   K$  \	        V\
        4      '       d   \        WgR7      pM$VP                  R4      '       g   \        R4      hKk  \        WV4       VP                  V4       K  	  \        P                  ! V Uu/ uF  qP                  VbK  	  up4      V n        R# u upi )z^__.*__$)r  r  z#Expected integer values for IntFlagN)_itemsr  r   matchr-   r   r  r  rF   r  r   r   immutabledictr   __members__)	r   r/  r   r0  r  r  r  vr   s	   &&&&,    r4   r  _IntFlagMeta.__init__  s      
UKKMDAxxQ''!S!!Q,\\#&& EFFCC LL " '44&+,esXXs]e,
,s   :Cc                   V ^8  d   QhRR/# )r?   r@   zIterator[symbol]rB   )r1   s   "r4   r*   r1    s     
 
* 
r6   c                	    \        R 4      h)ziter not implemented to ensure compatibility with Python 3.11 IntFlag.  Please use __members__.  See https://github.com/python/cpython/issues/99304r
  rk   s   &r4   __iter___IntFlagMeta.__iter__  s    !=
 	
r6   rB   N)rz   r{   r|   r}   r  r;  r   rB   r6   r4   r-  r-    s    
2
 
r6   r-  c                      ] tR tRtRtRtR# )_FastIntFlagi  zAn 'IntFlag' copycat that isn't slow when performing bitwise
operations.

the ``FastIntFlag`` class will return ``enum.IntFlag`` under TYPE_CHECKING
and ``_FastIntFlag`` otherwise.

rB   Nr  rB   r6   r4   r>  r>    s    r6   r>  )	metaclass)IntFlag_Ec          
     ,    V ^8  d   QhRRRRRRRRR	R
/# )r?   r  r   choiceszDict[_E, List[Any]]r   rY   resolve_symbol_namesr   r@   zOptional[_E]rB   )r1   s   "r4   r*   r*     sA     D D	D D D 	D
 Dr6   c                    VP                  4        F4  w  rEWJ d   Vu # V'       d   WP                  8X  d   Vu # W9   g   K2  Vu # 	  V f   R# \        P                  ! RV RV : 24      h)a'  Given a user parameter, parse the parameter into a chosen value
from a list of choice objects, typically Enum values.

The user argument can be a string name that matches the name of a
symbol, or the symbol object itself, or any number of alternate choices
such as True/False/ None etc.

:param arg: the user argument.
:param choices: dictionary of enum values to lists of possible
    entries for each.
:param name: name of the argument.   Used in an :class:`.ArgumentError`
    that is raised if the parameter doesn't match any available argument.

NzInvalid value for 'z': )r  r   r   r  )r  rC  r   rD  
enum_valuechoices   &&&&  r4   parse_user_argument_for_enumrH    si    ( &mmo
!c__&<] . {


1$s3'B
CCr6   c                    V ^8  d   QhRRRR/# r  rB   )r1   s   "r4   r*   r*   '  s     
 
 
 
r6   c                6    \         V n         \         ^,          s R# )zAssign a '_creation_order' sequence to the given instance.

This allows multiple instances to be sorted in order of creation
(typically within a single thread; the counter is not particularly
threadsafe).

N)_creation_order)r  s   &r4   set_creation_orderrL  '  s      /HqOr6   c               (    V ^8  d   QhRRRRRRRR/# )r?   rP  r   r\  r   r  r@   rB   )r1   s   "r4   r*   r*   4  s)     7 7+ 7C 73 73 7r6   c                     V ! V/ VB #   \          d1    \        R\        P                  ! 4       R,          ,          4        R# i ; i)zPexecutes the given function, catches all exceptions and converts to
a warning.

z%s('%s') ignored:    r?   NN)rD   warnri   rj   )rP  r\  r  s   &*,r4   warn_exceptionrQ  4  s?    
7T$V$$ 7#,,."5567s   
 7AAc                f     \        V 4      V8  d   R V ^ V ,          # V #   \         d    T u # i ; i)z%s...)r   rF   )rq   len_s   &&r4   ellipses_stringrT  ?  s=    u:U1T]**L s       00c                  V   a  ] tR tRt$ RtR]R&   R V 3R lltR R ltR	 R
 ltRt	V ;t
# )_hash_limit_stringiI  a  A string subclass that can only be hashed on a maximum amount
of unique values.

This is used for warnings so that we can send out parameterized warnings
without the __warningregistry__ of the module,  or the non-overridable
"once" registry within warnings.py, overloading memory,


r   _hashc               (    V ^8  d   QhRRRRRRRR/# )	r?   rq   rY   numr   r\  Sequence[Any]r@   rV  rB   )r1   s   "r4   r*   _hash_limit_string.__annotate__V  s,      !)6	r6   c                	   < W,          R V,          ,           p\         SV `  W4      p\        RV\        V4      V,          3,          4      Vn        V# )z6 (this warning may be suppressed after %d occurrences)z%s_%d)r  r!  r   rW  )r   rq   rY  r\  interpolatedrl   r   s   &&&&  r4   r!  _hash_limit_string.__new__V  sN     DsJ
 ws1'UD,>,D$EEF
r6   c                   V ^8  d   QhRR/# )r?   r@   r   rB   )r1   s   "r4   r*   r[  `  s      # r6   c                	    V P                   # rP   rW  rk   s   &r4   __hash___hash_limit_string.__hash__`  s    zzr6   c                    V ^8  d   QhRRRR/# )r?   otherr   r@   r   rB   )r1   s   "r4   r*   r[  c  s     ) )C )D )r6   c                	0    \        V 4      \        V4      8H  # rP   )r   )rl   re  s   &&r4   __eq___hash_limit_string.__eq__c  s    DzT%[((r6   ra  )rz   r{   r|   r}   r~   r7   r!  rb  rg  r   r  r  s   @r4   rV  rV  I  s(     J ) )r6   rV  c               $    V ^8  d   QhRRRRRR/# )r?   msgrY   r   r   r@   rf   rB   )r1   s   "r4   r*   r*   g  s!     
+ 
+c 
+ 
+$ 
+r6   c                    V'       d#   \        \        P                  ! WR7      4       R# \        V \        P                  4       R# )zXIssue a warning.

If msg is a string, :class:`.exc.SAWarning` is used as
the category.

)r   N)_warnings_warnr   	SAWarning)rj  r   s   &&r4   rP  rP  g  s&     s}}S45sCMM*r6   c               $    V ^8  d   QhRRRRRR/# )r?   rj  rY   r\  rZ  r@   rf   rB   )r1   s   "r4   r*   r*   t  s!     ' 'c ' '4 'r6   c                d    V'       d   \        V ^
V4      p \        V \        P                  4       R# )zTIssue a warning with a parameterized string, limiting the number
of registrations.

N)rV  rl  r   rm  )rj  r\  s   &&r4   warn_limitedrp  t  s#    
  b$/3&r6   z)Dict[CodeType, Tuple[str, Type[Warning]]]_warning_tagsc               $    V ^8  d   QhRRRRRR/# )r?   messagerY   categoryzType[Warning]r@   Callable[[_F], _F]rB   )r1   s   "r4   r*   r*     s$      )r6   c                   a a VV 3R  lpV# )c                2   < SS3\         V P                  &   V # rP   )rq  r3  )r   rt  rs  s   &r4   go#tag_method_for_warnings.<locals>.go  s    &-x%8bkk"	r6   rB   )rs  rt  rx  s   ff r4   tag_method_for_warningsrz    s     Ir6   z&^(?:sqlalchemy\.(?!testing)|alembic\.)c               (    V ^8  d   QhRRRRRRRR/# )	r?   rs  zUnion[str, Warning]rt  zOptional[Type[Warning]]
stacklevelr   r@   rf   rB   )r1   s   "r4   r*   r*     s0     0: 0: 0:%0: 0: 
	0:r6   c                r    \         P                  ! V4      pR ;rEVe   V'       g>   \        P                  ! \        VP
                  P                  RR4      4      '       g   RpVP                  \        9   d0   Rp\        VP                  ,          w  rgT;'       g    TpV  RV R2p VP                  pV'       g   V^,          pK  V'       g   K  V'       g   K  M Ve"   \        P                  ! WV^,           R7       R# \        P                  ! W^,           R7       R#   \         d    ^ p LT ^ p LY; i)FNrz   r   Tz (r  )r|  )ri   	_getframer   r4  _not_sa_pattern	f_globalsrU   f_coderq  f_backr/   warningsrP  )rs  rt  r|  framestacklevel_foundwarning_tag_found_suffix	_categorys   &&&     r4   rl  rl    s   %j) 054 $BHH!4!4Z!D- -
 $( 
 ||},$(!'4U\\'B$#00y$IRy2LLE#a
!!&7&73  6 gJNCgq.9Q   
 
s   D" "D61D6c               $    V ^8  d   QhRRRRRR/# )r?   r   rU  retry_on_exceptionr   r@   zCallable[..., Optional[_T]]rB   )r1   s   "r4   r*   r*     s$      /3 r6   c                (   a aa S .oR V VV3R llpV# )zJDecorate the given function to be a no-op after it is called exactly
once.c               $    V ^8  d   QhRRRRRR/# )r?   r  r   r  r@   zOptional[_T]rB   )r1   s   "r4   r*   only_once.<locals>.__annotate__  s!       C L r6   c                    < SpS'       d   SP                  4       p V! V / VB # R#    S'       d   SP                  ^ T4       h ; i)rO  N)r   insert)r  r  	strong_fnonce_fnr   oncer  s   *,  r4   rx  only_once.<locals>.go  sM     	hhjG*r** %KK7+s	   ' ArB   )r   r  rx  r  s   ff @r4   	only_oncer    s     4D  Ir6   z%sqlalchemy/([a-z_]+/){0,2}[a-z_]+\.pyzunit(?:2|test2?/)c               (    V ^8  d   QhRRRRRRRR/# )r?   tbrQ  exclude_prefixzre.Pattern[str]exclude_suffixr@   rB   )r1   s   "r4   r*   r*     s0      # $ 	r6   c                    ^ p\        V 4      ^,
          pW48:  d)   VP                  W,          4      '       d   V^,          pK.  W48:  d)   VP                  W,          4      '       d   V^,          pK.  WV^,            # )aT  Chop extraneous lines off beginning and end of a traceback.

:param tb:
  a list of traceback lines as returned by ``traceback.format_stack()``

:param exclude_prefix:
  a regular expression object matching lines to skip at beginning of
  ``tb``

:param exclude_suffix:
  a regular expression object matching lines to skip at end of ``tb``
)r   search)r  r  r  r   ends   &&&  r4   chop_tracebackr    se    " E
b'A+C
,>00;;

,>0099qcAgr6   c                l    R V ,          p\        4       P                  4       p\        W4       VR,          # )z&def set(obj, value):    obj.%s = valuer   )r  copyr  )attrnamer   r   s   &  r4   
attrsetterr    s*    3h>D
(--/COu:r6   z^__.+__$c                  6   a  ] tR tRtRtRtR V 3R lltRtV ;t# )
TypingOnlyi  zA mixin class that marks a class as 'typing only', meaning it has
absolutely no methods, attributes, or runtime functionality whatsoever.

c                   V ^8  d   QhRR/# re   rB   )r1   s   "r4   r*   TypingOnly.__annotate__  s     
$ 
$$ 
$r6   c                	   < \         V P                  9   dS   V P                   Uu0 uF"  p\        P	                  V4      '       d   K   VkK$  	  ppV'       d   \        R V  RV R24      h\        SV `  4        R# u upi )zClass z< directly inherits TypingOnly but has additional attributes r#  N)r  rH  rT   _dundersr4  AssertionErrorr  __init_subclass__)r   r   	remainingr   s   &  r4   r  TypingOnly.__init_subclass__  sx    &!$!-X^^D5I   $SE "--6Kq:  	!#s   A9A9rB   )	rz   r{   r|   r}   r~   r   r  r   r  r  s   @r4   r  r    s    
 I
$ 
$r6   r  c                  V   a  ] tR tRt$ RtR]R&    R V 3R llt]R R l4       tR	t	V ;t
# )
EnsureKWArgi  a"  Apply translation of functions to accept \**kw arguments if they
don't already.

Used to ensure cross-compatibility with third party legacy code, for things
like compiler visit methods that need to accept ``**kw`` arguments,
but may have been copied from old code that didn't accept them.

rY   ensure_kwargc                   V ^8  d   QhRR/# re   rB   )r1   s   "r4   r*   EnsureKWArg.__annotate__.  s     $ $$ $r6   c                	T  < V P                   pV P                  pV'       dy   V Fr  p\        P                  ! W4      pV'       g   K#  W#,          p\        P
                  ! V4      pVP                  '       d   KU  V P                  V4      p\        WV4       Kt  	  \        SV `)  4        R # rP   )r  rT   r   r4  r   r   r^  
_wrap_w_kwr  r  r  )	r   fn_regclsdictr  r_   r   r   wrappedr   s	   &       r4   r  EnsureKWArg.__init_subclass__.  s|    !!,,HHV)1 B!88<D:::"%.."4'2  	!#r6   c                    V ^8  d   QhRRRR/# )r?   r   r   r@   rB   )r1   s   "r4   r*   r  =  s     ( (. (3E (r6   c                	.   a R  V3R llp\        VS4      # )c               $    V ^8  d   QhRRRRRR/# )r?   r  r   r  r@   rB   )r1   s   "r4   r*   ,EnsureKWArg._wrap_w_kw.<locals>.__annotate__>  s!     	 	s 	# 	# 	r6   c                    < S! V !  # rP   rB   )r  r  r   s   *,r4   wrap$EnsureKWArg._wrap_w_kw.<locals>.wrap>  s    s8Or6   r   )r   r   r  s   &f r4   r  EnsureKWArg._wrap_w_kw<  s    	 	 dB''r6   rB   )rz   r{   r|   r}   r~   r7   r  r$  r  r   r  r  s   @r4   r  r    s3     $ $ ( (r6   r  c                   \        VR4      '       d   \        W4      # T pVP                  P                  Vn        \        VR4      '       d   VP                  Vn        \        VP
                  R4      '       d:   VP
                  P                  '       d   VP
                  P                  Vn        V# VP                  '       d   VP                  Vn        V# )zAugment functools.update_wrapper() to work with objects with
a ``__call__()`` method.

:param fn:
  object with __call__ method

rz   r{   r~   )r   r   r   rz   r{   rY  r~   )wrapperr   _fs   && r4   wrap_callabler  D  s     r:g**ll++2|$$MMBM2;;	**r{{/B/B/B,,BJ 	 ZZZBJ	r6   c                   RV 9  d   V P                  R4      # ^ p. .p^ p\        V 4      pW48  d   W,          pVR8X  dU   V^8X  dD   W4^,
          8  d7   W^,           ,          R8X  d#   VR,          P                  R4       V^,          pMBV^,          pM8VR8X  d   V^ 8X  d   VP                  . 4       MVR,          P                  V4       V^,          pK  V Uu. uF  pRP                  V4      NK  	  up# u upi )a  Parse a dotted identifier with accommodation for quoted names.

Includes support for SQL-style double quotes as a literal character.

E.g.::

    >>> quoted_token_parser("name")
    ["name"]
    >>> quoted_token_parser("schema.name")
    ["schema", "name"]
    >>> quoted_token_parser('"Schema"."Name"')
    ['Schema', 'Name']
    >>> quoted_token_parser('"Schema"."Name""Foo"')
    ['Schema', 'Name""Foo']

"r#  r   rr  )r&  r   r   r   )rq   r  r.  idxlvcharr(  s   &      r4   quoted_token_parserr  \  s    $ %{{3 E!dF
C	UB
(z3;zcFlu1W~/Dr
!!#&q
S[UaZMM"2Jd#q(./uBGGEN///s   C8c               $    V ^8  d   QhRRRRRR/# )r?   paramsr   r  rY   r@   ru  rB   )r1   s   "r4   r*   r*     s"     
 
s 
# 
2D 
r6   c                D   a a \         P                  ! S 4      o V V3R  lpV# )c                   < V P                   R J;'       d    V P                   ;'       g    RpV'       d   \        TS Uu/ uF  q"SbK  	  up4      pWn         V # u upi )Nr   )r~   inject_param_text)r   r  paramr  r  s   &  r4   r   $add_parameter_text.<locals>.decorate  sU    jj$3399r#C6)J6%+6)JKC
	 *Ks    A
)r   r  )r  r  r   s   ff r4   add_parameter_textr    s    !!&)F Or6   c                    V ^8  d   QhRRRR/# )r?   r  rY   r@   rB   )r1   s   "r4   r*   r*     s     	% 	%C 	%C 	%r6   c                    V P                  R ^4      p\        V4      ^8X  d   V # Vw  r#VP                  R4      '       g%   VR ,           \        P                  ! V4      ,           # \        P                  ! V 4      # )
r   )r&  r   r  textwrapdedent)r  
split_text	firstliner  s   &   r4   _dedent_docstringr    sd    D!$J
:!)	$$4(//)"<<<t$$r6   c               (    V ^8  d   QhRRRRRRRR/# )r?   given_doctextr   
injecttextrY   posr   r@   rB   )r1   s   "r4   r*   r*     s,       .18;r6   c                J   \        T ;'       g    R 4      pVP                  R4      p\        V4      ^8X  d   VP                  R 4       \        P
                  ! V4      P                  R4      pV^ ,          '       d   VP                  ^ R 4       \        V4       UUu. uF  w  rgVP                  4       '       d   K  VNK!  	  pppVP                  ^ ^ 4       V\        V\        V4      ^,
          4      ,          p	V^ V	 V,           WIR ,           pRP                  V4      # u uppi )r   r  N)r  r&  r   r   r  r  r  r  r  minr   )
r  r  r  doctextlinesinjectlinesrY  lineblanks
inject_poss
   &&&       r4   inject_docstring_textr    s     %]%8%8b9GMM$E
5zQR//*-33D9K1~~1b!#,U#3H#3ic4::<cc#3FH
MM!QCVq12J!J+-k0BBE99U Is   D;Dz(\s+):param (.+?):c               $    V ^8  d   QhRRRRRR/# )r?   r  rY   inject_paramszDict[str, str]r@   rB   )r1   s   "r4   r*   r*     s!     ( (s (> (c (r6   c                t   \         P                  ! V P                  4       4      p. pR pV'       Edx   VP                  4       p\        P                  V4      pVf   V'       d   VP                  ^4      P                  R4      pWq9   d   R\        VP                  ^4      4      ,          R,           pV'       dH   \        P
                  ! RV^ ,          4      p	V	'       d"   R\        V	P                  ^4      4      ,          pWV,          ,           pMV'       d   VP                  RVR.4       R pMfVP                  4       '       g   VP                  WTR.4       R pM:VP                  R4      '       d$   VP                  WRP                  4       .4       EKl  VP                  V4       EK  RP                  V4      # )N*r   z(\s+)\Sr  z::)collectionsdeque
splitlinespopleft
_param_regr4  r  lstripr   r   r   rstripr  r   r   )
r  r  doclinesr  	to_injectr  r_   r  indentm2s
   &&        r4   r  r    sP     !3!3!56HE I
(!T"
))#.) 3qwwqz?2S8F  XXj(1+>%(3rxx{+;%;F &u)= =ILL$	401ILL$401I]]4   LL$ 0 0 234T99Ur6   c                    V ^8  d   QhRRRR/# )r?   r   rQ  r@   r   rB   )r1   s   "r4   r*   r*     s     > >I >- >r6   c                t   \        V 4      ^ 8X  d   R# \        V 4      ^8*  pV'       d
   V R,          MV R,          V RR ,           p V  Uu. uF%  p\        V4      ^8  d   RVR,          ,          MTNK'  	  ppV'       d   RP                  V4      # RP                  VR,          4      : RVR,          : 2# u upi )	zTrims a list of strings from the middle and return a string of up to
four elements. Strings greater than 11 characters will be truncatedN:rO     N:rO  r   Nz%s..:N   Nr  z, ..., rr  )r   r   )r   flagr   ress   &   r4   repr_tuple_namesr    s     5zQu:?DE#JE#Jrs$;EFK
LedTR6DIT9eC
Lyy~ $		#c( 3SW==	 Ms   	+B5c                H    \         '       d   R # V '       d   \        R4      hR# )TzDcython extensions were expected to be installed, but are not presentF)r   ImportError)raise_s   &r4   has_compiled_extr    s$    	"
 	

 r6   c                  8    ] tR tRt]P
                  ! 4       tRtR# )_Missingi  rB   N)rz   r{   r|   r}   enumautoMissingr   rB   r6   r4   r   r     s    iikGr6   r   rP   )FF)T)rB   rB   rB   rB   )rB   NrB   )NNz
self.proxyN)NNN)TN)F)   )Nr?   )__conditional_annotations__r~   
__future__r   r  r  	functoolsr   rQ   r   r  r   ri   r  r  r   r   typingr   r   r   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r   r   r   _has_cyr   r   r   r   r   r!   r#   r$   r%   r&   py314annotationlibr'   r(   r5   r9   rT   r  r:   r=   rG   rM   py310r`   rb   r   r   r   r   r   r   r   r   r  r   r  r  r	  r;  rB  rS  rb  r   r{  r  r  r  r  r  r  r  r  r  r  r  r  r&  r+  rk  non_memoized_propertypropertyro_memoized_propertyro_non_memoized_propertyr@  rB  !HasMemoized_ro_memoized_attributer`  rm  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r  r-  r>  r@  FastIntFlagEnumrA  rH  rK  rL  rQ  rT  rY   rV  rP  rp  rq  r7   rz  compiler  rl  r  _SQLA_RE_UNITTEST_REr  NoneTyper  r  r  r  r  r  r  r  r  r  r  r  r  r   r  	MissingOr)r  s   @r4   <module>r     s   #   $    	 
                            $  T]4(T#s(+,e34e@Ae01e./ 
<<< 5$ !MM*;<DD$BH \\\,
2"$82 82v6O,$M  e/0
Y,x enen( (V
( 
  $ "	 
 
-1DI 

2-12DI2j25;pr
jB26(	KB\; ;<#L @/FSl v9:($GEN ($V"259 ""%.u5 %<  .1
 $' 0BA,7MM4'.J+ J+Z (0%(3(F(F%-/ -/b	'4 F$C0H *WR[ " 472; $9(S 9(x
4 
D\  KK T#DD 
7) )<
+' <>8 = **FG0:f4 ::>?zz./
 '3&.4 : ::j!$ $*&( &(R0)0X
	%( ZZ-.
(V>	tyy  

"gh..//0	r6   