+
    i  c                   s   R t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt. R!Ot ! R R]P                  4      t	]
! 4       tRtR"t ! R R4      t]! R#R$ 4      t ! R R4      tR	 tR
 tR t ! R R]4      tRR/R ltRRRR/R ltR tR tR tRRRRRRR]	P8                  /R ltR tR tR t R t!]PD                  R,          PF                  t$R  t%R# )%z3Helpers for introspecting and wrapping annotations.NFormat
ForwardRefc                   s&    ] tR t^t^t^t^t^tRtR# )r     N)	__name__
__module____qualname____firstlineno__VALUEVALUE_WITH_FAKE_GLOBALS
FORWARDREFSTRING__static_attributes__r       &/usr/lib64/python3.14/annotationlib.pyr    r       s    EJFr   z!name '{name:.200}' is not definedc            
       s   a  ] tR t^5t o Rt]tRRRRRRRR/R	 ltR
 tRRRRRRRRR]	P                  /R lt]3R lt]R 4       t]R 4       tR tR tR tR tR tRtV tR# )r   a  Wrapper that holds a forward reference.

Constructor arguments:
* arg: a string representing the code to be evaluated.
* module: the module where the forward reference was created.
  Must be a string, not a module object.
* owner: The owning object (module, class, or function).
* is_argument: Does nothing, retained for compatibility.
* is_class: True if the forward reference was created in class scope.

moduleNowneris_argumentTis_classFc               s    \        V\        4      '       g   \        R V: 24      hWn        W@n        WPn        W n        W0n        RV n        RV n	        RV n
        RV n        RV n        R# )z*Forward reference must be a string -- got N)
isinstancestr	TypeError__arg____forward_is_argument____forward_is_class____forward_module__	__owner____globals____cell____extra_names____code____ast_node__)selfargr   r   r   r   s   &&$$$$r   __init__ZForwardRef.__init__D   sl     #s##HPQQ'2$$,!"(   #  r   c                   \        R 4      h)zCannot subclass ForwardRefr   )ZclsargsZkwdss   "*,r   __init_subclass__ZForwardRef.__init_subclass__b   s    455r   globalslocalstype_paramsformatc               s   T;\         P                  8X  d    V P                  # ;\         P                  8X  d    RpM#\         P                  8X  d   RpM \        V4      h\        V P                  \        P                  4      '       d    V P                  P                  # Vf   V P                  pVfD   V P                  e6   \        \        P                   P#                  V P                  R4      RR4      pVf   V P$                  pVf   \        V\&        4      '       dL   \        VRR4      pV'       d6   \        P                   P#                  VR4      pV'       d   \        VRR4      pML\        V\        P(                  4      '       d   \        VRR4      pM\+        V4      '       d   \        VRR4      pVf   / pVf   Ve   \        VRR4      pVf4   / p\        V\&        4      '       d   VP-                  \/        V4      4       MAVf3   \        V P                  \0        4      '       g   V P2                  '       d   \1        V4      pVe&   V F  p	VP5                  V	P6                  V	4       K!  	  \        V P                  \0        4      '       dB   V P                  P9                  4        F#  w  r VP                  pVP5                  W4       K%  	  V P2                  '       d   VP-                  V P2                  4       V P                  pVP;                  4       '       d   \<        P>                  ! V4      '       gn   W9   d	   W-,          # W9   d	   W,          # \A        \B        V4      '       d   \        \B        V4      # V'       d   V # \E        \F        PI                  VR7      VR7      hV PJ                  p \M        WVR	7      #   \         d     EL5i ; i  \         d     EK:  i ; i  \N         d    T'       g   h  Mi ; i\Q        / \B        PR                  CTCTCTTT PT                  TR
7      p \M        YTR	7      pTPW                  T P                  4       T#   \N         d    T u # i ; i)zxEvaluate the forward reference and return the value.

If the forward reference cannot be evaluated, raise an exception.
FTN__dict__r   r   __type_params__)name)r&   r'   r&   r   r   r)   ),r    r
   __forward_arg__r   r	   NotImplementedErrorr   r   typesCellTypecell_contents
ValueErrorr   r   getattrsysmodulesgetr   type
ModuleTypecallableupdatevarsdictr   Z
setdefaultr   itemsZisidentifierkeywordZ	iskeywordhasattrbuiltinsZ	NameError_NAME_ERROR_MSGr)   __forward_code__eval	Exception_StringifierDictr*   r   transmogrify)r   r&   r'   r(   r   r)   Zis_forwardref_formatmodule_namer   paramZ	cell_namecellZ
cell_valuer    ZcodeZ
new_localsresults   &$$$$$           r   evaluateZForwardRef.evaluatee   s    +++',$""'+$)&11dmmU^^44}}222 =NNE?t66B 7 7>
DG ?&&G?%&&%e\4@ [[__[$?F")&*d"CE5#3#344!%T:%!%= ?G5#4!%):DAK>F%&&d5k*#$--..### &\F
 "$!!%..%8 %
 dmmT**#'==#6#6#8	=!%!3!3J %%i< $9 MM$../""g&7&7&<&<}{"|#3''x--% 6 6C 6 @sKK((DD&AA_  p " 0  + , *:8$$::6:22JdJG ''6	  sN   O 5O;O- OOO*)O*-P PP6Q   Q0/Q0c               s    ^ RI p^ RIpV\        J d   VP                  R4       RpVP	                  RRRR7       VP                  V VVVVR7      # )	i    Nztyping.ForwardRef._evaluatezForwardRef._evaluatez{name} is a private API and is retained for compatibility, but will be removed in Python 3.16. Use ForwardRef.evaluate() or typing.evaluate_forward_ref() instead.)Zremove)r&   r'   r(   Z_recursive_guardr   )i   i   )typingwarnings	_sentinelZ._deprecation_warning_for_no_type_params_passedZ_deprecatedZevaluate_forward_ref)r   ZglobalnsZlocalnsr(   Zrecursive_guardrM   rN   s   &&&&$  r   	_evaluateZForwardRef._evaluate   sp    )#AA- K"c	 	 	
 **#, + 
 	
r   c                s    V P                   e   V P                   # V P                  e2   \        P                  ! V P                  4      V n         V P                   # \	        R4      h)NzDAttempted to access '__forward_arg__' on an uninitialized ForwardRef)r   r   astunparseZAssertionErrorr      &r   r.   ZForwardRef.__forward_arg__   sR    <<#<<(;;t'8'89DL<<R
 	
r   c                s    V P                   e   V P                   # V P                  p \        \        V4      RR4      V n         V P                   #   \         d    \	        RT: 24      hi ; i)Nz<string>rD   z/Forward reference must be an expression -- got )r   r.   Zcompile_rewrite_star_unpackSyntaxError)r   r       & r   rC   ZForwardRef.__forward_code__  sp    ==$== ""	Y#$8$=z6RDM }}  	Y OPSwWXX	Ys   A A*c           	     sF   \        V\        4      '       g   \        # V P                  VP                  8H  ;'       Ed    V P                  VP                  8H  ;'       Ed    V P
                  VP
                  J ;'       Ed    V P                  VP                  8H  ;'       Edt    \        V P                  \        4      '       d   \        VP                  \        4      '       dr   V P                  P                  4        UUu/ uF  w  r#V\        V4      bK  	  uppVP                  P                  4        UUu/ uF  w  r#V\        V4      bK  	  upp8H  MV P                  VP                  J ;'       d    V P                  VP                  8H  ;'       d    V P                  '       d-   \        \        V P                  P                  4       4      4      MR VP                  '       d-   \        \        VP                  P                  4       4      4      MR 8H  # u uppi u uppi N)r   r   ZNotImplementedr.   r   r   r   r   r=   r>   idr   r   tuplesorted)r   otherr,   rJ      &&  r   __eq__ZForwardRef.__eq__  s   %,,!!  E$9$99  ''5+C+CC    E$5$55	 
 ))U-G-GG  dmmT22z%..RV7W7W 37--2E2E2GH2GJDr$x2GH5:^^5I5I5KL5KztD"T(N5KLM ]]enn4  %//1  AE@T@T@Tvd2288:;<Z^AFAVAVAVve3399;<=\`b!	
 ILs   H8Hc                s,   \        V P                  V P                  \        V P                  4      V P
                  \        V P                  \        4      '       dL   \        \        V P                  P                  4        UUu. uF  w  rV\        V4      3NK  	  upp4      4      M\        V P                  4      3V P                  V P                  '       d2   \        \        V P                  P                  4       4      4      34      # R 34      # u uppi rX   )Zhashr.   r   rY   r   r   r   r   r=   rZ   r[   r>   r   r   )r   r,   rJ      &  r   __hash__ZForwardRef.__hash__(  s      ##t %% dmmT22 fATATAVWAV:4tRX.AVWXY8:4==8I NN;?;O;O;OE&--33567
  	 VZ
  	 Xs   Dc                s2    \         P                  W3,          # rX   r0   Z	UnionTyper   r\      &&r   __or__ZForwardRef.__or__6  s    t{++r   c                s2    \         P                  W3,          # rX   ra   rb   rc   r   __ror__ZForwardRef.__ror__9  s    u{++r   c                sD   . pV P                   e    VP                  RV P                   : 24       V P                  '       d   VP                  R4       V P                  e    VP                  RV P                  : 24       RV P                  : RP                  V4       R2# )Nz	, module=z, is_class=Truez, owner=zForwardRef( ))r   appendr   r   r.   Zjoin)r   ZextrarW   r   __repr__ZForwardRef.__repr__<  s    "".LL9T%<%<$?@A$$$LL*+>>%LL8DNN#567T114RWWU^4DAFFr   )
r   r   r   r   r   r   r   r   r   r   )r   r   r   r   __doc___SLOTS	__slots__r!   r%   r    r   rL   rO   rP   Zpropertyr.   rC   r^   r`   rd   re   ri   r   __classdictcell____classdict__   @r   r   r   5   s     
 I! 	!
 ! ! !<6| | 	|
 | | |||| 8A 
. 
 
  
0,,G Gr   c                   s  a  ] tR tRt o ]tRRR/R lltR tR tR t	RR lt
R	 tR
 tR tR tR tR tR tV 3R lR lt]! ]P(                  ! 4       4      t]! ]P,                  ! 4       4      t]! ]P0                  ! 4       4      t]! ]P4                  ! 4       4      t]! ]P8                  ! 4       4      t]! ]P<                  ! 4       4      t]! ]P@                  ! 4       4      t!]! ]PD                  ! 4       4      t#]! ]PH                  ! 4       4      t%]! ]PL                  ! 4       4      t']! ]PP                  ! 4       4      t)]! ]PT                  ! 4       4      t+]! ]PX                  ! 4       4      t-AV 3R lR lt.].! ]P(                  ! 4       4      t/].! ]P,                  ! 4       4      t0].! ]P0                  ! 4       4      t1].! ]P4                  ! 4       4      t2].! ]P8                  ! 4       4      t3].! ]P<                  ! 4       4      t4].! ]P@                  ! 4       4      t5].! ]PD                  ! 4       4      t6].! ]PH                  ! 4       4      t7].! ]PL                  ! 4       4      t8].! ]PP                  ! 4       4      t9].! ]PT                  ! 4       4      t:].! ]PX                  ! 4       4      t;A.R t<]<! ]Pz                  ! 4       4      t>]<! ]P~                  ! 4       4      t@]<! ]P                  ! 4       4      tB]<! ]P                  ! 4       4      tD]<! ]P                  ! 4       4      tF]<! ]P                  ! 4       4      tHA<R tI]I! ]P                  ! 4       4      tK]I! ]P                  ! 4       4      tM]I! ]P                  ! 4       4      tOAIRtPV tQR# )_StringifieriJ  Nextra_namesc               s    R V n         RV n        W@n        R V n        R V n        Wn        W n        Wpn        WPn        W0n	        W`n
        R # )NF)r   r   r   r   r   r   r   r   r   r   __stringifier_dict__)r   noder&   r   r   rJ   stringifier_dictrr   s   &&&&&&$$r   r!   Z_Stringifier.__init__O  sJ     ',$$,!"& "*$4!r   c                sp   \        V\        4      '       df   \        VP                  \        4      '       d.   \        P
                  ! VP                  R 7      VP                  3# VP                  VP                  3# \        V4      \        J d   \        V4      R3# V P                  P                  \        P                  8X  g.   Ve*   \        V4      \        \        \        \         \"        39   d   \        P$                  ! VR7      R3# \        V4      \&        J d   / p. p. pVP)                  4        Fw  w  rVV P+                  V4      w  rxVe   VP-                  V4       VP/                  V4       V P+                  V4      w  rVe   VP-                  V4       VP/                  V	4       Ky  	  \        P0                  ! W44      V3# \        V4      \2        \4        \6        39   d   / p. p
V F<  pV P+                  V4      w  rVe   VP-                  V4       V
P/                  V4       K>  	  \2        \        P8                  \4        \        P:                  \6        \        P<                  /\        V4      ,          pV! V
4      V3# V P                  P?                  4       p\        P
                  ! VR 7      W/3# )rY   Nvalue) r   rq   r   r   rQ   Namer   r8   	_Template_template_to_astrs   r)   r    r
   ZintZfloatZboolZcomplexConstantr=   r>   _Stringifier__convert_to_astr;   rh   ZDictZlistrZ   ZsetZListTupleZSetcreate_unique_name)r   r\   rr   Zkeysvalueskeyrx   Znew_keynew_extra_names	new_valueeltseltnew_eltZ	ast_classr,   s   &&             r   Z__convert_to_astZ_Stringifier.__convert_to_asti  s$   e\**%,,c22xx5#5#568M8MMM%%u'<'<<<%[I%#E*D00 %%,,=}E{sCg>><<e,d22%[D KDF#kkm
+/+@+@+E(".&&7G$-1-B-B5-I*	".&&7i( , 88D);66%[T5#..KD+/+@+@+E(".&&7G$	 
 sxx		3HeUIT?K//,,??AD88t$tm33r   c                s   a a \        V\        4      '       dU   / oVV 3R  lp\        P                  ! V! VP                  4      V! VP
                  4      V! VP                  4      R7      S3# S P                  V4      # )c                 sd   < V f   R # SP                  V 4      w  rVe   SP                  V4       V# rX   )r}   r;   )objZnew_objr   rr   r   s   &  r   convZ3_Stringifier.__convert_to_ast_getitem.<locals>.conv  s7    ;+/+@+@+E(".&&7r   )ZlowerZupperstep)r   ZslicerQ   ZSliceZstartZstopr   r}   )r   r\   r   rr   s   f& @r   Z__convert_to_ast_getitemZ%_Stringifier.__convert_to_ast_getitem  sn    eU##K 995;;'5::&%**% 	  ((//r   c                sx    V P                   p\        V\        4      '       d   \        P                  ! VR 7      # V# )rv   )r   r   r   rQ   ry   )r   rt   rW   r   Z	__get_astZ_Stringifier.__get_ast  s.      dC  88t$$r   c           	     sV   / pV P                   e   VP                  V P                   4       Ve   VP                  V4       \        TV P                  V P                  V P
                  V P                  T;'       g    R R7      pV P                  P                  P                  V4       V# )N)ru   rr   )	r   r;   rq   r   r   r   rs   stringifiersrh   )r   rt   rr   r   Zstringifiers   &&&  r   Z
__make_newZ_Stringifier.__make_new  s    +""4#7#78""";/"NN%%!66'//4
 	!!..55kBr   c                s    \        V 4      # rX   rv   rS   rT   r   r`   Z_Stringifier.__hash__  s    $xr   c                s   V P                   R 8X  d   \        h\        V\        4      '       d^   / p. pV F<  pV P	                  V4      w  rVVe   VP                  V4       VP                  V4       K>  	  \        P                  ! V4      pMV P	                  V4      w  rV P                  \        P                  ! V P                  4       V4      V4      # rn   )r   KeyErrorr   rZ   $_Stringifier__convert_to_ast_getitemr;   rh   rQ   r~   _Stringifier__make_newZ	Subscript_Stringifier__get_ast)r   r\   rr   r   r   r   r   s   &&     r   __getitem__Z_Stringifier.__getitem__  s     /NeU##KD+/+H+H+M(".&&7G$	 
 IIdOE!%!>!>u!EEs}}T^^-=uE{SSr   c                sj    V P                  \        P                  ! V P                  4       V4      4      # rX   )r   rQ   Z	Attributer   )r   Zattrrc   r   __getattr__Z_Stringifier.__getattr__  s#    s}}T^^-=tDEEr   c                s   / p. pV F<  pV P                  V4      w  rgVe   VP                  V4       VP                  V4       K>  	  . pVP                  4        FR  w  rV P                  V
4      w  rVe   VP                  V4       VP                  \        P
                  ! W4      4       KT  	  V P                  \        P                  ! V P                  4       WH4      V4      # rX   )	r}   r;   rh   r>   rQ   r?   r   Callr   )r   r$   Zkwargsrr   Zast_argsr    Znew_argr   Z
ast_kwargsr   rx   r   s   &*,         r   __call__Z_Stringifier.__call__  s    C'+'<'<S'A$G*""?3OOG$	 
 
 ,,.JC)-)>)>u)E&I*""?3ckk#9:	 )
 sxx(8(OQ\]]r   c              #  sx   "   V P                  \        P                  ! V P                  4       4      4      x  R # 5irX   )r   rQ   ZStarredr   rS   rT   r   __iter__Z_Stringifier.__iter__  s$     oockk$..*:;<<s   8:c                s    \        V P                  \        4      '       d   V P                  # \        P                  ! V P                  4      # rX   )r   r   r   rQ   rR   rS   rT   r   ri   Z_Stringifier.__repr__  s6    d''--$$${{4,,--r   c                r"   )z8Cannot stringify annotation containing string formattingr#   )r   format_specrc   r   
__format__Z_Stringifier.__format__  s    RSSr   c                4   < V ^8  d   QhRS[ P                  /# i   oprQ   ZASTr)   ro      "r   __annotate___Stringifier.__annotate__  s       r   c                   a  V 3R  lpV# )c                 s   < V P                  V4      w  r#V P                  \        P                  ! V P	                  4       SV4      V4      # rX   r}   r   rQ   ZBinOpr   r   r\   Zrhsrr   r      &&  r   binopZ'_Stringifier._make_binop.<locals>.binop  s@    #44U;C??		$..*B4k r   r   )r   r      f r   _make_binopZ_Stringifier._make_binop  s    	 r   c                r   r   r   r   r   r   r   r     s       r   c                r   )c                 s   < V P                  V4      w  r#V P                  \        P                  ! VSV P	                  4       4      V4      # rX   r   )r   r\   Z	new_otherrr   r   r   r   rbinopZ)_Stringifier._make_rbinop.<locals>.rbinop  s@    %)%:%:5%A"I??		)R)9:K r   r   )r   r   r   r   _make_rbinopZ_Stringifier._make_rbinop  s    	 r   c                r   )c                 s   < V P                  V4      w  r#V P                  \        P                  ! V P	                  4       S.V.R 7      V4      # ))ZleftZopsZcomparators)r}   r   rQ   ZComparer   r   r   r   compareZ+_Stringifier._make_compare.<locals>.compare(  sL    #44U;C??)!$
  r   r   )r   r   r   r   _make_compareZ_Stringifier._make_compare'  s    		 r   c                r   )c                 sl   < V P                  \        P                  ! SV P                  4       4      4      # rX   )r   rQ   ZUnaryOpr   )r   r   s   &r   unary_opZ-_Stringifier._make_unary_op.<locals>.unary_op?  s$    ??3;;r4>>3C#DEEr   r   )r   r   r   r   _make_unary_opZ_Stringifier._make_unary_op>  s    	F r   )r   r   r   r   r   r   r   r   r   r   rs   )NNFNrX   )Rr   r   r   r   rk   rl   r!   r}   r   r   r   r`   r   r   r   r   ri   r   r   rQ   ZAddZ__add__ZSubZ__sub__ZMultZ__mul__ZMatMultZ
__matmul__ZDivZ__truediv__ZModZ__mod__ZLShiftZ
__lshift__ZRShiftZ
__rshift__ZBitOrrd   ZBitXorZ__xor__ZBitAndZ__and__ZFloorDivZ__floordiv__ZPowZ__pow__r   Z__radd__Z__rsub__Z__rmul__Z__rmatmul__Z__rtruediv__Z__rmod__Z__rlshift__Z__rrshift__re   Z__rxor__Z__rand__Z__rfloordiv__Z__rpow__r   ZLtZ__lt__ZLtEZ__le__ZEqr^   ZNotEqZ__ne__ZGtZ__gt__ZGtEZ__ge__r   ZInvertZ
__invert__ZUAddZ__pos__ZUSubZ__neg__r   rm   rn   rp   r   rq   rq   J  s     I5 54)4V0(&T&F^ =.
T  #'')$G#'')$G#((*%GS[[]+Jcggi(K#'')$GSZZ\*JSZZ\*J%F#**,'G#**,'Gs||~.L#'')$G  CGGI&HCGGI&HCHHJ'Hs{{}-K	*LCGGI&Hszz|,Kszz|,K399;'GCJJL)HCJJL)H 0MCGGI&H 3668$F3779%F3668$F399;'F3668$F3779%F  

-JSXXZ(GSXXZ(Gr   rq   c                s`   . pV  F  pV\         Rc ;e+   w   VP                  \        P                  ! VR7      4       K9    \        P                  ! \        P
                  ! RR7      \        P                  ! VP                  R7      \        P                  ! VP                  R7      \        P                  ! VP                  R7      \        P                  ! VP                  R7      .R7      pVP                  V4       K  	  \        P                  ! \        P
                  ! RR7      V. R7      # )z3Convert a `template` instance to a non-literal AST.r   rw   Interpolationrv   )funcr$   ZTemplate)r   r$   Zkeywords)
r   rh   rQ   r|   r   ry   rx   
expression
conversionr   )templater$   partinterps   &   r   _template_to_ast_constructorr   K  s    DCLLt45 _54::64??;4??;4+;+;<	 F#  88Z0tbIIr   c           
     s   . p^ pV  F  pV\         Rc ;e+   w   VP                  \        P                  ! VR7      4       K9    \        P                  ! VP
                  W,          VP                  '       d   \        VP                  4      MRVP                  '       d"   \        P                  ! VP                  R7      MRR7      pVP                  V4       V^,          pK  	  \        P                  ! VR7      # )z8Convert a `template` instance to a t-string literal AST.r   Nrw   )r   rx   r   r   )r   i)
r   rh   rQ   r|   r   r   r   Zordr   ZTemplateStr)r   parsedr   Zinterp_countr   r   s   &&    r   _template_to_ast_literalr   `  s    FLcll67 ** .7;s4??3B''' !$43C3C D f%!  ??&))r   c                s   \         ;QJ d&    R V P                   4       F  '       g   K   RM	  RM! R V P                   4       4      '       d   \        V 4      #  \        ;QJ d    . R V P                   4       F  NK  	  5M! R V P                   4       4      p\        Y4      #   \         d    \        T 4      u # i ; i)zAMake a best-effort conversion of a `template` instance to an AST.c              3   sZ   "   T F!  qP                   P                  4       R 8H  x  K#  	  R# 5i)rf   N)r   ZstripZ.0r   rW   r   	<genexpr>#_template_to_ast.<locals>.<genexpr>|  s"     
M5LT??  "b(5Ls   )+TFc              3   s   "   T F5  p\         P                  ! R VP                   R2RR7      P                  x  K7  	  R# 5i)(rg   rD   )ZmodeN)rQ   Zparser   Zbodyr   rW   r   r   r     s6      
/ II$//*!,6:??/s   =?)ZanyZinterpolationsr   rZ   rV   r   )r   r   rW   r   r{   r{   v  s     s
MX5L5L
Msss
MX5L5L
MMM+H556 
 //
 
 //
 
 $H55  6+H556s   
B& &5B& &B?>B?c                   sT   a a ] tR tRt oRRRRRR/V 3R lltR tR	 tR
 tRtVt	V ;t
# )rF   i  r&   Nr   r   Fc               s~   < \         SV `  V4       Wn        W n        W0n        W@n        . V n        ^V n        WPn        R# )i   N)	Zsuperr!   	namespacer&   r   r   r   next_idr)   )r   r   r&   r   r   r)   	__class__s   &&$$$$r   r!   Z_StringifierDict.__init__  s8    #"
 r   c                s    \        VV P                  V P                  V P                  V R 7      pV P                  P                  V4       V# ))r&   r   r   ru   )rq   r&   r   r   r   rh   )r   r   fwdref   && r   __missing__Z_StringifierDict.__missing__  sB    LL**]]!
 	  (r   c                s    V P                    Fi  p\        Vn        R Vn        \	        VP
                  \        4      '       d   VP
                  Vn        R Vn        Vf   KS  VP                  e   Kc  Wn        Kk  	  R # rX   )	r   r   r   rs   r   r   r   r   r   )r   	cell_dictr   r   r   rG   Z_StringifierDict.transmogrify  s]    $$C&CM'+C$#**C00!..#' $)=( %r   c                sX    R V P                    R2pV ;P                   ^,          un         V# )Z__annotationlib_name_Z__)r   )r   r,   rW   r   r   Z#_StringifierDict.create_unique_name  s'    &t||nB7r   )r)   r&   r   r   r   r   r   )r   r   r   r   r!   r   rG   r   r   rm   Z__classcell__)r   ro   s   @@r   rF   rF     s3     T   	) r   rF   r   c               s    \        WVRR7      # )zCall an evaluate function. Evaluate functions are normally generated for
the value of type aliases and the bounds, constraints, and defaults of
type parameter objects.
T)r   _is_evaluate)call_annotate_function)rL   r)   r   s   &&$r   call_evaluate_functionr     s    
 "(%dSSr   r   Fc          	     s   V\         P                  8X  d   \        R4      h V ! V4      #   \         d     Mi ; iT\         P                  8X  Ed    T ! \         P                  4       M<  \         d#    \        T ! \         P                  4      4      u # \         d     Mi ; i\        / TR7      p\        T\        4      p\        YYTRR7      w  rg\        P                  ! T P                  TTT P                  T P                   R7      pT! \         P                  4      p	T'       d   \#        T	4      # T	P%                  4        U
Uu/ uF  w  rT
\#        T4      bK  	  upp
# u upp
i T\         P&                  8X  Ed   / T P(                  CT P*                  Cp\        T\        4      p\        TT P*                  TTTR7      p\        YYTRR7      w  rm\        P                  ! T P                  TTT P                  T P                   R7      p T! \         P                  4      pTP-                  T4       T#   \         d    T ! \         P                  4      u # \         d     Mi ; i\        / T P*                  TTTR7      p\        YYTRR7      w  rm\        P                  ! T P                  TTT P                  T P                   R7      pT! \         P                  4      pTP-                  T4       T'       d9   \        T\.        4      '       d!   TP1                  \         P&                  R7      # T# TP%                  4        U
Uu/ uF>  w  rT
\        T\.        4      '       d!   TP1                  \         P&                  R7      MTbK@  	  upp
# u upp
i T\         P                  8X  d   \3        R4      h\        R	T: 24      h)
aZ  Call an __annotate__ function. __annotate__ functions are normally
generated by the compiler to defer the evaluation of annotations. They
can be called with any of the format arguments in the Format enum, but
compiler-generated __annotate__ functions only support the VALUE format.
This function provides additional functionality to call __annotate__
functions with the FORWARDREF and STRING formats.

*annotate* must be an __annotate__ function, which takes a single argument
and returns a dict of annotations.

*format* must be a member of the Format enum or one of the corresponding
integer values.

*owner* can be the object that owns the annotations (i.e., the module,
class, or function that the __annotate__ function derives from). With the
FORWARDREF format, it is used to provide better evaluation capabilities
on the generated ForwardRef objects.

;The VALUE_WITH_FAKE_GLOBALS format is for internal use only)r)   F)allow_evaluation)closureZargdefsZ
kwdefaultsr-   Tz/annotate function does not support VALUE formatzInvalid format: )r    r   r3   r/   r
   annotations_to_stringr   rE   rF   r   r8   _build_closurer0   FunctionTyper   Z__defaults__Z__kwdefaults___stringify_singler>   r	   Z__builtins__r   rG   r   rL   ZRuntimeError)annotater)   r   r   r&   r   r   Z_r   Zannosr   Zvalr   r   rK   s   &&$$           r   r   r     s   ( ///VWW 	V334" 	A(&,,)?@@ 		 #2f5eT*#X

 !!))..
 V334$U++ "KKM
) "3'')
 	
 
 
6$$	$$ Fx,,E0D0DE	eT*"((
 ,X
 !!))..
		&889F   +M # 	*FLL)) 		 #((
 ,X
 !!))..
 f445Y'&*--f.?.?@@ !' !/HC !#z22 LL(9(9L:
 !/   
6<<	 LMM+F:677sU   * 88A) )*B"B"B"!B"E"H5 5!I%I%!I%$I%ANc          
      s   V P                   '       g   R# . p/ p\        V P                  P                  V P                   RR7       F  w  rxWV&   R p	V'       d    VP                   Tp	V	fM   \        VVVV P                  VVR7      p
VP                  P                  V
4       \        P                  ! V
4      p	VP                  V	4       K  	  \        V4      V3#   \
         d     Li ; i)NT)Zstrict)rJ   r   r&   r   ru   )NN)Z__closure__Zzipr   Zco_freevarsr2   r3   rq   r   r   rh   r0   r1   rZ   )r   r   r   ru   r   Znew_closurer   r,   rJ   Znew_cellr   s   &&&&$      r   r   r   U  s    KI(++779M9MVZ[
$ ""  ! ,,!!1F ))008~~f-H8$+ \, y((!  s   CC'&C'c                 s    V R J d   R# \        V \        4      '       d   V # \        V \        4      '       d    \        P                  ! \        V 4      4      # \        V 4      # )....)r   r   rz   rQ   rR   r{   repr)ZannorT   r   r   r   s  sJ    s{	D#			D)	$	${{+D122Dzr   c                s\     V R,          #   \          d    T P                  RR4      u # i ; i)zRetrieve the annotate function from a class namespace dictionary.

Return None if the namespace does not contain an annotate function.
This is useful in metaclass ``__new__`` methods to retrieve the annotate function.
r   Z__annotate_func__N)r   r7   )r   rT   r   !get_annotate_from_class_namespacer     s3    2>"" 2ww*D112s    ++r&   r'   eval_strr)   c          
     sB   V'       d!   V\         P                  8w  d   \        R4      hT;\         P                  8X  d    \        V 4      pVf   \	        W4      pM;\         P
                  8X  d9     \        V 4      pVe   \        V4      #  \	        W4      pVf   \        V 4      pMy;\         P                  8X  d6    \	        W4      pVe   \        V4      # \        V 4      pVe;   \        V4      # \         P                  8X  d   \        R4      h \        RV: 24      hVf9   \        V \        4      '       g   \        V 4      '       d   / # \        V : R24      hV'       g   / # V'       g   \        V4      # Ve   VEfs   \        V \        4      '       dd   Rp\        V RR4      pV'       d6   \         P"                  P%                  VR4      pV'       d   \        VRR4      p\        \'        V 4      4      p	T p
MY\        V \(        P*                  4      '       d   \        V R4      pRp	Rp
M(\        V 4      '       d   \        V RR4      pRp	T p
MR;p;rV
e    \-        V
R	4      '       d   V
P.                  p
K!  \         P"                  P%                  R
4      ;p'       d*   \        WP0                  4      '       d   V
P2                  p
Kq   \-        T
R4      '       d   T
P4                  pVf   TpVf   T	p\        V RR4      ;p'       d*   Vf   / pV Uu/ uF  qP6                  VbK  	  upV,          pVP9                  4        UUu/ uF3  w  rT\        V\:        4      '       g   TM\=        \?        V4      W4      bK5  	  pppV#   \         d     ELi ; iu upi u uppi )a  Compute the annotations dict for an object.

obj may be a callable, class, module, or other object with
__annotate__ or __annotations__ attributes.
Passing any other object raises TypeError.

The *format* parameter controls the format in which annotations are returned,
and must be a member of the Format enum or its integer equivalent.
For the VALUE format, the __annotations__ is tried first; if it
does not exist, the __annotate__ function is called. The
FORWARDREF format uses __annotations__ if it exists and can be
evaluated, and otherwise falls back to calling the __annotate__ function.
The SOURCE format tries __annotate__ first, and falls back to
using __annotations__, stringified using annotations_to_string().

This function handles several details for you:

  * If eval_str is true, values of type str will
    be un-stringized using eval().  This is intended
    for use with stringized annotations
    ("from __future__ import annotations").
  * If obj doesn't have an annotations dict, returns an
    empty dict.  (Functions and methods always have an
    annotations dict; classes, modules, and other types of
    callables may not.)
  * Ignores inherited annotations on classes.  If a class
    doesn't have its own annotations dict, returns an empty dict.
  * All accesses to object members and dict values are done
    using getattr() and dict.get() for safety.
  * Always, always, always returns a freshly-created dict.

eval_str controls whether or not values of type str are replaced
with the result of calling eval() on those values:

  * If eval_str is true, eval() is called on values of type str.
  * If eval_str is false (the default), values of type str are unchanged.

globals and locals are passed in to eval(); see the documentation
for eval() for more information.  If either globals or locals is
None, this function may replace that value with a context-specific
default, contingent on type(obj):

  * If obj is a module, globals defaults to obj.__dict__.
  * If obj is a class, globals defaults to
    sys.modules[obj.__module__].__dict__ and locals
    defaults to the obj class namespace.
  * If obj is a callable, globals defaults to obj.__globals__,
    although if obj is a wrapped function (using
    functools.update_wrapper()) it is first unwrapped.
z8eval_str=True is only supported with format=Format.VALUENr   zUnsupported format z does not have annotationsr   r*   r   __wrapped__	functoolsr+   r   ) r    r   r3   _get_dunder_annotations_get_and_call_annotater	   r=   rE   r
   r   r   r   r8   r:   r   r4   r5   r6   r7   r<   r0   r9   r@   r   Zpartialr   r   r   r>   r   rD   rU   )r   r&   r'   r   r)   annZobj_globalsrH   r   Z
obj_localsZunwrapr   r(   rI   r   rx   Zreturn_values   &$$$$            r   get_annotationsr     s>   j Ffll*STT
V\\)#.C {,S9V%-c2 ?9$ # )5C{ .c2V]](5CCy )#.C,S11++Z[[26*=>>
{c4  HSMMI3'!;<==	Cy&.c4  K!#|T:Kd;")&*d"CKd3iJFU--..!#z2KJFc]] "#}d;KJF044K4*6=11#//F # <<9<!&*;*;<<!' v}--$00?!G>F
 c#4b99{9>F5@A[E..%'[AFJ
 ))+ &JC 	*UC00U&u-w?	@%  
   p Bs   2N N9NNNc                sp   \        V \        \        P                  \        P                  34      '       d9   V P
                  R8X  d   V P                  # V P
                   RV P                   2# \        V \        4      '       d"   \        V 4      p\        P                  ! V4      # V RJ d   R# \        V 4      # )a  Convert a Python value to a format suitable for use with the STRING format.

This is intended as a helper for tools that support the STRING format but do
not have access to the code that originally produced the annotations. It uses
repr() for most objects.

rA   Z..r   )r   r8   r0   r   ZBuiltinFunctionTyper   r   rz   r{   rQ   rR   r   )rx   ZtreerW   r   	type_reprr   1  s     %$ 2 2E4M4MNOOz)%%%""#1U%7%7$899	E9	%	%&{{4  |;r   c           	     s    V P                  4        UUu/ uF)  w  rT\        V\        4      '       d   TM
\        V4      bK+  	  upp# u uppi )zwConvert an annotation dict containing values to approximately the STRING format.

Always returns a fresh a dictionary.
)r>   r   r   r   )ZannotationsZnZtr_   r   r   r   E  sK      %%''DA 	

1c""1	!4'  s   /Ac                s\    V P                  4       P                  R4      '       d   RV  R2# V # )zlIf the given argument annotation expression is a star unpack e.g. `'*Ts'`
rewrite it to a valid expression.
Z*r   z,)[0])ZlstripZ
startswith)r    rT   r   rU   rU   P  s.     zz|s##3%u~
r   c                s    \        V RR4      pVe5   \        W!V R7      p\        V\        4      '       g   \	        V : R24      hV# R# )zOGet the __annotate__ function and call it.

May not return a fresh dictionary.
r   N)r   z!.__annotate__ returned a non-dict)r4   r   r   r=   r3   )r   r)   r   r   r]   r   r   r   Z  sL    
 sND1H$XSA#t$$w&GHII
r   __annotations__c                s    \        V \        4      '       d    \        V 4      pM\	        V RR4      pVf   R# \        V\
        4      '       g   \        V : R24      hV#   \         d     R# i ; i)zmReturn the annotations for an object, checking that it is a dictionary.

Does not return a fresh dictionary.
Nr   z+.__annotations__ is neither a dict nor None)r   r8   _BASE_GET_ANNOTATIONSZAttributeErrorr4   r=   r3   )r   r   rW   r   r   r   k  sr     #t	',C
 c,d3;c4  C7"MNOOJ  		s   A A-,A-)r    r   r   r   r   r   r   r   )r   r   r   Z__weakref__r   r   r   r   r   r   r   rs   )rf   r   )&rj   rQ   rA   Zenumr?   r5   r0   Z__all__ZIntEnumr    ZobjectrO   rB   rk   r   r8   rz   rq   r   r   r{   r=   rF   r   r   r   r   r   r   r   r   r   rU   r   r*   Z__get__r   r   r   r   r   <module>r      s   9 
    
 	T\\  H	5
 OG OGd I	~ ~BJ**,6*#t #LTd TY8d Y8 Y8x)<		2cc!%c05c>DllcL( &78@@ r   