+
    Xj                    2	  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$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      t/]"! R%R&R"7      t0]"! R'R(R"7      t1]"! R)R*R"7      t2R+ R, lt3 ! R- R.4      t4R/ R0 lt5R1 R2 lt6RR3 R4 llt7R5 R6 lt8R7 R8 lt9R9 R: lt:R; R< lt;]"! R=R>R"7      t<R? R@ lt=RA RB lt>]"! RC4      t?]"! RD4      t@ ! RE RF4      tARG tB]RHRRIR!/RJ RK ll4       tC]RHRRIRL/RM RN ll4       tCRHRRIRL/RO RP lltCRQ RR ltDRRS RT lltERRU RV lltFRRW ltGRRX RY lltHRZ tIR[ tJRR\ R] lltK ! R^ R_4      tLR` tMRa tNRRb ltORc tPRRd ltQ]"! ReRfR"7      tR ! Rg Rh]]-,          4      tS ! Ri Rj]S]-,          4      tT ! Rk Rl]S]-,          4      tU]!'       d
   ]StV]StW]XtY]XtZM]U;tVtY]T;tWtZRm Rn lt[ ! Ro Rp4      t\]!'       d   ]Xt]M]\P                  t] ! Rq Rr4      t_Rs Rt lt`Ru Rv ltaRw Rx ltbRRy Rz lltcR{ R| ltdR} R~ lteR R ltfRR R lltgR R lthR ti ! R R]X4      tj ! R R]],,          4      tk ! R R]],,          4      tl ! R R]],,          4      tm ! R R]n4      to ! R R]p4      tq ! R R]qR7      tr]!'       d
   ^ RIHsts ]sttM]rtt]"! R]P                  R"7      tvRR R lltw^sxR R ltyR R ltzRR lt{ ! R R]|4      t}RR R llt~R 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]p! 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]P                  4      t]EP2                  t]#],]*]EP2                  ,          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)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]c                    V ^8  d   QhRRRR/# )   xr   returnstr )formats   "w   /Users/wind/Downloads/Coruna-main学习资料A/backend/venv/lib/python3.14/site-packages/sqlalchemy/util/langhelpers.py__annotate__r.   ?   s     $ $s $s $    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   r*   	hexdigest)r(   ms   & r-   md5_hexr6   ?   s<    	A##%AHHQKQ[[]##r/   c                  B    ] tR t^Ft$ 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)   Noner+   )r,   s   "r-   r.   safe_reraise.__annotate__k   s     ( (4 (r/   c                	:    \         P                  ! 4       V n        R # N)sysexc_infor9   selfs   &r-   	__enter__safe_reraise.__enter__k   s    r/   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   r+   )r,   s   "r-   r.   r=   n   s2     2 2,2 '2 1	2
 
2r/   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r?   )r9   with_traceback)rC   rG   rH   rI   exc_type	exc_valueexc_tbs   &&&&   r-   __exit__safe_reraise.__exit__n   so     ~~)))=*...'H(((!DN**622!DN$$$&&y11r/   )r9   N)
__name__
__module____qualname____firstlineno____doc__	__slots____annotations__rD   rO   __static_attributes__r+   r/   r-   r8   r8   F   s'    0 I (2 2r/   r8   c                    V ^8  d   QhRRRR/# )r'   clsType[_T]r)   zIterator[Type[_T]]r+   )r,   s   "r-   r.   r.      s       &8 r/   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r?   )setpopaddextend__subclasses__)rZ   seenstacks   &  r-   walk_subclassesrd      sS     UDEE
iik;HHSMS'')*	 s   A(AA(c                    V ^8  d   QhRRRR/# )r'   elementr   r)   r*   r+   )r,   s   "r-   r.   r.      s     6 63 63 6r/   c                ~    \        V \        4      '       d   V #  \        V 4      #   \         d    R T ,          u # i ; i)zunprintable element %r)
isinstancer*   	Exception)rf   s   &r-   string_or_unprintablerj      s=    '3	6w< 	6+g55	6s   
% <<c               $    V ^8  d   QhRRRRRR/# )r'   rZ   	Type[Any]use_nameOptional[str]r)   r*   r+   )r,   s   "r-   r.   r.      s)     O O	O+OOr/   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r?   )lower).0ns   & r-   	<genexpr>(clsname_as_plain_name.<locals>.<genexpr>   s     N'M!GGII'Ms   z([A-Z][a-z]+|SQL))rQ   joinrefindall)rZ   rm   names   && r-   clsname_as_plain_namer{      s6     ##s||D88Nrzz2F'MNNNr/   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)   boolr+   )r,   s   "r-   r.   r.      s&     , ,-,&, 
,r/   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.)rh   type	__class__rQ   getattr)r}   r~   current_clsmethod_namecurrent_methods   &&   r-   method_is_overriddenr      s?     ot,,%//% ))K'.{'HN++r/   c                    V ^8  d   QhRRRR/# )r'   slcslicer)   Tuple[Any, ...]r+   )r,   s   "r-   r.   r.      s      e  r/   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   retr(   s   &  r-   decode_slicer      sU     CYY#((*1k""A

1 + :r/   c               $    V ^8  d   QhRRRRRR/# )r'   usedSequence[str]basesr*   r)   zIterator[str]r+   )r,   s   "r-   r.   r.      s&     M M- M M Mr/   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      ,           # r?   r*   )ibases   &r-   <lambda>!_unique_symbols.<locals>.<lambda>   s    $Q-r/   i  z&exhausted namespace for symbol base %sN)r]   	itertoolschainmapranger_   	NameError)r   r   used_setpoolsymr   s   &*   @r-   _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]rt   intr)   zIterator[Any]r+   )r,   s   "r-   r.   r.      s"      % # - r/   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.Nr+   )r   rt   bs   && r-   map_bitsr      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]r+   )r,   s   "r-   r.   r.      s      S, S,( S,-A S,r/   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)   r+   )r,   s   "r-   r.   decorator.<locals>.__annotate__   s     N- N-S N-S N-r/   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groupedrz   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)
rQ   r?   r+   )inspect
isfunctionismethodri   r   r.   r   inspect_getfullargspeclenr   dictfromkeysr   _replacer   r   rQ   r   r3   format_argspec_plusiscoroutinefunctionreprrR   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   &           r-   decoratedecorator.<locals>.decorate   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=  D
 D v
 d5
	 "$	#%#4#4	 i,,E #+s   I Ir   )r   r   s   f r-   	decoratorr      s    N- N-` (F++r/   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   r*   r)   r   r+   )r,   s   "r-   r.   r.   4  s,      
$+9DGr/   c                (    \        W4       W,          # r?   )exec)r   r   r   s   &&&r-   r   r   4  s     	O<r/   _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'   groupr*   auto_fnzOptional[Callable[..., Any]]r+   )r,   s   "r-   r.   PluginLoader.__annotate__@  s      #?r/   c                	,    Wn         / V n        W n        R # r?   )r   implsr   )rC   r   r   s   &&&r-   __init__PluginLoader.__init__@  s     
%'
r/   c                	:    V P                   P                  4        R # r?   )r   clearrB   s   &r-   r   PluginLoader.clearG  s    

r/   c                    V ^8  d   QhRRRR/# )r'   rz   r*   r)   r   r+   )r,   s   "r-   r.   r   J  s     
 
 
 
r/   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   rz   loadr   NoSuchModuleError)rC   rz   loaderimpls   &&  r-   r   PluginLoader.loadJ  s    ::::d#%%<<<\\$'F#)

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

4 yy{" >
 ##*.**d;
 	
r/   c               (    V ^8  d   QhRRRRRRRR/# )r'   rz   r*   
modulepathobjnamer)   r<   r+   )r,   s   "r-   r.   r   ]  s(        S  c  C  D  r/   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     r-   r   #PluginLoader.register.<locals>.load^  sA    Z(C#))#.r22c) 33((r/   Nr   )rC   rz   r   r   r   s   &&ff r-   registerPluginLoader.register]  s    	)  

4r/   c                    V ^8  d   QhRRRR/# )r'   rz   r*   r)   r<   r+   )r,   s   "r-   r.   r   f  s      s t r/   c                	     V P                   V R # r?   r  )rC   rz   s   &&r-   
deregisterPluginLoader.deregisterf  s    JJtr/   )r   r   r   r?   )
rQ   rR   rS   rT   r   r   r   r	  r  rX   r+   r/   r-   r   r   ?  s     
&  r/   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r?   )r   CO_VARKEYWORDS__code__co_argcountlistco_varnamesr   co_flagsAttributeErrorr   r   )r   co_varkeywordsconargsr   s   &    r-   _inspect_func_argsr  j  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'   rZ   r   r  Optional[Set[str]]r  zLiteral[True]r)   zSet[str]r+   )r,   s   "r-   r.   r.     s2      	  	
 r/   c                   R # r?   r+   rZ   r  r  s   &$$r-   get_cls_kwargsr!  ~  s     r/   Fc               (    V ^8  d   QhRRRRRRRR/# r'   rZ   r   r  r  r  r   r)   r+   )r,   s   "r-   r.   r.     s,      	*=Ar/   c                   R # r?   r+   r   s   &$$r-   r!  r!    s     r/   c               (    V ^8  d   QhRRRRRRRR/# r#  r+   )r,   s   "r-   r.   r.     s,     2 2	2*2=A22r/   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  rC   )r]   __dict__getrh   r   r   r  r   r  r3   	TypeError	__bases__r!  discard)	rZ   r  r  toplevelctrhas_initr   has_kwcs	   &$$      r-   r!  r!    s    " t|Hu
,,

:u
-C 	 	5 	5sE../	5 	5s||U^^4  *3/Eh %EF  vAa+3  	LLKr/   c                    V ^8  d   QhRRRR/# )r'   funcr   r)   	List[str]r+   )r,   s   "r-   r.   r.     s     2 2, 2 2r/   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   )r2  s   &r-   get_func_kwargsr5    s     ((.q11r/   c               (    V ^8  d   QhRRRRRRRR/# )r'   r   r   no_selfr   _is_initr)   zcompat.FullArgSpecr+   )r,   s   "r-   r.   r.     s,     9; 9;9;%)9;=A9;9;r/   c           	        \         P                  ! V 4      '       d   \        RV ,          4      h\         P                  ! V 4      '       gK   \	        V R4      '       d   \         P
                  ! V 4      '       g   \         P                  ! V 4      '       g   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  r  T)r7  r8  __func____call__)r7  zCan't inspect callable: %s)r   	isbuiltinr)  r   r   isclassr   r   r   FullArgSpecargsvarargsvarkwr   
kwonlyargsr   r   __self__r:  get_callable_argspecr   r;  )r   r7  r8  r   s   &&& r-   rD  rD    s    3b899			B		J##  $$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::r/   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]]r+   )r,   s   "r-   r.   r.   	  s)     r
 r
5r
@Dr
r
r/   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   r(   s   &r-   r   %format_argspec_plus.<locals>.<lambda>\  s    cCFlr/   )formatvaluec                &    R \        V 4      ,           # rH  r   rJ  s   &r-   r   rK  e  s    #A,r/   )grouped_argsself_arg	apply_posapply_kwapply_pos_proxiedapply_kw_proxiedr+   )	callabler   r   inspect_formatargspecr   r   r   r   r   )r   r   r   r?  rP  rO  rR  num_defaults	name_argsdefaulted_valsrQ  rS  s   &&          r-   r   r   	  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
 	
r/   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)rC   z()r   r   z(self, *args, **kwargs)zself, *args, **kwargsz(*args, **kwargs)z*args, **kwargs)rO  rN  rP  rQ  rR  rS  )objectr   r   r)  r   )methodr   rN  r?  proxieds   &&   r-   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_clsrl   target_cls_sphinx_namer*   proxy_cls_sphinx_nameclassmethodsr   methods
attributesuse_intermediate_variabler)   zCallable[[_T], _T]r+   )r,   s   "r-   r.   r.     sX         	
    - r/   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 # r?   r+   )rZ   s   &r-   r   &create_proxy_methods.<locals>.decorate  s    
r/   r+   )r`  ra  rb  rc  rd  re  rf  r   s   &&&&&&& r-   create_proxy_methodsrj    s    & Or/   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)

rC   Nr?  kwargs)r   r   r)  r[  r   )r\  s   &r-   getargspec_initrm    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.

)rh   r   
MethodTyperC  r:  )func_or_clss   &r-   unbound_method_to_callablerq    s4     +u//009M9M9M###r/   c          
     ,    V ^8  d   QhRRRRRRRRR	R
/# )r'   objr   additional_kwzSequence[Tuple[str, Any]]
to_inspectz%Optional[Union[object, List[object]]]
omit_kwargr   r)   r*   r+   )r,   s   "r-   r.   r.     sH     KB KB	KB,KB 6KB 	KB
 	KBr/   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r?   )r   r   )rs   argrs  s   & r-   ru   generic_repr.<locals>.<genexpr>  s"     D8C$wsC.//8s   #&rI  (, ))r   to_listr[  OrderedDict	enumerater   r   r   r   r   r@  r`   r?  r3   zipr)  r   r   r   itemsr   ri   r   rQ   rw   )rs  rt  ru  rv  missingpos_argskw_argsvargsr   inspr   default_lenry  defaultoutputvaldefvals   f&&&             r-   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   rz   rl  r  rB   s   &r-   __getstate__$portable_instancemethod.__getstate__.  s'    dkkDIIdkk
 	
r/   c                	l    VR ,          V n         VR,          V n        VP                  RR4      V n        R# )r   rz   rl  Nr+   )r   rz   r(  rl  )rC   states   &&r-   __setstate__$portable_instancemethod.__setstate__5  s*    Ho&M	ii"-r/   c                	V    VP                   V n        VP                  V n        W n        R # r?   )rC  r   rQ   rz   rl  )rC   methrl  s   &&&r-   r    portable_instancemethod.__init__:  s    mmMM	r/   c                	    VP                  V P                  4       \        V P                  V P                  4      ! V/ VB # r?   )r3   rl  r   r   rz   )rC   ry  kws   &*,r-   r;   portable_instancemethod.__call__?  s1    
		$++t{{DII.:r::r/   )rl  rz   r   N)r   rz   rl  __weakref__)r+   )rQ   rR   rS   rT   rU   rV   r  r  r   r;  rX   r+   r/   r-   r  r  &  s"    
 :I
.

;r/   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r?   r+   )rs   _hiers   & r-   ru   "class_hierarchy.<locals>.<genexpr>S  s     9KqD=Ks   
builtinsra   )r  __mro__r^   r*  r   r_   rR   r   
issubclassr   ra   )rZ   processr0  r   r   r  sr  s   &      @r-   class_hierarchyr  D  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  r'  )rZ   keyskeyr0  s   &   r-   iterate_attributesr  j  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   r;  r:  r  z(self, *args, **kw)z(*args, **kw)z?def %(method)s%(fn_args)s: return %(name)s.%(method)s%(d_args)s)rV   __del____getattribute____metaclass__r  r  )r  
startswithendswithr   r   r   r   r   r  r   r   rV  r)  localsr   r   setattr)into_clsfrom_clsskiponlyrz   from_instancedundersr5   r\  maybe_fnr   r   fn_argsd_argspyr   s   &&&&&&          r-   monkeypatch_proxied_specialsr  z  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.r:  )r   )meth1meth2s   &&r-   methods_equivalentr    s(     5*e,z51  r/   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>.AnonymousInterfacei  zA callable-holding shell.r+   NrQ   rR   rS   rT   rU   rX   r+   r/   r-   AnonymousInterfacer    s    'r/   r  	Anonymousz%r: unknown in this interfacerI  z is not callablez,dictionary does not contain required keys %s)r)  rh   r   r]   r  r  operatorgegtintersectionr   rw   rQ   dictlike_iteritemsrU  r  staticmethodr_   )rs  rZ   rd  requiredr5   	interfaceimplementedcomplies	qualifierr  foundr\  r   s   &&&&         r-   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]fgetrn   rU   r*   rQ   Nc                    V ^8  d   QhRRRR/# )r'   r  r  docrn   r+   )r,   s   "r-   r.   "generic_fn_descriptor.__annotate__-  s     & &1 & &r/   c                	j    Wn         T;'       g    VP                  V n        VP                  V n        R # r?   r  rU   rQ   rC   r  r  s   &&&r-   r   generic_fn_descriptor.__init__-  s%    	**dllr/   c               (    V ^8  d   QhRRRRRRRR/# )r'   rC   r  rs  r<   rZ   r   r)   r+   )r,   s   "r-   r.   r  3  s    ==d==C=D=r/   c                	    R # r?   r+   rC   rs  rZ   s   &&&r-   __get__generic_fn_descriptor.__get__2  s    :=r/   c               $    V ^8  d   QhRRRRRR/# )r'   rs  r[  rZ   r   r)   r   r+   )r,   s   "r-   r.   r  6  s    ::6:::r/   c                	    R # r?   r+   r  s   &&&r-   r  r  5  s    7:r/   c               (    V ^8  d   QhRRRRRRRR/# )r'   rC   r  rs  r   rZ   r)   zUnion[_GFD, _T_co]r+   )r,   s   "r-   r.   r  8  s)     $ $d $ $3 $3E $r/   c                	    \        4       hr?   NotImplementedErrorr  s   &&&r-   r  r  8      !##r/   c               $    V ^8  d   QhRRRRRR/# r'   instancer   rH   r)   r<   r+   )r,   s   "r-   r.   r  =  s    AACAAAr/   c                	    R # r?   r+   rC   r  rH   s   &&&r-   __set__generic_fn_descriptor.__set__=  s    cr/   c                    V ^8  d   QhRRRR/# r'   r  r   r)   r<   r+   )r,   s   "r-   r.   r  ?  s    88s8t8r/   c                	    R # r?   r+   )rC   r  s   &&r-   
__delete__ generic_fn_descriptor.__delete__?  s    Sr/   c                    V ^8  d   QhRRRR/# )r'   rs  r   r)   r<   r+   )r,   s   "r-   r.   r  A  s     $ $# $$ $r/   c                	    \        4       hr?   r  rC   rs  s   &&r-   _resetgeneric_fn_descriptor._resetA  r  r/   c               $    V ^8  d   QhRRRRRR/# )r'   rs  r   rz   r*   r)   r<   r+   )r,   s   "r-   r.   r  E  s!     $ $ $3 $4 $r/   c                	    \        4       hr?   r  rZ   rs  rz   s   &&&r-   resetgeneric_fn_descriptor.resetD  s    !##r/   rU   rQ   r  r?   )rQ   rR   rS   rT   rU   rW   r   r   r  r   r  r  r   classmethodr  rX   r+   r/   r-   r  r    sf     M&
 = =: :$ A8$ $ $r/   r  c                  8    ] tR tRtRt]'       g   R tRtR# RtR# )_non_memoized_propertyiI  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      # r?   r  r  s   &&&r-   r  _non_memoized_property.__get__T  s    {99S>!r/   r+   N)rQ   rR   rS   rT   rU   r   r  rX   r+   r/   r-   r
  r
  I  s     	" r/   r
  c                  F    ] tR tRtRt]'       g   R tR t]R 4       t	Rt
R# )_memoized_propertyiZ  z2A read-only @property that is only evaluated once.c                	f    Vf   V # V P                  V4      ;VP                  V P                  &   pV# r?   )r  r'  rQ   rC   rs  rZ   results   &&& r-   r  _memoized_property.__get___  s0    {3799S>ACLL'&Mr/   c                	D    \         P                  WP                  4       R # r?   )r  r  rQ   r  s   &&r-   r   _memoized_property._resete  s      mm4r/   c                	>    VP                   P                  VR 4       R # r?   )r'  r^   r  s   &&&r-   r  _memoized_property.reseth  s    t$r/   r+   N)rQ   rR   rS   rT   rU   r   r  r   r  r  rX   r+   r/   r-   r  r  Z  s&    <	5 % %r/   r  c                    V ^8  d   QhRRRR/# r'   r   r    r)   r+   )r,   s   "r-   r.   r.     s     ' ' 'r 'r/   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# r?   r+   ar  r  s   *,r-   memo6memoized_instancemethod.<locals>.oneshot.<locals>.memo  s    Mr/   )rQ   rU   r'  rC   r?  r  r  r  r   s   &*, @r-   oneshot(memoized_instancemethod.<locals>.oneshot  sI    D&4&2&	 zz%)bkk"r/   r   )r   r"  s   f r-   memoized_instancemethodr$    s    	 '2&&r/   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/# r;   r+   )r,   s   "r-   r.   HasMemoized.__annotate__  s     * *T *r/   c                	d    V P                    F  pV P                  P                  VR 4       K!  	  R # r?   )r'  r'  r^   rC   elems   & r-   _reset_memoizationsHasMemoized._reset_memoizations  s&    ''DMMdD) (r/   c                   V ^8  d   QhRR/# r;   r+   )r,   s   "r-   r.   r)    s     - - -r/   c                	P    V P                    F  pWP                  9  d   K  Q h	  R # r?   )r'  r'  r+  s   & r-   _assert_no_memoizations#HasMemoized._assert_no_memoizations  s"    ''D}},,, (r/   c               $    V ^8  d   QhRRRRRR/# )r'   r  r*   rH   r   r)   r<   r+   )r,   s   "r-   r.   r)    s!     % %3 %s %t %r/   c                	V    W P                   V&   V ;P                  V0,          un        R # r?   )r'  r'  )rC   r  rH   s   &&&r-   _set_memoized_attribute#HasMemoized._set_memoized_attribute  s!    "cu$r/   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  rn   rU   r*   rQ   Nc                    V ^8  d   QhRRRR/# )r'   r  r9  r  rn   r+   )r,   s   "r-   r.   +HasMemoized.memoized_attribute.__annotate__  s     	* 	*!2 	* 	*r/   c                	j    Wn         T;'       g    VP                  V n        VP                  V n        R # r?   r  r  s   &&&r-   r   'HasMemoized.memoized_attribute.__init__  s%    I..$,,DL MMDMr/   c               (    V ^8  d   QhRRRRRRRR/# )r'   rC   r#   rs  r<   rZ   r   r)   r+   )r,   s   "r-   r.   r;    s    ??#?D?s?s?r/   c                	    R # r?   r+   r  s   &&&r-   r  &HasMemoized.memoized_attribute.__get__  s    <?r/   c               $    V ^8  d   QhRRRRRR/# )r'   rs  r   rZ   r)   r   r+   )r,   s   "r-   r.   r;    s    88s888r/   c                	    R # r?   r+   r  s   &&&r-   r  r@    s    58r/   c                	    Vf   V # V P                  V4      ;VP                  V P                  &   pV;P                  V P                  0,          un        V# r?   )r  r'  rQ   r'  r  s   &&& r-   r  r@    sG    {3799S>ACLL'&4==/1Mr/   r  r?   )
rQ   rR   rS   rT   rU   rW   r   r   r  rX   r+   r/   r-   memoized_attributer8    sB    	  	*
 
? 
?	8 
8	r/   rD  c                    V ^8  d   QhRRRR/# r  r+   )r,   s   "r-   r.   r)    s     + + + +r/   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'   rC   r   r?  r  r)   r+   )r,   s   "r-   r.   9HasMemoized.memoized_instancemethod.<locals>.__annotate__  s(     
	 
	# 
	c 
	 
	 
	r/   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# r?   r+   r  s   *,r-   r  BHasMemoized.memoized_instancemethod.<locals>.oneshot.<locals>.memo  s    r/   )rQ   rU   r'  r'  r!  s   &*, @r-   r"  4HasMemoized.memoized_instancemethod.<locals>.oneshot  s`    *t*r*F KKDM::DL)-MM"++&BKK=0Mr/   r   )rZ   r   r"  s   &f r-   r$  #HasMemoized.memoized_instancemethod  s    
	 
	 gr**r/   r+   N)rQ   rR   rS   rT   rU   r   rV   	frozensetr'  rW   r-  r1  r5  memoized_propertyr   rD  r  r$  rX   r+   r/   r-   r&  r&    sT    
  	%.[NN0*-%.r2 : + +r/   r&  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r?   )r  )rC   r  s   &&r-   _fallback_getattrMemoizedSlots._fallback_getattr   s    S!!r/   c                    V ^8  d   QhRRRR/# )r'   r  r*   r)   r   r+   )r,   s   "r-   r.   MemoizedSlots.__annotate__  s     / /s /s /r/   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# r?   r+   r  s   *,r-   r  8MemoizedSlots.__getattr__.<locals>.oneshot.<locals>.memo  s    !Mr/   )rQ   rU   r  )r?  r  r  r  r  r  rC   s   *, @r-   r"  *MemoizedSlots.__getattr__.<locals>.oneshot  s@    t*r*" !%#||c4(r/   )r  r  r   r   r   r  rU   rS  )rC   r  rH   r"  r  s   ff  @r-   __getattr__MemoizedSlots.__getattr__  s    >>+,,1
 1
 !%% T^^se%<==DOC5"9:<ED#u%LT^^'8%>??4#4SE!:;D	 #llGON))#..r/   r+   N)	rQ   rR   rS   rT   rU   rV   rS  r^  rX   r+   r/   r-   rQ  rQ    s     I"/ /r/   rQ  c                    V ^8  d   QhRRRR/# )r'   rs  r   r)   r   r+   )r,   s   "r-   r.   r.   $  s     	 	 	 	r/   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)rb  yesonyt1)falsenooffrt   f0)rh   r*   striprr   
ValueErrorr   )rs  s   &r-   asboolro  $  sV    #siik!6699;cABB9r/   c                    V ^8  d   QhRRRR/# )r'   textr*   r)   z!Callable[[str], Union[str, bool]]r+   )r,   s   "r-   r.   r.   0  s      s @ r/   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'   rs  r*   r)   zUnion[str, bool]r+   )r,   s   "r-   r.   !bool_or_str.<locals>.__annotate__6  s      3 #3 r/   c                ,   < V S9   d   V # \        V 4      # r?   )ro  )rs  rq  s   &r-   bool_or_value"bool_or_str.<locals>.bool_or_value6  s    $;J#;r/   r+   )rq  rv  s   j r-   bool_or_strrx  0  s      r/   c                    V ^8  d   QhRRRR/# )r'   rH   r   r)   Optional[int]r+   )r,   s   "r-   r.   r.   ?  s        r/   c                $    V f   V # \        V 4      # )zCoerce to integer.)r   )rH   s   &r-   asintr|  ?  s     }u:r/   c               0    V ^8  d   QhRRRRRRRRR	R
RR/# )r'   r  r   r  r*   rG   rl   
flexi_boolr   destzOptional[Dict[str, Any]]r)   r<   r+   )r,   s   "r-   r.   r.   G  sD     ' ''	' ' 	'
 #' 
'r/   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)rh   r   r   ro  )r  r  rG   r~  r  s   &&&&&r-   coerce_kw_typer  G  sk     | 		E4((
27E0J0JGD=ZrwDIbgDI   1K 	r/   c               $    V ^8  d   QhRRRRRR/# )r'   rs  r   rZ   rl   r)   r   r+   )r,   s   "r-   r.   r.   a  s!       9  r/   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r?   r'  rs   krs  s   & r-   ru   "constructor_key.<locals>.<genexpr>g  s-      &+CLL/@CLLOe   77)r!  r   )rs  rZ   r   s   f& r-   constructor_keyr  a  sO    
 3E6EE &+E  E &+   r/   c          
     ,    V ^8  d   QhRRRRRRRRRR/# )	r'   rs  r   rZ   r[   r?  r   r  r)   r+   )r,   s   "r-   r.   r.   l  s/      " 8 C s r r/   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r?   r  r  s   & r-   ru   #constructor_copy.<locals>.<genexpr>t  s.      &:3<<>OCLLO&:r  )r!  r3   
difference)rs  rZ   r?  r  r   s   f&*, r-   constructor_copyr  l  sE     3EII &+&6&6r&:  r/   c                   V ^8  d   QhRR/# )r'   r)   zCallable[[], int]r+   )r,   s   "r-   r.   r.   z  s      " r/   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r?   )next)counterlocks   r-   _nextcounter.<locals>._next  s    T= TTTs   "3	)	threadingLockr   count)r  r  r  s    @@r-   r  r  z  s+     >>Dooa G! Lr/   c               $    V ^8  d   QhRRRRRR/# )r'   specimenr   r  zOptional[Type[Any]]r)   r+   )r,   s   "r-   r.   r.     s$         /  r/   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]   rh   r   r  r   )r  r  isas   && r-   duck_type_collectionr    s     x((  ,!!32
 2
 J((("8T22*
C
8T	Xs		
	Xt		x""	5	!	!
	5	!	!r/   c               (    V ^8  d   QhRRRRRRRR/# )r'   ry  r   argtypez'Union[Tuple[Type[Any], ...], Type[Any]]rz   r*   r)   r+   )r,   s   "r-   r.   r.     s,      	>FIr/   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'Nr+   )rs   r  s   & r-   ru   "assert_arg_type.<locals>.<genexpr>  s     $AAVaZZs   z, got ''z' is expected to be of type 'z', got ')rh   r   r   ArgumentErrorrw   r   )ry  r  rz   s   &&&r-   assert_arg_typer    sy     #
gu%%##$A$AA49N 
 ##$s)- r/   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__r(  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r?   )r  )r  dictlikegetters    r-   iterator$dictlike_iteritems.<locals>.iterator  s4     ((*)))6#;&& +s   ,/r  c              3  6   <"   T F  qS! V4      3x  K  	  R # 5ir?   r+   )rs   r  r  s   & r-   ru   %dictlike_iteritems.<locals>.<genexpr>  s     B/3&+&/s   )r   r  r  r   r)  iterr  )r  r  r  s   f @r-   r  r    s     x!!HNN$%%X}ght.LMF~6ABBx$$	'
 z	6	"	"B(--/BBB6ABBr/   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  ry  r   r  r+   )r,   s   "r-   r.   classproperty.__annotate__  s"     $ $1 $ $C $r/   c                	R   < \         SV `  ! V.VO5/ VB  VP                  V n        R # r?   )superr   rU   )rC   r  ry  r  r   s   &&*,r-   r   classproperty.__init__  s%    **r*||r/   c               $    V ^8  d   QhRRRRRR/# )r'   rs  r   rZ   zOptional[type]r)   r+   )r,   s   "r-   r.   r    s!      3 ^ s r/   c                	$    V P                  V4      # r?   r  r  s   &&&r-   r  classproperty.__get__  s    yy~r/   )rU   r?   )
rQ   rR   rS   rT   rU   rW   r   r  rX   __classcell__r   s   @r-   r  r    s$     $ $ r/   r  c                  :    ] tR tRtR R ltR R ltR R ltRtR	# )
hybridpropertyi  c                   V ^8  d   QhRR/# r'   r2  r9  r+   )r,   s   "r-   r.   hybridproperty.__annotate__        . r/   c                	    Wn         Wn        R # r?   )r2  clslevelrC   r2  s   &&r-   r   hybridproperty.__init__  s    	r/   c               $    V ^8  d   QhRRRRRR/# r'   r  r   ownerr)   r   r+   )r,   s   "r-   r.   r    !     ' ' 'C 'B 'r/   c                	R    Vf   V P                  V4      pV# V P                  V4      # r?   r  r2  rC   r  r  clsvals   &&& r-   r  hybridproperty.__get__  *    ]]5)FM99X&&r/   c                    V ^8  d   QhRRRR/# )r'   r2  r   r)   zhybridproperty[_T]r+   )r,   s   "r-   r.   r    s      1 6H r/   c                	    Wn         V # r?   r  r  s   &&r-   
classlevelhybridproperty.classlevel      r/   r  N)rQ   rR   rS   rT   r   r  r  rX   r+   r/   r-   r  r    s    ' r/   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_hybridpropertyi  c                   V ^8  d   QhRR/# r  r+   )r,   s   "r-   r.   rw_hybridproperty.__annotate__  s     8 8. 8r/   c                	,    Wn         Wn        R V n        R # r?   )r2  r  setfnr  s   &&r-   r   rw_hybridproperty.__init__  s    	37
r/   c               $    V ^8  d   QhRRRRRR/# r  r+   )r,   s   "r-   r.   r    r  r/   c                	R    Vf   V P                  V4      pV# V P                  V4      # r?   r  r  s   &&& r-   r  rw_hybridproperty.__get__  r  r/   c               $    V ^8  d   QhRRRRRR/# r  r+   )r,   s   "r-   r.   r    s!     $ $ $C $D $r/   c                	H    V P                   f   Q hV P                  W4       R # r?   r  r  s   &&&r-   r  rw_hybridproperty.__set__  s    zz%%%

8#r/   c                    V ^8  d   QhRRRR/# r'   r2  r   r)   zrw_hybridproperty[_T]r+   )r,   s   "r-   r.   r    s      - 2G r/   c                	    Wn         V # r?   r  r  s   &&r-   setterrw_hybridproperty.setter  s    
r/   c                    V ^8  d   QhRRRR/# r  r+   )r,   s   "r-   r.   r    s      1 6K r/   c                	    Wn         V # r?   r  r  s   &&r-   r  rw_hybridproperty.classlevel  r  r/   )r  r2  r  N)
rQ   rR   rS   rT   r   r  r  r  r  rX   r+   r/   r-   r  r    s     8
'$ r/   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  r+   )r,   s   "r-   r.   hybridmethod.__annotate__  r  r/   c                	.    V;V n         V n        Wn        R # r?   )r2  r:  r  r  s   &&r-   r   hybridmethod.__init__  s    $((	DMr/   c               $    V ^8  d   QhRRRRRR/# )r'   r  r   r  r)   r9  r+   )r,   s   "r-   r.   r    s"       C 4E r/   c                	    Vf&   V P                   P                  W"P                  4      # V P                  P                  W4      # r?   )r  r  r   r2  )rC   r  r  s   &&&r-   r  hybridmethod.__get__  sB    ==((  99$$ r/   c                    V ^8  d   QhRRRR/# )r'   r2  r   r)   zhybridmethod[_T]r+   )r,   s   "r-   r.   r  &  s      1 6F r/   c                	    Wn         V # r?   r  r  s   &&r-   r  hybridmethod.classlevel&  r  r/   )r:  r  r2  N)	rQ   rR   rS   rT   rU   r   r  r  rX   r+   r/   r-   r  r    s    9 r/   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.

r*   rz   zDict[str, symbol]symbolsNc               (    V ^8  d   QhRRRRRRRR/# )	r'   rz   r*   r  rn   	canonicalrz  r)   r  r+   )r,   s   "r-   r.   symbol.__annotate__?  s2        !	
 
r/   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   r(  rh   r*   hashr   __new__r  rz   rU   r)  )rZ   rz   r  r  r   s   &&&& r-   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# rJ  )r  rz   r   rB   s   &r-   
__reduce__symbol.__reduce__]  s    		3D	222r/   c                	    \        V 4      # r?   )r   rB   s   &r-   __str__symbol.__str__`  s    Dzr/   c                	$    R V P                   : R2# )zsymbol(r}  )rz   rB   s   &r-   __repr__symbol.__repr__c  s    Q''r/   r+   )NN)rQ   rR   rS   rT   rU   rW   r   r  r  r  r  r
  r  r  rX   r+   r/   r-   r  r  +  s9     I!#G#NNE<3(r/   r  c                  .    ] tR tRtR R ltR R ltRtR# )_IntFlagMetaig  c          
     ,    V ^8  d   QhRRRRRRRRR	R
/# )r'   	classnamer*   r   zTuple[Type[Any], ...]dict_r   r  r   r)   r<   r+   )r,   s   "r-   r.   _IntFlagMeta.__annotate__h  s<     
 

 %
 	

 
 

r/   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  rx   matchrh   r   r  r  r)  r  r   r   immutabledictrz   __members__)	rZ   r  r   r  r  r  r  vr   s	   &&&&,    r-   r   _IntFlagMeta.__init__h  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]r+   )r,   s   "r-   r.   r    s     
 
* 
r/   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  rB   s   &r-   __iter___IntFlagMeta.__iter__  s    !=
 	
r/   r+   N)rQ   rR   rS   rT   r   r!  rX   r+   r/   r-   r  r  g  s    
2
 
r/   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.

r+   Nr  r+   r/   r-   r$  r$    s    r/   r$  )	metaclass)IntFlag_Ec          
     ,    V ^8  d   QhRRRRRRRRR	R
/# )r'   ry  r   choiceszDict[_E, List[Any]]rz   r*   resolve_symbol_namesr   r)   zOptional[_E]r+   )r,   s   "r-   r.   r.     sA     D D	D D D 	D
 Dr/   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  rz   r   r  )ry  r)  rz   r*  
enum_valuechoices   &&&&  r-   parse_user_argument_for_enumr.    si    ( &mmo
!c__&<] . {


1$s3'B
CCr/   c                    V ^8  d   QhRRRR/# r  r+   )r,   s   "r-   r.   r.     s     
 
 
 
r/   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   &r-   set_creation_orderr2    s      /HqOr/   c               (    V ^8  d   QhRRRRRRRR/# )r'   r2  r   r?  r   rl  r)   r+   )r,   s   "r-   r.   r.     s)     7 7+ 7C 73 73 7r/   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)ri   warnr@   rA   )r2  r?  rl  s   &*,r-   warn_exceptionr7    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   r)  )rH   len_s   &&r-   ellipses_stringr:    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_stringi  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'   rH   r*   numr   r?  Sequence[Any]r)   r<  r+   )r,   s   "r-   r.   _hash_limit_string.__annotate__  s,      !)6	r/   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  r=  )rZ   rH   r?  r?  interpolatedrC   r   s   &&&&  r-   r  _hash_limit_string.__new__  sN     DsJ
 ws1'UD,>,D$EEF
r/   c                   V ^8  d   QhRR/# )r'   r)   r   r+   )r,   s   "r-   r.   rA    s      # r/   c                	    V P                   # r?   r=  rB   s   &r-   __hash___hash_limit_string.__hash__  s    zzr/   c                    V ^8  d   QhRRRR/# )r'   otherr   r)   r   r+   )r,   s   "r-   r.   rA    s     ) )C )D )r/   c                	0    \        V 4      \        V4      8H  # r?   )r  )rC   rK  s   &&r-   __eq___hash_limit_string.__eq__  s    DzT%[((r/   rG  )rQ   rR   rS   rT   rU   rW   r  rH  rM  rX   r  r  s   @r-   r<  r<    s(     J ) )r/   r<  c               $    V ^8  d   QhRRRRRR/# )r'   msgr*   r   rn   r)   r<   r+   )r,   s   "r-   r.   r.     s!     
+ 
+c 
+ 
+$ 
+r/   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)rP  r   s   &&r-   r6  r6    s&     s}}S45sCMM*r/   c               $    V ^8  d   QhRRRRRR/# )r'   rP  r*   r?  r@  r)   r<   r+   )r,   s   "r-   r.   r.     s!     ' 'c ' '4 'r/   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)r<  rR  r   rS  )rP  r?  s   &&r-   warn_limitedrV    s#    
  b$/3&r/   z)Dict[CodeType, Tuple[str, Type[Warning]]]_warning_tagsc               $    V ^8  d   QhRRRRRR/# )r'   messager*   categoryzType[Warning]r)   Callable[[_F], _F]r+   )r,   s   "r-   r.   r.     s$      )r/   c                   a a VV 3R  lpV# )c                2   < SS3\         V P                  &   V # r?   )rW  r  )r   rZ  rY  s   &r-   go#tag_method_for_warnings.<locals>.go   s    &-x%8bkk"	r/   r+   )rY  rZ  r^  s   ff r-   tag_method_for_warningsr`    s     Ir/   z&^(?:sqlalchemy\.(?!testing)|alembic\.)c               (    V ^8  d   QhRRRRRRRR/# )	r'   rY  zUnion[str, Warning]rZ  zOptional[Type[Warning]]
stacklevelr   r)   r<   r+   )r,   s   "r-   r.   r.   *  s0     0: 0: 0:%0: 0: 
	0:r/   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)FNrQ   r   Tz (r}  )rb  )r@   	_getframerx   r  _not_sa_pattern	f_globalsr(  f_coderW  f_backrn  warningsr6  )rY  rZ  rb  framestacklevel_foundwarning_tag_found_suffix	_categorys   &&&     r-   rR  rR  *  s   %j) 054 $BHH!4!4Z!D- -
 $( 
 ||},$(!%25<<%@"#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   r9  retry_on_exceptionr   r)   zCallable[..., Optional[_T]]r+   )r,   s   "r-   r.   r.   ]  s$      /3 r/   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'   ry  r   r  r)   zOptional[_T]r+   )r,   s   "r-   r.   only_once.<locals>.__annotate__e  s!       C L r/   c                    < SpS'       d   SP                  4       p V! V / VB # R#    S'       d   SP                  ^ T4       h ; i)r5  N)r^   insert)ry  r  	strong_fnonce_fnr   oncerp  s   *,  r-   r^  only_once.<locals>.goe  sM     	hhjG*r** %KK7+s	   ' Ar+   )r   rp  r^  rx  s   ff @r-   	only_oncerz  ]  s     4D  Ir/   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'   tbr3  exclude_prefixzre.Pattern[str]exclude_suffixr)   r+   )r,   s   "r-   r.   r.   {  s0      # $ 	r/   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   &&&  r-   chop_tracebackr  {  se    " E
b'A+C
,>00;;

,>0099qcAgr/   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   &  r-   
attrsetterr    s*    3h>D
(--/COu:r/   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/# r;   r+   )r,   s   "r-   r.   TypingOnly.__annotate__  s     
$ 
$$ 
$r/   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  r*  r'  _dundersr  AssertionErrorr  __init_subclass__)rZ   rz   	remainingr   s   &  r-   r  TypingOnly.__init_subclass__  sx    &!$!-X^^D5I   $SE "--6Kq:  	!#s   A9A9r+   )	rQ   rR   rS   rT   rU   rV   r  rX   r  r  s   @r-   r  r    s    
 I
$ 
$r/   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.

r*   ensure_kwargc                   V ^8  d   QhRR/# r;   r+   )r,   s   "r-   r.   EnsureKWArg.__annotate__  s     $ $$ $r/   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 # r?   )r  r'  rx   r  r   r   rA  
_wrap_w_kwr  r  r  )	rZ   fn_regclsdictr  r5   r   r   wrappedr   s	   &       r-   r  EnsureKWArg.__init_subclass__  s|    !!,,HHV)1 B!88<D:::"%.."4'2  	!#r/   c                    V ^8  d   QhRRRR/# )r'   r   r   r)   r+   )r,   s   "r-   r.   r    s     ( (. (3E (r/   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'   ry  r   r  r)   r+   )r,   s   "r-   r.   ,EnsureKWArg._wrap_w_kw.<locals>.__annotate__  s!     	 	s 	# 	# 	r/   c                    < S! V !  # r?   r+   )ry  r  r   s   *,r-   wrap$EnsureKWArg._wrap_w_kw.<locals>.wrap  s    s8Or/   r   )rZ   r   r  s   &f r-   r  EnsureKWArg._wrap_w_kw  s    	 	 dB''r/   r+   )rQ   rR   rS   rT   rU   rW   r  r  r  rX   r  r  s   @r-   r  r    s3     $ $ ( (r/   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

rQ   rR   rU   )r   r   r   rQ   rR   r;  rU   )wrapperr   _fs   && r-   wrap_callabler    s     r:g**ll++2|$$MMBM2;;	**r{{/B/B/B,,BJ 	 ZZZBJ	r/   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   rT  )r  r   r   rw   )rH   r  r  idxlvcharr  s   &      r-   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   rq  r*   r)   r[  r+   )r,   s   "r-   r.   r.   $  s"     
 
s 
# 
2D 
r/   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   )rU   inject_param_text)r   r  paramr  rq  s   &  r-   r   $add_parameter_text.<locals>.decorate'  sU    jj$3399r#C6)J6%+6)JKC
	 *Ks    A
)r   r~  )r  rq  r   s   ff r-   add_parameter_textr  $  s    !!&)F Or/   c                    V ^8  d   QhRRRR/# )r'   rq  r*   r)   r+   )r,   s   "r-   r.   r.   1  s     	% 	%C 	%C 	%r/   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      # )
rp   )r  r   r  textwrapdedent)rq  
split_text	firstliner  s   &   r-   _dedent_docstringr  1  sd    D!$J
:!)	$$4(//)"<<<t$$r/   c               (    V ^8  d   QhRRRRRRRR/# )r'   given_doctextrn   
injecttextr*   posr   r)   r+   )r,   s   "r-   r.   r.   =  s,       .18;r/   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  ru  r  rm  minrw   )
r  r  r  doctextlinesinjectlinesr?  lineblanks
inject_poss
   &&&       r-   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  r*   inject_paramszDict[str, str]r)   r+   )r,   s   "r-   r.   r.   T  s!     ( (s (> (c (r/   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*rp   z(\s+)\Sr  z::)collectionsdeque
splitlinespopleft
_param_regr  r   lstripr   rx   r`   rstripr  r   rw   )
r  r  doclinesr  	to_injectr  r5   r  indentm2s
   &&        r-   r  r  T  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r/   c                    V ^8  d   QhRRRR/# )r'   r   r3  r)   rn   r+   )r,   s   "r-   r.   r.     s     > >I >- >r/   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:r5     N:r5  r   Nz%s..:N   Nr|  z, ..., rT  )r   rw   )r   flagrz   ress   &   r-   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   &r-   has_compiled_extr    s$    	"
 	

 r/   c                  8    ] tR tRt]P
                  ! 4       tRtR# )_Missingi  r+   N)rQ   rR   rS   rT   enumautoMissingrX   r+   r/   r-   r  r    s    iikGr/   r  r?   )FF)T)r+   r+   r+   r+   )r+   Nr+   )NNz
self.proxyN)NNN)TN)F)   )Nr'   )__conditional_annotations__rU   
__future__r   r  r  	functoolsr   r   r   r  rx   r@   r  r  r   r   typingr   r   r   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   ri  r   r   r   _has_cyr   r   r   r   r   r    r"   r#   r$   r%   r6   r8   rd   rj   r{   r   r   r   r   r   r   r   r   r   r   r  r!  r5  rD  r   r^  rj  rm  rq  r  r  r  r  r  r  r  r  r  r
  r  rO  non_memoized_propertypropertyro_memoized_propertyro_non_memoized_propertyr$  r&  !HasMemoized_ro_memoized_attributerD  rQ  ro  rx  r|  r  r  r  r  r  r  r  r  r  r  r  r   r  r   r  r$  r&  FastIntFlagEnumr'  r.  r1  r2  r7  r:  r*   r<  r6  rV  rW  rW   r`  compilere  rR  rz  _SQLA_RE_UNITTEST_REr  NoneTyper  r  r  r  r  r  r  r  r  r  r  r  r  r  r  	MissingOr)r  s   @r-   <module>r     s  
 #   $    	 
                           $  T]4(T#s(+,e34e@Ae01e./$82 82v6O,$M  e/0
S,l enen( (V
( 
  $ "	 
 
-1DI 

2-12DI2j29;x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	r/   