+
    iS!                    6   R t ^ RIHt ^ RIt^ RIt^ RIt^ RIt^ RIHtH	t	 ^ RI
HtHt ^ RIHt ^ RIHt ^ RIHt ^ RIHt ]! R	4      t]! R
4      tR tR R ltR R lt]P4                  ! 4       '       d   RR R lltRR R lltR# RR R lltRR R lltR# )z(A few useful function/method decorators.)annotationsN)Callable	Generator)	ParamSpecTypeVar)util)InferenceContext)InferenceError)InferenceResult_R_Pc                L    \         P                  ! V 4      RV 3R R ll4       pV# )zReturn the given infer function wrapped to handle the path.

Used to stop inference if the node has already been looked
at for a given `InferenceContext` to prevent infinite recursion
Nc                    V ^8  d   QhRRRR/# )   contextzInferenceContext | Nonereturnr    )formats   "4/usr/lib/python3/dist-packages/astroid/decorators.py__annotate__"path_wrapper.<locals>.__annotate__!   s     " "."	"    c              ;    "   Vf   \        4       pVP                  V 4      '       d   R# \        4       pV! W3/ VB  FJ  pVP                  P                  R8X  d   VP
                  pMTpWd9  g   K5  Vx  VP                  V4       KL  	  R# 5i)z"Wrapper function handling context.NInstance)r   pushset	__class____name___proxiedadd)noder   _funckwargsyieldedresaress   &&&,   r   wrappedpath_wrapper.<locals>.wrapped    sx     
 ?&(G<<%1&1C}}%%3||"	D! 2s   %BAB2B	functoolswraps)funcr&   s   & r   path_wrapperr,      s+     __T15T" "* Nr   c                    V ^8  d   QhRRRR/# r   r+   z(Callable[_P, Generator[InferenceResult]]r   r   )r   s   "r   r   r   9   s      
2-r   c                   a  R  V 3R llpV# )c               $    V ^8  d   QhRRRRRR/# r   args_P.argsr"   	_P.kwargsr   zGenerator[InferenceResult]r   )r   s   "r   r   -yes_if_nothing_inferred.<locals>.__annotate__<   s"     
 
W 
	 
6P 
r   c               ?     <"   S! V / VB p \        V4      x  T R j  xL
  R #   \         d    \        P                  x   R # i ; i L*5i)N)nextStopIterationr   Uninferable)r2   r"   	generatorr+   s   *, r   inner&yes_if_nothing_inferred.<locals>.inner<   sT     $)&)		y/!   	"""	
 	s/   	A& AA
AAAAAr   r+   r;   s   f r   yes_if_nothing_inferredr>   9   s    
 
 Lr   c                    V ^8  d   QhRRRR/# r.   r   )r   s   "r   r   r   K   s      
2-r   c                   a  R  V 3R llpV# )c               $    V ^8  d   QhRRRRRR/# r1   r   )r   s   "r   r   /raise_if_nothing_inferred.<locals>.__annotate__N   s"      W 	 6P r   c               ?  R  <"   S! V / VB p \        V4      x  T Rj  xL
  R#   \         dA   pTP                  '       d   \        R/ TP                  ^ ,          B Th\        R4      ThRp?i\         d)   p\        R\
        P                  ! 4        R24      ThRp?ii ; i L5i)    z3StopIteration raised without any error information.Nz!RecursionError raised with limit .r   )r7   r8   r2   r	   RecursionErrorsysgetrecursionlimit)r2   r"   r:   errorr+   s   *,  r   r;   (raise_if_nothing_inferred.<locals>.innerN   s     $)&)		y/!   	zzz$5uzz!}55@ E  	 3C4I4I4K3LAN	
 	s@   	B'& B'B%B'B";A,,B"9B":#BB""B'r   r=   s   f r   raise_if_nothing_inferredrK   K   s     $ Lr   c               $    V ^8  d   QhRRRRRR/# r   astroid_versionstr	argumentsr   z.Callable[[Callable[_P, _R]], Callable[_P, _R]]r   )r   s   "r   r   r   h   s$     > >>36>	7>r   c                   a a R VV 3R llpV# )ak  Decorator which emits a DeprecationWarning if any arguments specified
are None or not passed at all.

Arguments should be a key-value mapping, with the key being the argument to check
and the value being a type annotation as string for the value of the argument.

To improve performance, only used when DeprecationWarnings other than
the default one are enabled.
c                    V ^8  d   QhRRRR/# r   r+   zCallable[_P, _R]r   r   )r   s   "r   r   7deprecate_default_argument_values.<locals>.__annotate__x   s     ,	 ,	' ,	,< ,	r   c                R   <a  \         P                  ! S 4      R VVV 3R ll4       pV# )Decorator function.c               $    V ^8  d   QhRRRRRR/# r   r2   r3   r"   r4   r   r   r   )r   s   "r   r   Edeprecate_default_argument_values.<locals>.deco.<locals>.__annotate__|   s!     &- &-w &-) &- &-r   c                   < \        \        P                  ! S4      P                  P	                  4       4      pSP                  4        F  w  r4 VP                  V4      pY19   d   Y,          e>   Y19  g   K/  TR8X  g/   \        T 4      T8:  g   \        T 4      T8  g   KX  Y,          e   Kd  \        P                  ! RT RT ^ ,          P                  P                   RSP                   RS RT R	T R
2\        ^R7       K  	  S! V / VB #   \         d0    \        RT RT ^ ,          P                  P                   R24      Rhi ; i)z/Emit DeprecationWarnings if conditions are met.Can't find argument '' for ''Nz#' will be a required argument for 'rE   z' in astroid z ('z' should be of type: 'z')
stacklevellistinspect	signature
parameterskeysitemsindex
ValueErrorr   __qualname__lenwarningswarnr   DeprecationWarning)	r2   r"   rf   argtype_annotationrh   rP   rN   r+   s	   *,    r   wrapper@deprecate_default_argument_values.<locals>.deco.<locals>.wrapper{   sK    G--d3>>CCEF,5OO,=(C$ $

3 6;+>  - %#&t9#5$'I$5$+:M !u %  $Q 1 1 > >?q P++:*; <!!$%;O;LBP /'(5 ->D T,V,,? & $(3C5Q@Q@Q@^@^?__`a#$$s   D:Er(   r+   rq   rP   rN   s   f r   deco/deprecate_default_argument_values.<locals>.decox   s-     __T"&- &- #&-P Nr   r   rN   rP   rt   s   fl r   !deprecate_default_argument_valuesrw   h   s     ,	 ,	\ r   c               $    V ^8  d   QhRRRRRR/# rM   r   )r   s   "r   r   r      s$     $ $$36$	7$r   c                   a a R VV 3R llpV# )a`  Decorator which emits a DeprecationWarning if any arguments specified
are passed.

Arguments should be a key-value mapping, with the key being the argument to check
and the value being a string that explains what to do instead of passing the argument.

To improve performance, only used when DeprecationWarnings other than
the default one are enabled.
c                    V ^8  d   QhRRRR/# rS   r   )r   s   "r   r   )deprecate_arguments.<locals>.__annotate__   s     	 	' 	,< 	r   c                R   <a  \         P                  ! S 4      R  VVV 3R ll4       pV# )c               $    V ^8  d   QhRRRRRR/# rX   r   )r   s   "r   r   7deprecate_arguments.<locals>.deco.<locals>.__annotate__   s!     - -w -) - -r   c                 &  < \        \        P                  ! S4      P                  P	                  4       4      pSP                  4        F  w  r4 VP                  V4      pY19   g   \        T 4      T8  g   K/  \        P                  ! RT RT ^ ,          P                  P                   RSP                   RS RT R2\        ^R	7       K  	  S! V / VB #   \         d0    \        R T RT ^ ,          P                  P                   R24      Rhi ; i)
r[   r\   r]   NzThe argument 'rE   z/' is deprecated and will be removed in astroid z ()r^   ra   )	r2   r"   rf   ro   noterh   rP   rN   r+   s	   *,    r   rq   2deprecate_arguments.<locals>.deco.<locals>.wrapper   s   G--d3>>CCEF!*!2IC$ $

3
 }D	E(9 ,SE 2  $Q 1 1 > >?q P>>M=NbQUPVVWY /'( "3 T,V,, & $(3C5Q@Q@Q@^@^?__`a#$$s   C:Dr(   rs   s   f r   rt   !deprecate_arguments.<locals>.deco   s*    __T"- - #-& Nr   r   rv   s   fl r   deprecate_argumentsr      s    	 	. r   c               $    V ^8  d   QhRRRRRR/# rM   r   )r   s   "r   r   r      $      36	7r   c                    R R lpV# )RPassthrough decorator to improve performance if DeprecationWarnings are
disabled.
c                    V ^8  d   QhRRRR/# rS   r   )r   s   "r   r   rT           	 	' 	,< 	r   c                    V # rV   r   r+   s   &r   rt   ru          Kr   r   rv   s   &, r   rw   rw          	 r   c               $    V ^8  d   QhRRRRRR/# rM   r   )r   s   "r   r   r      r   r   c                    R R lpV# )r   c                    V ^8  d   QhRRRR/# rS   r   )r   s   "r   r   r{      r   r   c                    V # r   r   r   s   &r   rt   r      r   r   r   rv   s   &, r   r   r      r   r   )z3.0)__doc__
__future__r   r)   rc   rG   rl   collections.abcr   r   typingr   r   astroidr   astroid.contextr   astroid.exceptionsr	   astroid.typingr
   r   r   r,   r>   rK   check_warnings_filterrw   r   r   r   r   <module>r      s~   
 / "   
  / %  , - *T]t_@$6 >@$ $P r   