+
    i~                    D  a  0 t $ R t^ RIHt ^ RIt^ RIt^ RIt^ RIH	t	H
t
HtHt ^ RIHtHtHt ^ RIHtHtHtHt ^ RIHt ^ RIHt ^ RIHtHt ^ R	IHtHtH t H!t!H"t" ^ R
I#H$t$ ^ RI%H&t&H't'H(t( ]'       d   ]! R]PR                  ]PT                  4      t+Rt,R]PZ                  R]P\                  R]P^                  R]P`                  /t1R]2R&   R R lt3R t4R t5R t6R t7R t8RR RR RR RR  R!R" R#R$ R%R& R'R( R)R* R+R, R-R. R/R0 R1]Pr                  /t:];! ]:Py                  4       4       F  w  t=t>]>]:]=R2,           &   K  	  ]P~                  R3 R4 l4       t@R5 R6 ltAR7 R8 ltB]P~                  R9 R: l4       tC]P~                  R; R< l4       tD R= tE]P                  R^R> R? ll4       tGR^R@ RA lltHR^RB RC lltIRD RE ltJR^RF RG lltK]P                  R^RH RI ll4       tLR^RJ RK lltMRL tN]P                  R^RM RN ll4       tORO tP]P                  R^RP RQ ll4       tQ]P                  R_RR RS ll4       tR]P~                  R^RT RU ll4       tS]P~                  R_RV RW ll4       tT]P~                  R_RX RY ll4       tU]P~                  R_RZ R[ ll4       tV]P~                  R_R\ R] ll4       tWR# )`zcThis module contains a set of functions to handle python protocols for nodes
where it makes sense.
)annotationsN)Callable	GeneratorIteratorSequence)TYPE_CHECKINGAnyTypeVar)bases
decoratorsnodesutil)extract_node)Context)InferenceContextcopy_context)AstroidIndexErrorAstroidTypeErrorAttributeInferenceErrorInferenceError	NoDefault)node_classes)ConstFactoryResultInferenceResultSuccessfulInferenceResult_TupleListNodeTzcontextlib.contextmanager+-~notzdict[str, Callable[[Any], Any]]_UNARY_OPERATORSc               $    V ^8  d   QhRRRRRR/# )   objr   opstrreturnr    )formats   "3/usr/lib/python3/dist-packages/astroid/protocols.py__annotate__r*   0   s"     
& 
& 
&# 
&*< 
&    c                r    V \         J d   T pM\        V,          pV! V 4      p\        P                  ! V4      # )zsPerform unary operation on `obj`, unless it is `NotImplemented`.

Can raise TypeError if operation is unsupported.
)NotImplementedr    r   const_factory)r#   r$   valuefuncs   &&  r)   _infer_unary_opr1   0   s5    
 n#S	u%%r+   c                @    \        \        V P                  4      V4      # N)r1   tupleeltsselfr$   s   &&r)   tuple_infer_unary_opr8   =   s    5+R00r+   c                .    \        V P                  V4      # r3   )r1   r5   r6   s   &&r)   list_infer_unary_opr:   A   s    499b))r+   c                @    \        \        V P                  4      V4      # r3   )r1   setr5   r6   s   &&r)   set_infer_unary_opr=   E   s    3tyy>2..r+   c                .    \        V P                  V4      # r3   )r1   r/   r6   s   &&r)   const_infer_unary_opr?   I   s    4::r**r+   c                @    \        \        V P                  4      V4      # r3   )r1   dictitemsr6   s   &&r)   dict_infer_unary_oprC   M   s    4

+R00r+   c                    W,           # r3   r'   abs   &&r)   <lambda>rH   T       aer+   c                    W,
          # r3   r'   rE   s   &&r)   rH   rH   U   rI   r+   /c                    W,          # r3   r'   rE   s   &&r)   rH   rH   V   rI   r+   z//c                    W,          # r3   r'   rE   s   &&r)   rH   rH   W       qvr+   *c                    W,          # r3   r'   rE   s   &&r)   rH   rH   X   rI   r+   **c                    W,          # r3   r'   rE   s   &&r)   rH   rH   Y   s    qtr+   %c                    W,          # r3   r'   rE   s   &&r)   rH   rH   Z   rI   r+   &c                    W,          # r3   r'   rE   s   &&r)   rH   rH   [   rI   r+   |c                    W,          # r3   r'   rE   s   &&r)   rH   rH   \   rI   r+   ^c                    W,          # r3   r'   rE   s   &&r)   rH   rH   ]   rI   r+   z<<c                    W,          # r3   r'   rE   s   &&r)   rH   rH   ^   rN   r+   z>>c                    W,	          # r3   r'   rE   s   &&r)   rH   rH   _   rN   r+   @=c               4    V ^8  d   QhRRRRRRRRR	R
RRRR/# )r"   r7   znodes.Constopnodenodes.AugAssign | nodes.BinOpoperatorr%   otherr   contextr   _r   r&   z4Generator[ConstFactoryResult | util.UninferableBase]r'   )r(   s   "r)   r*   r*   g   sN     ! !
!)! ! 	!
 ! !! :!r+   c              #    "   \         P                  ! \        4      p\        V\         P                  4      '       d   VR 8X  du   \        V P                  \
        \        34      '       dO   \        VP                  \
        \        34      '       d)   V P                  R8  g   VP                  R8  d   Vx  R#  \        V,          p \         P                  ! V! V P                  VP                  4      4      x  R# \        V P                  \        4      '       d   VR8X  d   \        P                  x  R# Vx  R#   \         d	    Tx   R# \         d    \        P                  x   R# i ; i  \         d	    Tx   R# i ; i5i)rQ   g     j@NrS   )r   Constr-   
isinstancer/   intfloatBIN_OP_IMPLr.   	TypeError	Exceptionr   Uninferabler%   )r7   r`   rb   rc   rd   re   not_implementedimpls   &&&&&&  r)   const_infer_binary_oprq   f   s     kk.1O%%%4::U|445;;e55c!U[[3%6!!
	"x(D'))$tzz5;;*GHH 
DJJ	$	$S  &%% '&&&' 	"!!	"sg   B6F9E2 3D= :AF=E/E2 FE/E/+E2 ,F.E//E2 2FFFFc          
     ,    V ^8  d   QhRRRRRRRRR	R/# )
r"   r7   r   r`   ra   r/   ri   rd   r   r&   r'   )r(   s   "r)   r*   r*      s:      
)  	
 r+   c                <  a V P                  VR 7      pV^ 8  d   V P                  '       g
   . Vn        V# \        V P                  4      V,          R8  d   \        P                  .Vn        V# V3R lV P                   4       p\        V4      V,          Vn        V# )parentg    חAc              3     <"   T FV  p\        V\        P                  4      '       d   K%  \        P                  ! VS4      ;'       g    \        P                  x  KX  	  R # 5ir3   )rh   r   UninferableBase
safe_inferrn   ).0eltrd   s   & r)   	<genexpr>'_multiply_seq_by_int.<locals>.<genexpr>   sF      C#t334 	:W%99)9)99s   "A!A!A!)	__class__r5   lenr   rn   list)r7   r`   r/   rd   nodefiltered_eltss   &&&f  r)   _multiply_seq_by_intr      s     >>>(DAI$)))	
499~#%%&	99M
 ]#e+DIKr+   c               $    V ^8  d   QhRRRRRR/# )r"   r5   zSequence[InferenceResult]rd   r   r&   z#Iterator[SuccessfulInferenceResult]r'   )r(   s   "r)   r*   r*      s$     : :
#:.>:(:r+   c              #  (  "   V  F  p\        V\        P                  4      '       d   \        P                  x  K7  VP                  V4       F;  p\        V\        P                  4      '       g   Vx  K)  \        P                  x  K=  	  K  	  R # 5ir3   )rh   r   rw   r   UNATTACHED_UNKNOWNinfer)r5   rd   rz   inferreds   &&  r)   _filter_uninferable_nodesr      sg      c4//00111IIg.!(D,@,@AA"N&999	 /	 s   BBc               4    V ^8  d   QhRRRRRRRRR	R
RRRR/# )r"   r7   r   r`   ra   rb   r%   rc   r   rd   r   methodr   r&   z?Generator[_TupleListNodeT | nodes.Const | util.UninferableBase]r'   )r(   s   "r)   r*   r*      sO     , ,
,), , 	,
 , &, E,r+   c           	   #  v  "   ^ RI Hp RVn        \        P                  ! \
        4      p\        W0P                  4      '       dm   VR8X  df   V P                  VR7      p\        \        P                  ! \        V P                  V4      \        VP                  V4      4      4      Vn        Vx  R# \        V\        P                  4      '       dI   VR8X  dB   \        VP                  \        4      '       g   Vx  R# \        WVP                  V4      x  R# \        V\         P"                  4      '       d{   VR8X  dt   VP%                  V4      p	V	'       g   \&        P(                  x  R# \        V	P                  \        4      '       g   \+        R4      h\        WV	P                  V4      x  R# Vx  R# 5i)zInfer a binary operation on a tuple or list.

The instance on which the binary operation is performed is a tuple
or list. This refers to the left-hand side of the operation, so:
'tuple() + 1' or '[] + A()'
)helpersNr   rt   rO   zPlease open a bug report.)astroidr   	boundnoder   rg   r-   rh   r}   r   	itertoolschainr   r5   r/   ri   r   r
   Instanceclass_instance_as_indexr   rn   AssertionError)
r7   r`   rb   rc   rd   r   r   ro   r   as_indexs
   &&&&&&    r)   tl_infer_binary_opr      s2       Gkk.1O%((X_~~V~,OO)$))W=)%**g>
	 
	E5;;	'	'HO%++s++!!"4gFF	E5>>	*	*x32259"""HNNC00 !<==&tX^^WMMs   EF9A F9c               4    V ^8  d   QhRRRRRRRRR	R
RRRR/# )r"   r7   znodes.ClassDefr`   ra   rb   r%   rc   r   rd   r   r   r   r&   Generator[InferenceResult]r'   )r(   s   "r)   r*   r*      sN     3 3
3)3 3 	3
 3 &3  3r+   c                $    VP                  W4      # r3   )infer_call_result)r7   r`   rb   rc   rd   r   s   &&&&&&r)   instance_class_infer_binary_opr      s     ##D22r+   c              #    "   VR,          pVP                  ^ 4      pV  EF  p\        V\        P                  4      '       d   K&  \	        VR4      '       g   K:   VP                  4       p \        YS,          \        P                  \        P                  34      '       d   T.pT F  p\        P                  ! T4      p TP                  Yr4      pT'       g   Tx  K9  \        T\        P                  4      '       d    K   \        TP!                  T4      Y4       Rj  xL
  K  	  EK  	  R#   \         d     EK!  i ; i  \         d     Li ; i  \        \        \        3 d     K  i ; i LP  \"         d      EKe  i ; i5i)z<Recursive function to resolve multiple assignments on loops.NNNiteredN)poprh   r   rw   hasattrr   rl   r   rg   Name
IndexErrorgetitemAttributeErrorr   r   _resolve_looppartr   r   )	partsassign_pathrd   indexpartr   stmt
index_nodeassigneds	   &&&      r)   r   r      sS    a.KOOAEdD0011tX&&	[[]F	&-%++uzz)BCC DU+J<<
<  Hd&:&:;;0 w/   !    		
  		 #$46GH  & s   AFD1+9E$F EF)FE4!E2"E4&F1E<F EFEFEFE/+F.E//F2E44F?FFFc          
     ,    V ^8  d   QhRRRRRRRRR	R
/# )r"   r7   znodes.For | nodes.Comprehensionr   &node_classes.AssignedStmtsPossibleNoderd   InferenceContext | Noner   list[int] | Noner&   r   r'   )r(   s   "r)   r*   r*   #  s:      
)
0 % "	
 	r+   c              #    "   \        V \        P                  4      '       g   \        V R R4      '       d   RV RVRVRV/# Vfj   V P                  P                  V4       FI  p\        V\        P                  \        P                  34      '       g   K5  VP                   Rj  xL
  KK  	  M-\        V P                  P                  V4      W24       Rj  xL
  RV RVRVRV/#  L@ L5i)is_asyncFr   unknownr   rd   N)
rh   r   AsyncForgetattriterr   TupleListr5   r   )r7   r   rd   r   lsts   &&&& r)   for_assigned_stmtsr   "  s      $''74U+K+K Dt;w	
 	
 99??7+C#UZZ89988## , %TYY__W%={TTT4{7	  $Ts*   BC(C(#C$$1C(C&C(&C(c          
     ,    V ^8  d   QhRRRRRRRRR	R
/# )r"   r7   znodes.Tuple | nodes.Listr   r   rd   r   r   r   r&   r   r'   )r(   s   "r)   r*   r*   ?  s:      
"
0 % "	
 	r+   c                    Vf   . p V P                   P                  V4      pTP	                  ^ T4       T P
                  P                  YTR7      #   \         d   p\        RT TTR7      ThR p?ii ; i)Nz6Tried to retrieve a node {node!r} which does not existr   r   rd   )r   rd   r   )r5   r   
ValueErrorr   insertru   assigned_stmts)r7   r   rd   r   r   excs   &&&&  r)   sequence_assigned_stmtsr   ?  s     		% q% ;;%% &    D#	

 	s   A A2A--A2c          
     ,    V ^8  d   QhRRRRRRRRR	R
/# )r"   r7   z#nodes.AssignName | nodes.AssignAttrr   r   rd   r   r   r   r&   r   r'   )r(   s   "r)   r*   r*   W  sA     B B
-B
0B %B "	B
 	Br+   c                :    V P                   P                  WR 7      # ))r   rd   )ru   r   r7   r   rd   r   s   &&&&r)   assend_assigned_stmtsr   W  s     ;;%%4%AAr+   c               $    V ^8  d   QhRRRRRR/# )r"   namez
str | Nonerd   r   r&   r   r'   )r(   s   "r)   r*   r*   `  s$     = ==%5==r+   c              #    "   ^ RI Hp V P                  '       g   \        P                  x  R# V P                   Uu. uF-  qDP                  V P
                  V P                  39  g   K+  VNK/  	  ppV P                  P                  pV'       Ed   \        V P                  ^ ,          RR4      V8X  d   VR8w  d   V P                  P                  P                  4       p\        V\        P                  4      ;'       d    VP                  R8H  pVP                  '       dA   \        VP                  \        P                   4      '       d   VP                  P"                  pV'       g   VR8X  d   Vx  R# VR8X  d   VP%                  4       x  R# V'       d   VP&                  '       d   VP&                  P(                  p	\+        V	R4      '       d   V	P"                  p	K   \        V	RR4      V P                  P                  8X  dM   VP-                  VP&                  VP.                  4      p
V
P1                  V P                  W4       Rj  xL
  R# WP
                  8X  d   \        P2                  ! R
4      pWn        V'       gV   V P                  P                  R	8X  d;   V P                  P                  P                  4       pVP%                  4       .Vn        Vx  R# WP                  8X  d#   \        P2                  ! / 4      pWn        Vx  R#  \7        V4      pV P9                  V4      P;                  V4       Rj  xL
  \        P                  x  R# u upi  EL L   \<         d    \        P                  x   R# i ; i5i)    	argumentsNr   staticmethod	metaclassclassmethodr   _proxied__init__r'   )r   r   r   rn   r   varargkwargru   typer   scoperh   r   ClassDefr   r
   r   r   instantiate_classcallcontextcalleer   CallSiteextra_contextinfer_argumentr.   r5   r   default_valuer   r   )r7   r   rd   r   argargsfunctypeclsis_metaclassr   	call_siter   r   s   &&&          r)   _arguments_infer_argnamer   `  s    
 ">>>>>W>CXXdkk4::=V-VCC>DW{{H 	DNN1%vt4<&kk  &&(!#u~~6RR388{;R G,=,=u~~!N!N##,,C8}4Ix''))7&&&$$++fj))__F664(DKK,<,<<!**7+>+>@U@UVI //TKKK{{$$R(((J6++$$**,C0023FKzz##B'w'%%d+11':::a X6 L( 	; sz   ;N(M*M0BN !N"AN*/NN,B!NM"CN.M' M%M' N%M' 'NNNNc          
     ,    V ^8  d   QhRRRRRRRRR	R
/# )r"   r7   znodes.Argumentsr   r   rd   r   r   r   r&   r   r'   )r(   s   "r)   r*   r*     s:     > >
>
0> %> "	>
 	>r+   c                   ^ RI Hp  VP                  pV'       dJ   VP                  '       d8   VP                  P
                  p\        VR4      '       d   VP                  pK   M\        WV4      # V'       dw   \        VRR4      VP                  4       P                  8X  dM   VP                  p\        V4      pRVn        VP                  WrR7      pVP                  V P                  WR4      # \        WV4      #   \         d    Rp Li ; i)r   r   Nr   r   rd   )r   r   r   r   r   r   r   r   r   r   framer   r   r   ru   )	r7   r   rd   r   r   	node_namer   r   r   s	   &&&&     r)   arguments_assigned_stmtsr     s     "II	 7&&&$$++fj))__F * (AA-1B1BB))w'"!!+!?""4;;	CC#DW==%   	s   C; ;D
Dc          
     ,    V ^8  d   QhRRRRRRRRR	R
/# )r"   r7   zBnodes.AugAssign | nodes.Assign | nodes.AnnAssign | nodes.TypeAliasr   r   rd   r   r   r   r&   r   r'   )r(   s   "r)   r*   r*     s:      
L
0 % "	
 	r+   c              #     "   V'       g   V P                   x  R # \        V P                   P                  V4      W24       R j  xL
  RV RVRVRV/#  L5i)Nr   r   r   rd   )r/   _resolve_assignment_partsr   r   s   &&&&r)   assign_assigned_stmtsr     sb      jj(

!;  
 	4{7	 	s   AAAAc          
     ,    V ^8  d   QhRRRRRRRRR	R
/# )r"   r7   znodes.AnnAssignr   r   rd   r   r   r   r&   r   r'   )r(   s   "r)   r*   r*     s:     
 



0
 %
 "	

 	
r+   c              #  l   "   \        WW#4       F  pVf   \        P                  x  K  Vx  K!  	  R # 5ir3   )r   r   rn   )r7   r   rd   r   r   s   &&&& r)   assign_annassigned_stmtsr     s0      *$gK"""N	 Ls   24c              #  |  "   VR,          pVP                  ^ 4      pV  F  pRp\        V\        P                  4      '       d    VP                  V,          w  rVM:\        VR4      '       d)   \        P                  ! V4      p VP                  Wr4      pV'       g    R# V'       g   Vx  K  \        V\        P                  4      '       d    R#  \        VP                  V4      W4       Rj  xL
  K  	  R#   \
         d      R# i ; i  \        \        3 d      R# i ; i L6  \         d      R# i ; i5i)z3Recursive function to resolve multiple assignments.r   Nr   )r   rh   r   DictrB   r   r   rg   r   r   r   r   rw   r   r   r   )r   r   rd   r   r   r   re   r   s   &&&     r)   r   r     s    a.KOOAEdEJJ''"jj/! T9%%U+J<<
<  N$"6"6774NN7+[  ;    %&78   " s   AD<C;)D<DD<
D<()D<D)0D'1D)5D<;DD<
DD<D$D<#D$$D<'D))D94D<8D99D<c          
     ,    V ^8  d   QhRRRRRRRRR	R
/# )r"   r7   znodes.ExceptHandlerr   r   rd   r   r   r   r&   r   r'   )r(   s   "r)   r*   r*     s:     # #
#
0# %# "	#
 	#r+   c              #    a a"   ^ RI Ho VV 3R lp\        S P                  \        P
                  4      '       dq   \        \        P                  ! \        R4      4      4      pSP                  V4      p\        P                  P                  V! 4       4      .VP                  R&   Vx  MV! 4        Rj  xL
  RS RVRVR	V/#  L5i)
r   )objectsc               3     <"   \         P                  ! SP                  4       F8  p \        V \        P
                  4      '       d   SP                  V 4      p V x  K:  	  R # 5ir3   )r   unpack_inferr   rh   r   r   ExceptionInstance)r   r   r7   s    r)   _generate_assigned8excepthandler_assigned_stmts.<locals>._generate_assigned  sE     $11$))<H(ENN33"44X>N	 =s   AA"z4
from builtins import ExceptionGroup
ExceptionGroup

exceptionsNr   r   r   rd   )r   r   rh   ru   r   TryStarnextr   r   r   r   r   from_elementsinstance_attrs)r7   r   rd   r   r   egr   r   s   f&&&   @r)   excepthandler_assigned_stmtsr  
  s        $++|3344 ,++L : -   ,,R0JJ$$%7%9:1
- %'''4{7	  	(s   B2C6C7Cc              #    "    \        VP                  VR 7      4      p\	        T\
        P                  4      '       d   TP                  pTP                  '       g   \        RTR7      hTP                  P                   F\  p\        TP                  TR 7      R4      p\	        T\        P                  4      '       g   KA  TP                  4       \        8X  g   K\   M	  \        TR7      h \        TP                  4       4      x  R# \	        T\
        P                  4      '       de    \        TP                  RTR 7      4      p\	        T\
        P"                  4      '       g   \        TR7      hTP%                  Y4       Rj  xL
  R# \        TR7      h  \         d   p\        TR7      ThRp?ii ; i  \         d   p\        TR7      ThRp?ii ; i  \        \         \        3 d   p	\        TR7      T	hRp	?	ii ; i L}5i)r   )r   Nz,No decorators found on inferred generator %s	__enter__)r   r   StopIterationr   rh   r
   r   ru   r   r   FunctionDefqname_CONTEXTLIB_MGRinfer_yield_typesr   igetattrr   BoundMethodr   )
r7   mgrrd   r   er0   decorator_node	decoratorenterr   s
   &&&       r)   _infer_context_managerr  1  s    .		'	23 (EOO,, >T  #oo33N^11'1BDII)U%6%677??$7	 4 !d++	3x11344 
Henn	-	-	9**;*HIE %!2!233 e,,**4999#&&A  .#&A-.(  	3 d+2	3  7G 	9 h/S8	9 	:s   HF =HAHHH-F: "H+G A HHHF7%F22F77H:GGGHH0G==HHc          
     ,    V ^8  d   QhRRRRRRRRR	R
/# )r"   r7   z
nodes.Withr   r   rd   r   r   r   r&   r   r'   )r(   s   "r)   r*   r*   X  sA     L L
L
0L %L "	L
 	Lr+   c              #    a"    \        V3R lV P                   4       4      pTf   \        YT4       Rj  xL
  MX\        YT4       FH  pTpT F9  p\	        TR4      '       g   \        RT STTR7      h TP                  T,          pK;  	  Tx  KJ  	  RT R	SR
TRT/#   \         d     R# i ; i Ly  \         d   p\        RT STTR7      ThRp?i\         d   p\        RT STTR7      ThRp?ii ; i5i)a  Infer names and other nodes from a *with* statement.

This enables only inference for name binding in a *with* statement.
For instance, in the following code, inferring `func` will return
the `ContextManager` class, not whatever ``__enter__`` returns.
We are doing this intentionally, because we consider that the context
manager result is whatever __enter__ returns and what it is binded
using the ``as`` keyword.

    class ContextManager(object):
        def __enter__(self):
            return 42
    with ContextManager() as f:
        pass

    # ContextManager().infer() will return ContextManager
    # f.infer() will return 42.

Arguments:
    self: nodes.With
    node: The target of the assignment, `as (a, b)` in `with foo as (a, b)`.
    context: Inference context used for caching already inferred objects
    assign_path:
        A list of indices, where each index specifies what item to fetch from
        the inference results.
c              3  >   <"   T F  w  rVS8X  g   K  Vx  K  	  R # 5ir3   r'   )ry   r  varsr   s   &  r)   r{   &with_assigned_stmts.<locals>.<genexpr>y  s     E*;C33*s   
Nr5   z0Wrong type ({targets!r}) for {node!r} assignment)r   targetsr   rd   zCTried to infer a nonexistent target with index {index} in {node!r}.z1Tried to unpack a non-iterable value in {node!r}.r   r   r   rd   )	r   rB   r  r  r   r   r5   r   rl   )	r7   r   rd   r   r  resultr#   r   r   s	   &f&&     r)   with_assigned_stmtsr  W  s6    BE$**EE )$W===,T@FC$sF++(J! $$/ ' ((5/C %8 I? AB 	4{7	 K   	>  " ('! $$/ '  ! (K! $$/ ' sg   C6B C6B1=C66B3	C6B.*C6-B..C63C3>CC3C3C..C33C6c          
     ,    V ^8  d   QhRRRRRRRRR	R
/# )r"   r7   znodes.NamedExprr   r   rd   r   r   r   r&   r   r'   )r(   s   "r)   r*   r*     s:     
 



0
 %
 "	

 	
r+   c              #     "   V P                   V8X  d'   V P                  P                  VR7       Rj  xL
  R# \        RV VVR7      h L5i)z:Infer names and other nodes from an assignment expression.r   Nz$Cannot infer NamedExpr node {node!r}r   )targetr/   r   r   r   s   &&&&r)   named_expr_assigned_stmtsr    sL      {{d::##G#4442#	
 	
 	5s   1AA	Ac          
     ,    V ^8  d   QhRRRRRRRRR	R
/# )r"   r7   nodes.Starredr   r   rd   r   r   r   r&   r   r'   )r(   s   "r)   r*   r*     sA     B B
B
0B %B "	B
 	Br+   c           	   #    a"   R V3R lloV P                  4       p\        V\        P                  \        P                  34      '       g   \        RV VVVR7      hVf   \        4       p\        V\        P                  4      '       EdI   VP                  pVP                  ^ ,          p\        V\        P                  4      '       g   \        P                  x  R# \        R VP                  \        P                  4       4       4      ^8  d   \        RV VVVR7      h \        VP!                  V4      4      p\        T\        P$                  4      '       g   \'        TR	4      '       g   \        P                  x  R#  \(        P*                  ! TP-                  4       4      p\1        TP2                  4       EF  w  r\        T
\        P                  4      '       g   T'       g    MTP5                  4        KB  \(        P*                  ! \7        TP2                  T	R 4      4      pT F  p\        T\        P                  4      '       g   T'       g    K  TP9                  4        K@  \        P:                  ! \<        P>                  T TP@                  TPB                  R
7      pTPE                  \G        T4      R7       Tx   EK  	  EK  	  \        V\        P                  4      '       Ed    \        VPH                  P!                  VR7      4      p\        T\        P$                  4      '       g   \'        TR	4      '       g   \        P                  x  R#  TP-                  4       pTPJ                  p\        T\        PL                  4      '       g   \        R\O        T4      : 2TR7      h. pS! T TT4       T'       g   \        RTR7      hTR,          w  ppTT^,
          8H  p\Q        TT'       d   RMTT,
          4      pTpT F  pRp\1        T4       FX  w  p	p\'        TR	4      '       g    MBT	^,           \S        T4      J d   TpM	T^ ,          p TP-                  4       pTT,          pTpKZ  	  \        P:                  ! \<        P>                  T T P@                  T PB                  R
7      pTPE                  T;'       g    . R7       Tx   R# 	  \        P                  x  R# R#   \
        \"        3 d    \        P                  x   R# i ; i  \.         d    \        P                  x   R# i ; i  \
        \"        3 d    \        P                  x   R# i ; i  \.         d    \        P                  x   R# i ; i  \T         d      EK#  \.         d    \        P                  x     R# i ; i5i)a$  
Arguments:
    self: nodes.Starred
    node: a node related to the current underlying Node.
    context: Inference context used for caching already inferred objects
    assign_path:
        A list of indices, where each index specifies what item to fetch from
        the inference results.
c               (    V ^8  d   QhRRRRRRRR/# )	r"   starredr  r  znodes.Tuplelookupszlist[tuple[int, int]]r&   Noner'   )r(   s   "r)   r*   ,starred_assigned_stmts.<locals>.__annotate__  s2     P PP(3P>SP	Pr+   c                  < VP                  4       p\        V4       F  w  rE\        V\        P                  4      '       dO   VP
                  P                  V P
                  P                  8X  d    VP                  V\        V4      34        R # \        V\        P                  4      '       g   K  VP                  V\        VP                  4       4      34       S! WV4       K  	  R # r3   )
r   	enumeraterh   r   Starredr/   r   appendr~   r   )r!  r  r"  r   r   element$_determine_starred_iteration_lookupss   &&&   r)   r*  Dstarred_assigned_stmts.<locals>._determine_starred_iteration_lookups  s     '/NE7EMM22MM&&'--*<*<<s6{34'5;;//s7>>+;'<=>4WwO 0r+   zDStatement {stmt!r} enclosing {node!r} must be an Assign or For node.)r   r   r   rd   Nc              3  &   "   T F  p^x  K	  	  R# 5i)   Nr'   )ry   re   s   & r)   r{   )starred_assigned_stmts.<locals>.<genexpr>  s     <;Qq;s   z=Too many starred arguments in the assignment targets {lhs!r}.)r   r  r   rd   r   )ctxru   lineno
col_offset)r5   r   z>Could not make sense of this, the target must be a tuple, not z5Could not make sense of this, needs at least a lookup)+	statementrh   r   AssignForr   r   r/   r  BaseContainerr   rn   sumnodes_of_classr'  r   r   r  rw   r   collectionsdequer   rl   r&  r5   popleftreversedr   r   r   Storer0  r1  postinitr   r   r  r   r   slicer~   r   )r7   r   rd   r   r   r/   lhsrhsr5   r   	left_nodelhs_elts
right_nodepackedinferred_iterabler   r  r"  last_element_indexlast_element_lengthis_starred_lastlookup_slicelast_lookupr)  found_elementlookup
cur_lookupitered_inner_elementunpackedr*  s   &&&&                         @r)   starred_assigned_stmtsrQ    s    &P P  >>DdU\\599566R
 	
 "$$%%

ll1o#u2233"""<#,,U]];<<q@ O 	u{{7+,C c4//00X8N8N"""	$$SZZ\2D !*#(( 3Ei77"((#((562B)CDH&
!*emm<<HHJ ::"~~	 T$Z0! ' !42 $		""	 $TYY__W_%E F ')=)=>>gxG
 G
 """	&--/F
 &%++.. PQUV\Q]P`a 
 *,,T67C GQX 
 3:"+//,1Dq1HI#D*=@R*R
 #G !M!*7!3vw1119G,.9J "(J
,+2>>+;(2:>G %,M% "4( zzMM{{??	H =#6#6B7NQ T i #[ . 	"""	  	"""	N . 	"""	  	"""	h "   ***s   D W$S5 >AW$T )AW,A,WBW6%U AW"U- 2AWBWV8AW'W5#TWTWU <W?U  W#U*&W)U**W-V
WVWWW!W*W=WWWc          
     ,    V ^8  d   QhRRRRRRRRR	R
/# )r"   r7   znodes.MatchMappingr   nodes.AssignNamerd   r   r   r#  r&   Generator[nodes.NodeNG]r'   )r(   s   "r)   r*   r*     s:     

 







 %

 	


 

r+   c              #     "   R# 5izZReturn empty generator (return -> raises StopIteration) so inferred value
is Uninferable.
Nr'   r   s   &&&&r)   match_mapping_assigned_stmtsrW    
         c          
     ,    V ^8  d   QhRRRRRRRRR	R
/# )r"   r7   znodes.MatchStarr   rS  rd   r   r   r#  r&   rT  r'   )r(   s   "r)   r*   r*     s:     

 







 %

 	


 

r+   c              #     "   R# 5irV  r'   r   s   &&&&r)   match_star_assigned_stmtsr\    rX  rY  c          
     ,    V ^8  d   QhRRRRRRRRR	R
/# )r"   r7   znodes.MatchAsr   rS  rd   r   r   r#  r&   rT  r'   )r(   s   "r)   r*   r*     s:     ) )
)
) %) 	)
 )r+   c              #  6  "   \        V P                  \        P                  4      '       dk   \        V P                  P                  \        P                  4      '       d5   V P
                  f%   V P                  P                  P                  x  R# R# R# R# 5i)zuInfer MatchAs as the Match subject if it's the only MatchCase pattern
else raise StopIteration to yield Uninferable.
N)rh   ru   r   	MatchCaseMatchpatternsubjectr   s   &&&&r)   match_as_assigned_stmtsrc    sf      	4;;00t{{))5;;77LL kk  ((( ! 8 	1s   BBc          
     ,    V ^8  d   QhRRRRRRRRR	R
/# )r"   r7   z4nodes.TypeVar | nodes.TypeVarTuple | nodes.ParamSpecr   rS  rd   r   r   r#  r&   rT  r'   )r(   s   "r)   r*   r*     s:     	 	
>	
	 %	 		
 	r+   c              #  >   "   \         P                  ! R4      x  R# 5i)zrHack. Return any Node so inference doesn't fail
when evaluating __class_getitem__. Revert if it's causing issues.
N)r   rg   r   s   &&&&r)   generic_type_assigned_stmtsrf    s      ++d
s   )NNN)NN)X__conditional_annotations____doc__
__future__r   r9  r   rb   operator_modcollections.abcr   r   r   r   typingr   r   r	   r   r
   r   r   r   astroid.builderr   astroid.constr   astroid.contextr   r   astroid.exceptionsr   r   r   r   r   astroid.nodesr   astroid.typingr   r   r   r   r   r   r  posneginvertnot_r    __annotations__r1   r8   r:   r=   r?   rC   matmulrk   r   rB   _KEY_IMPLyes_if_nothing_inferredrq   r   r   r   r   r   raise_if_nothing_inferredr   r   r   r   r   r   r   r   r  r  r  r  rQ  rW  r\  rc  rf  )rg  s   @r)   <module>r}     s  
 #    C C . . 2 2 ( ! :  '  /ejjIO- 							<	5 1 
&1*/+1 			
	
				

		 ))+,KD%#Ks
 - ##! $!H,: ##, $,^ ##3 $3	&R %% &80B=@>> %% &*
%P %%# &#L#'L %%L &L^ %%
 &
$ ##B $BJ ##

 $

 ##

 $

 ##) $)" ##	 $	r+   