
    c                      U d Z ddlmZ ddlZddlZddlZddlZddlZddlm	Z	m
Z
mZ ddlmZ ddlmZmZmZmZmZmZmZ ddlmZmZ ddlmZmZ dd	lmZmZ dd
lmZ ddl m!Z!m"Z"m#Z#m$Z$m%Z%m&Z& ddl'm(Z( ddl)m*Z* ddl+m,Z, ddl-m.Z. ddl/m0Z0m1Z1m2Z2m3Z3m4Z4 ej5        dk    rddlm6Z6 nddl7m6Z6 erddlm8Z8 ddl)m9Z9 ej5        dk    rddlm:Z: nddl;m<Z: ddZ= ede.          Z> edej?                  Z@ed         ZAee>eAee         eejB        eC                  gef         ZDee>ee         gej	        ee3e@f         ddf         f         ZEee>ee         gej	        e3dee2         f         f         ZFee>eGge0f         ZHejI        ddd             ZJddd#ZK eL            ZMddd$ZNddd%ZOddd&ZP G d' d(e*jQ        eejR        )          ZS G d* d+e.          ZT G d, d-e*jU        eTe*jQ                  ZV G d. d/e*jU        eTe*jQ                  ZW G d0 d1e*jU        eT          ZX G d2 d3e*jY                  ZZdd5Z[	 ddd9Z\ G d: d;e*jQ                  Z] G d< d=e*j^                  Z_ G d> d?e*jY        e*j^                  Z` G d@ dAe*jY        e*j^                  Za G dB dCe*jY        e*j^                  Zb G dD dEe.          Zc G dF dGe.          Zd G dH dIe*jU        e*j^                  Ze G dJ dKe.          Zf G dL dMe.          Zg G dN dOe.          Zh G dP dQe*jU        e          Zi G dR dSe*jU        e*j^                  Zj G dT dUe.          Zk G dV dWe*jQ                  Zl G dX dYe*jY        e*j^                  Zm G dZ d[e.e          Zn G d\ d]e*j^                  Zo G d^ d_e*jU                  Zp G d` dae*jU                  Zq G db dce*jr        e*jY        e*j^                  Zs G dd dee.          Zt G df dge*ju        e*jY        e*j^                  Zv G dh diev          Zw G dj dke.          Zx G dl dme*jy                  Zz G dn doe.          Z{ G dp dqe*jU        e*j^                  Z| G dr dse*ju        e*j^                  Z} G dt due.          Z~ G dv dwe*jy                  Z G dx dye.          Z G dz d{e.          Z G d| d}eS          ZB G d~ de*jU        e*j^                  Z G d de*jU        e*j^                  Z G d de*j^                  Z G d de*j^                  Z G d deS          Z G d de.          Z G d de*jQ                  Z G d de.          Z G d de*ju        e*j^                  Z G d de*ju        e*j^                  Z G d deS          Z G d de.          Z G d de*ju        e*j^                  Z G d de*ju        e*jY        e*j^                  Z G d de          Z G d de.          Z G d de          Z G d de*jU                  Z G d de.          Z G d de.          Z G d de*jY                  Z G d de*jY                  Z G d de.          Z G d de*j^                  Z G d de.          Z G d de*jr                  Z G d de          Z G d de          Z G d de          Z G d de*jY        e          Z G d de          Z G d de*jY        e          Z G d de*jY        e          Z G d de          ZeeBeeeenee ed          ei ee          ei ed¦          eieeieCeieeieeieGeieeiiZded<   ddʄZdd΄ZddфZdS )z;Module for some node classes. More nodes in scoped_nodes.py    )annotationsN)	GeneratorIterableMapping)	lru_cache)TYPE_CHECKINGAnyCallableClassVarOptionalTypeVarUnion)
decoratorsutil)Instance_infer_stmts)_EMPTY_OBJECT_MARKERContext)InferenceContext)AstroidIndexErrorAstroidTypeErrorAstroidValueErrorInferenceError	NoDefaultParentMissingError)AstroidManager)_base_nodes)OP_PRECEDENCE)NodeNG)ConstFactoryResultInferBinaryOpInferenceErrorInfoInferenceResultSuccessfulInferenceResult)      )Literalnodes)LocalsDictNodeNG)cached_property)cachedpropertyreturnboolc                F    t          | t          t                              S N)
isinstancetuple	CONST_CLSvalues    :lib/python3.11/site-packages/astroid/nodes/node_classes.py	_is_constr7   9   s    eU9--...    _NodesT)bound_BadOpMessageT)ListTuple
AssignName
AssignAttrNcontextInferenceContext | Nonec              #    K   t          | t          t          f          r8| j        D ]+}|t          j        u r|V  t          ||          E d{V  ,| |dS t          |                     |          t          j                  }|| u r	|V  | |dS |                     |          D ]+}|t          j        u r|V  t          ||          E d{V  ,| |dS )zrecursively generate nodes inferred by the given statement.
    If the inferred value is a list or a tuple, recurse on the elements
    N)noder@   )	r1   r<   r=   eltsr   Uninferableunpack_infernextinfer)stmtr@   eltinferreds       r6   rF   rF   U   s)     
 $u&& 29 	2 	2Cd&& 			#C1111111111111DJJw'')9::H4 2111JJw'' 7 7t'' 	7NNNN#Hg6666666666W---r8   
exceptionslist[str] | Nonec                   i }i }| }|                                  D ]}d||<   |||<   |}|}|                                 D ]B}||v r8t          |t                    rB|@|                    |          d         |                    ||                   d         ur dS nt          |t                    r|                    |          \  }}|                    ||                   \  }	}
|
|urw|dk    o|	dk    o|                    |          }|dk    o |	dk    o||                             |          }|dk    o|	dk    }|dk    o|	dk    }t          ||||f          r dS n|dk    r|	dk    r|||         uc S  dS |}DdS )a  return true if the two given statements are mutually exclusive

    `exceptions` may be a list of exception names. If specified, discard If
    branches and check one of the statement is in an exception handler catching
    one of the given exceptions.

    algorithm :
     1) index stmt1's parents
     2) climb among stmt2's parents until we find a common parent
     3) if the common parent is a If or TryExcept statement, look if nodes are
        in exclusive branches
       NThandlersbodyorelseF)node_ancestorsr1   Iflocate_child	TryExceptcatchany)stmt1stmt2rL   stmt1_parentschildrenpreviousrC   c2attrc2nodec1attrc1node first_in_body_caught_by_handlers!second_in_body_caught_by_handlersfirst_in_else_other_in_handlers second_in_else_other_in_handlerss                  r6   are_exclusiverf   p   s8    MHH$$&&  d!H$$&& * *=  (	 $## $:
 $:%%h//2,,Xd^<<Q?@   44	 
 D),, :!%!2!28!<!<!%!2!28D>!B!B' :*, 7"f,7$NN:66 5 &( ="j0=$TN00<< 6 *,C81C 4 (*Cv/C 5 <=;<	  $  $tt$ z) :f
.B :#8D>9999555r8   c                   t          | t                    r1t          | j        t          t	          d          f          r| j        S n| dS 	 t          |                     |                    }t          |t                    r0t          |j        t          t	          d          f          r|j        S n# t          t          f$ r Y nw xY wt          S )z'Get the value of the given slice index.Nr@   )
r1   Constr5   inttyperG   rH   r   StopIteration_SLICE_SENTINEL)indexr@   rK   s      r6   _slice_valuero      s     % *ekCd#455 	;		 *t
	*EKKK8899H (E** *hnsDJJ.?@@ *#>) . 	 	 	D	 s   #B5 5C	C	c                
   t          | j        |          }t          | j        |          }t          | j        |          }t	          d |||fD                       rt          |||          S t          d| | j        |          )Nc              3  (   K   | ]}|t           uV  d S r0   )rm   .0elems     r6   	<genexpr>z_infer_slice.<locals>.<genexpr>   s'      
H
H44&
H
H
H
H
H
Hr8   z'Could not infer slice used in subscriptmessagerC   rn   r@   )ro   lowerupperstepallslicer   parent)rC   r@   rx   ry   rz   s        r6   _infer_slicer~      s    W--EW--E	7++D

H
HE5$3G
H
H
HHH )UE4(((
9k	   r8   c                   	 t          |t                    r@t          ||          }|                                 }||         |_        | j        |_        |S t          |t                    r||j                 S nh# t          $ r}t          d| ||          |d}~wt          $ r}t          d| ||          |d}~wt          $ r}t          d| ||          |d}~ww xY wt          d| d          )	zHGet a slice or an item, using the given *index*, for the given sequence.rh   z&Slice {index!r} cannot index containerrv   NzIndex {index!s} out of rangeType error {error!r}zCould not use  as subscript index)r1   Slicer~   	__class__rD   r}   ri   r5   
ValueErrorr   
IndexErrorr   	TypeErrorr   )instancerD   rn   r@   index_slicenew_clsexcs          r6   _container_getitemr      sY   eU## 	&ug>>>K((**G,GL%_GNNeU## 	%$$	%   <	
 
 

 	    2	
 
 

 	    *PW
 
 
	
 FEFFF
G
GGs6   AA: !A: :
CBC%B99CCCc                       e Zd ZdZdZ	 	 	 ddddd fdZddZedd            Zd Z	dddZ
ej        d d            Zd Z xZS )!BaseContainerz.Base class for Set, FrozenSet, Tuple and List.rD   N
end_linenoend_col_offsetlineno
int | None
col_offsetr}   NodeNG | Noner   r   r-   Nonec               d    g | _         	 t                                          |||||           dS   
        :param lineno: The line that this node appears on in the source code.

        :param col_offset: The column that this node appears on in the
            source code.

        :param parent: The parent node in the syntax tree.

        :param end_lineno: The last line this node appears on in the source code.

        :param end_col_offset: The end column this node appears on in the
            source code. Note: This is after the last symbol.
        r   r   r   r   r}   N)rD   super__init__selfr   r   r}   r   r   r   s         r6   r   zBaseContainer.__init__
  sI    , #%	'!!) 	 	
 	
 	
 	
 	
r8   rD   list[NodeNG]c                    || _         dS )zoDo some setup after initialisation.

        :param elts: The list of elements the that node contains.
        Nr   )r   rD   s     r6   postinitzBaseContainer.postinit+      
 			r8   c                P     |             }|g |_         nd |D             |_         |S )a  Create a node of this type from the given list of elements.

        :param elts: The list of elements that the node should contain.
        :type elts: list(NodeNG)

        :returns: A new node containing the given elements.
        :rtype: NodeNG
        Nc                N    g | ]"}t          |          rt          |          n|#S  r7   const_factory)rs   es     r6   
<listcomp>z/BaseContainer.from_elements.<locals>.<listcomp>@  s0    OOOQYq\\@q)))qOOOr8   r   )clsrD   rC   s      r6   from_elementszBaseContainer.from_elements2  s;     suu 	PDIIOO$OOODIr8   c                    | j         S )zAn iterator over the elements this node contains.

        :returns: The contents of this node.
        :rtype: iterable(NodeNG)
        r   r   s    r6   iteredzBaseContainer.iteredC  s     yr8   r@   rA   r.   c                *    t          | j                  S )zeDetermine the boolean value of this node.

        :returns: The boolean value of this node.
        )r.   rD   r   r@   s     r6   
bool_valuezBaseContainer.bool_valueK  s    
 DIr8   strc                    dS )eGet the name of the type that this node represents.

        :returns: The name of the type.
        Nr   r   s    r6   pytypezBaseContainer.pytypeR  s      r8   c              #  $   K   | j         E d {V  d S r0   r   r   s    r6   get_childrenzBaseContainer.get_childrenY  s&      9r8   NNNr   r   r   r   r}   r   r   r   r   r   r-   r   )rD   r   r-   r   r0   )r@   rA   r-   r.   r-   r   )__name__
__module____qualname____doc___astroid_fieldsr   r   classmethodr   r   r   abcabstractmethodr   r   __classcell__r   s   @r6   r   r     s        88O "!% $	
 "&%)
 
 
 
 
 
 
 
B       [        	         r8   r   )	metaclassc                  @    e Zd ZdZ e            d	d            Zd ZdS )
LookupMixInz+Mixin to look up a name in the right scope.namer   r-   %tuple[LocalsDictNodeNG, list[NodeNG]]c                R    |                                                      | |          S )a#  Lookup where the given variable is assigned.

        The lookup starts from self's scope. If self is not a frame itself
        and the name is found in the inner frame locals, statements will be
        filtered to remove ignorable statements according to self's location.

        :param name: The name of the variable to find assignments for.

        :returns: The scope node and the list of assignments associated to the
            given name according to the scope where it has been found (locals,
            globals or builtin).
        )scopescope_lookupr   r   s     r6   lookupzLookupMixIn.lookupa  s"     zz||((t444r8   c                p    |                      |          \  }}t                      }t          |||          S )a
  Lookup the inferred values of the given variable.

        :param name: The variable name to find values for.
        :type name: str

        :returns: The inferred values of the statements returned from
            :meth:`lookup`.
        :rtype: iterable
        )r   r   r   )r   r   framestmtsr@   s        r6   ilookupzLookupMixIn.ilookupq  s6     {{4((u"$$E7E222r8   N)r   r   r-   r   )r   r   r   r   r   r   r   r   r8   r6   r   r   ^  sM        55Y[[5 5 5 [53 3 3 3 3r8   r   c                  ~     e Zd ZU dZdZded<    ej        d          	 	 	 	 ddddd fd            Zded<    xZ	S )r>   a  Variation of :class:`ast.Assign` representing assignment to a name.

    An :class:`AssignName` is the name of something that is assigned to.
    This includes variables defined in a function signature or in a loop.

    >>> import astroid
    >>> node = astroid.extract_node('variable = range(10)')
    >>> node
    <Assign l.1 at 0x7effe1db8550>
    >>> list(node.get_children())
    [<AssignName.variable l.1 at 0x7effe1db8748>, <Call l.1 at 0x7effe1db8630>]
    >>> list(node.get_children())[0].as_string()
    'variable'
    r   zClassVar[InferLHS[AssignName]]	infer_lhsr   Nr   r   
str | Noner   r   r   r}   r   r   r   r-   r   c               d    || _         	 t                                          |||||           dS )a  
        :param name: The name that is assigned to.

        :param lineno: The line that this node appears on in the source code.

        :param col_offset: The column that this node appears on in the
            source code.

        :param parent: The parent node in the syntax tree.

        :param end_lineno: The last line this node appears on in the source code.

        :param end_col_offset: The end column this node appears on in the
            source code. Note: This is after the last symbol.
        r   Nr   r   r   r   r   r   r   r}   r   r   r   s          r6   r   zAssignName.__init__  sI    4 !%	+!!) 	 	
 	
 	
 	
 	
r8   z'ClassVar[AssignedStmtsCall[AssignName]]assigned_stmtsNNNNr   r   r   r   r   r   r}   r   r   r   r   r   r-   r   )
r   r   r   r   _other_fields__annotations__r   !deprecate_default_argument_valuesr   r   r   s   @r6   r>   r>     s           M----1Z1u===  !!% $"
 "&%)"
 "
 "
 "
 "
 "
 "
 >="
H <;;;   r8   r>   c                  h     e Zd ZdZdZ ej        d          	 	 	 	 ddddd fd            Z xZS )DelNameah  Variation of :class:`ast.Delete` representing deletion of a name.

    A :class:`DelName` is the name of something that is deleted.

    >>> import astroid
    >>> node = astroid.extract_node("del variable #@")
    >>> list(node.get_children())
    [<DelName.variable l.1 at 0x7effe1da4d30>]
    >>> list(node.get_children())[0].as_string()
    'variable'
    r   r   Nr   r   r   r   r   r   r}   r   r   r   r-   r   c               d    || _         	 t                                          |||||           dS )a  
        :param name: The name that is being deleted.

        :param lineno: The line that this node appears on in the source code.

        :param col_offset: The column that this node appears on in the
            source code.

        :param parent: The parent node in the syntax tree.

        :param end_lineno: The last line this node appears on in the source code.

        :param end_col_offset: The end column this node appears on in the
            source code. Note: This is after the last symbol.
        r   Nr   r   s          r6   r   zDelName.__init__  sI    4 !%	-!!) 	 	
 	
 	
 	
 	
r8   r   r   	r   r   r   r   r   r   r   r   r   r   s   @r6   r   r     s        
 
 M1Z1u===  !!% $"
 "&%)"
 "
 "
 "
 "
 "
 "
 >="
 "
 "
 "
 "
r8   r   c                  n     e Zd ZdZdZ ej        d          	 	 	 	 ddddd fd            Zd Z xZ	S )Namea  Class representing an :class:`ast.Name` node.

    A :class:`Name` node is something that is named, but not covered by
    :class:`AssignName` or :class:`DelName`.

    >>> import astroid
    >>> node = astroid.extract_node('range(10)')
    >>> node
    <Call l.1 at 0x7effe1db8710>
    >>> list(node.get_children())
    [<Name.range l.1 at 0x7effe1db86a0>, <Const.int l.1 at 0x7effe1db8518>]
    >>> list(node.get_children())[0].as_string()
    'range'
    r   r   Nr   r   r   r   r   r   r}   r   r   r   r-   r   c               d    || _         	 t                                          |||||           dS )a	  
        :param name: The name that this node refers to.

        :param lineno: The line that this node appears on in the source code.

        :param col_offset: The column that this node appears on in the
            source code.

        :param parent: The parent node in the syntax tree.

        :param end_lineno: The last line this node appears on in the source code.

        :param end_col_offset: The end column this node appears on in the
            source code. Note: This is after the last symbol.
        r   Nr   r   s          r6   r   zName.__init__	  sI    4 !%	0!!) 	 	
 	
 	
 	
 	
r8   c              #  t   K   | V  |                                  D ]}|                                E d {V  d S r0   )r   _get_name_nodes)r   
child_nodes     r6   r   zName._get_name_nodes.  s[      


++-- 	4 	4J!113333333333	4 	4r8   r   r   )
r   r   r   r   r   r   r   r   r   r   r   s   @r6   r   r     s          M1Z1u===  !!% $"
 "&%)"
 "
 "
 "
 "
 "
 "
 >="
H4 4 4 4 4 4 4r8   r   c                       e Zd ZU dZdZdZded<   ded<   ded<   ded<   	 	 	 d6d7 fdZ	 	 	 	 	 	 	 	 d8d9d#Zd$ed%<   	 d& Z	e
 fd'            Ze
d(             Zd	d)d:d-Zd;d/Zd0 Zd<d2Zd=d4Zd5 Z xZS )>	ArgumentsaR  Class representing an :class:`ast.arguments` node.

    An :class:`Arguments` node represents that arguments in a
    function definition.

    >>> import astroid
    >>> node = astroid.extract_node('def foo(bar): pass')
    >>> node
    <FunctionDef.foo l.1 at 0x7effe1db8198>
    >>> node.args
    <Arguments l.1 at 0x7effe1db82e8>
    )argsdefaults
kwonlyargsposonlyargsposonlyargs_annotationskw_defaultsr   varargannotationkwargannotationkwonlyargs_annotationstype_comment_argstype_comment_kwonlyargstype_comment_posonlyargs)varargkwargr   r   r   r   r   Nr   r   r   r}   r   r-   c                   t                                          |           || _        	 || _        	 |  	 |  	 |  	 g | _        	 |  	 |  	 g | _        	 g | _        	 g | _        	 g | _        	 g | _	        	 d| _
        	 d| _        dS )z
        :param vararg: The name of the variable length arguments.

        :param kwarg: The name of the variable length keyword arguments.

        :param parent: The parent node in the syntax tree.
        r}   N)r   r   r   r   r   r   r   r   r   r   r   r   )r   r   r   r}   r   s       r6   r   zArguments.__init__d  s     	'''"(8!&
@*	 	*O)G-/A-Z-P<>$U;=#S68	 =?$	 >@%	 04D.2LLr8   r   list[AssignName] | Noner   list[NodeNG] | Noner   list[AssignName]r   list[NodeNG | None]r   r   r   list[NodeNG | None] | Noner   r   r   r   r   r   c                    || _         || _        || _        ||| _        || _        || _        ||| _        ||| _        |	| _        |
| _	        ||| _
        ||| _        |	|| _        dS dS )a  Do some setup after initialisation.

        :param args: The names of the required arguments.

        :param defaults: The default values for arguments that can be passed
            positionally.

        :param kwonlyargs: The keyword arguments that cannot be passed
            positionally.

        :param posonlyargs: The arguments that can only be passed
            positionally.

        :param kw_defaults: The default values for keyword arguments that
            cannot be passed positionally.

        :param annotations: The type annotations of arguments that can be
            passed positionally.

        :param kwonlyargs_annotations: The type annotations of arguments that
            cannot be passed positionally. This should always be passed in
            Python 3.

        :param posonlyargs_annotations: The type annotations of arguments that
            can only be passed positionally. This should always be passed in
            Python 3.

        :param varargannotation: The type annotation for the variable length
            arguments.

        :param kwargannotation: The type annotation for the variable length
            keyword arguments.

        :param type_comment_args: The type annotation,
            passed by a type comment, of each argument.

        :param type_comment_args: The type annotation,
            passed by a type comment, of each keyword only argument.

        :param type_comment_args: The type annotation,
            passed by a type comment, of each positional argument.
        N)r   r   r   r   r   r   r   r   r   r   r   r   r   )r   r   r   r   r   r   r   r   r   r   r   r   r   r   s                 r6   r   zArguments.postinit  s    t 	 $ 	+*D&&! 	A*@D'" 	C+BD( 0. 	7%6D"" 	C+BD(# 	E,DD)))	E 	Er8   z&ClassVar[AssignedStmtsCall[Arguments]]r   c                    | j         |u r|S d S r0   r   r   r   r   s      r6   _infer_namezArguments._infer_name  s    ;% 	Ktr8   c                b    t                      j        }t          || j        j        pd          S )zaThe first line that this node appears on in the source code.

        :type: int or None
        r   )r   
fromlinenomaxr}   )r   r   r   s     r6   r  zArguments.fromlineno  s+     #64;16Q777r8   c                b    t          t          j        | j        pd| j        pd                    S )zYGet all the arguments for this node, including positional only and positional and keywordr   )list	itertoolschainr   r   r   s    r6   	argumentszArguments.arguments  s,     IOT%5%;dio2NNOOOr8   skippable_namesr  set[str] | Noner   c               X   g }g }| j         }| j         rW| j        pg }| j         t          |           d         }| j         dt          | j                   t          |          z
           }| j        rE|                    t          | j        || j        |                     |                    d           | j        r:|                    t          | j        |t          | dd          |                     | j        r|                    d| j                    | j	        rQ| j        s|                    d           |                    t          | j	        | j
        | j        |                     | j        r|                    d| j                    d                    |          S )zoGet the arguments formatted as string.

        :returns: The formatted arguments.
        :rtype: str
        Nr  /r   ***, )r   r   lenr   append_format_argsr   getattrr   r   r   r   r   join)r   r  resultpositional_only_defaultspositional_or_keyword_defaultsr   s         r6   format_argszArguments.format_args  s    #% )-&= 	W9?D-1]CII:<<-H*'+}5Us4=7I7ICPTII7U5U'V$ 		MM$,0$3	     MM#9 	MMI2D-66$3	     ; 	-MM+dk++,,,? 
	; #c"""MMO$/$3	     : 	-MM+tz++,,,yy   r8   Ytuple[dict[str, tuple[str | None, str | None]], dict[str, tuple[str | None, str | None]]]c                   i }i }g }| j         }| j         rW| j        pg }| j         t          |           d         }| j         dt          | j                   t          |          z
           }t          | j                  D ]R\  }}| j        |         d}	}||                                }|r||                                         }	||	f||j        <   St          | j                  D ]\  }}
| j        |         d}	}||                                }|rQt          | j                  t          |          z
  }||z
  }|dk    r"||         ||                                         }	||	f||
j        <   | j	        r)| j
        }||                                }|df|| j	        <   t          | j                  D ]W\  }}| j        |         }||                                }| j        |         }	|	|	                                }	||	f||j        <   X| j        r)| j        }||                                }|df|| j        <   ||fS )ay  Get the arguments as dictionary with information about typing and defaults.

        The return tuple contains a dictionary for positional and keyword arguments with their typing
        and their default value, if any.
        The method follows a similar order as format_args but instead of formatting into a string it
        returns the data that is used to do so.
        N)r   r   r  	enumerater   r   	as_stringr   r   r   r   r   r   r   r   r   )r   pos_onlykw_onlyr  r  r   rn   posonly
annotationdefaultargdefaults_offsetdefault_indexr   s                 r6   _get_arguments_datazArguments._get_arguments_dataM  s    >@<> $& )-&= 	W9?D-1]CII:<<-H*'+}5Us4=7I7ICPTII7U5U'V$'(899 	; 	;NE7"&">u"EtJ 4'1133
' F259CCEE&0'%:HW\""#DI.. 	7 	7JE3"&"25"94J 4'1133
- X"%di..37U3V3V"V % 7!B&X6}EX =]KUUWWG",g!6HSX; 	7.J 4'1133
%/$6HT[!%do66 	8 	8LE54U;J 4'1133
&u-G .!++--#-w"7GEJ: 	5-J 4'1133
#-t"4GDJ  r8   c                N   | j         }t          ||          d         }|:|t          |          t          | j                  z
  z
  }|dk    r| j        |         S t          || j                  d         }|| j        |         | j        |         S t          | j        |          )zGet the default value for an argument.

        :param argname: The name of the argument to get the default value for.
        :type argname: str

        :raises NoDefault: If there is no default value defined for the
            given argument.
        r   N)funcr   )r  	_find_argr  r   r   r   r   r}   )r   argnamer   rn   idxs        r6   default_valuezArguments.default_value  s     ~'4((+ 	*3t99s4='9'99:Cax *}S))'4?33A6 	+!1%!8 	+#E**T[w7777r8   r.   c                    || j         k    rdS || j        k    rdS |                     |d          d         dup%| j        ot	          || j        d          d         duS )zCheck if the given name is defined in the arguments.

        :param name: The name to check for.
        :type name: str

        :returns: Whether the given name is defined in the arguments,
        T)recrO   N)r   r   find_argnamer   r.  r   s     r6   is_argumentzArguments.is_argument  s     4; 	44: 	4d--a0< J J$T:::1=TI	
r8   Fc                @    | j         rt          || j         |          S dS )a  Get the index and :class:`AssignName` node for given name.

        :param argname: The name of the argument to search for.
        :type argname: str

        :param rec: Whether or not to include arguments in unpacked tuples
            in the search.
        :type rec: bool

        :returns: The index and node for the argument.
        :rtype: tuple(str or None, AssignName or None)
        NN)r  r.  )r   r/  r3  s      r6   r4  zArguments.find_argname  s'     > 	;Wdnc:::zr8   c              #  H  K   | j         pdE d {V  | j        D ]}||V  	| j        pdE d {V  | j        | j        E d {V  | j        E d {V  | j        D ]}||V  	| j        D ]}||V  	| j        	| j        V  | j        	| j        V  | j	        D ]}||V  	d S Nr   )
r   r   r   r   r   r   r   r   r   r   )r   rJ   s     r6   r   zArguments.get_children  sP     #)r)))))))/ 	 	C 			9?"""""""= 	%}$$$$$$$?"""""""# 	 	C 			# 	 	C 			  	('''' 	'&&&&. 	 	C 				 	r8   r   )r   r   r   r   r}   r   r-   r   )NNNNNNNN)r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r-   r   r  r  r-   r   )r-   r  r-   r.   F)r   r   r   r   r   r   r   r   r   r  r+   r  r  r  r+  r1  r5  r4  r   r   r   s   @r6   r   r   5  s         .O  (MLLL "  $	NM NM NM NM NM NM NMp 04=A>B*.)-8<>B?CLE LE LE LE LE\ ;:::  
 8 8 8 8 _8 P P _P AE 0! 0! 0! 0! 0! 0!dC! C! C! C!J8 8 8(
 
 
 
$   "      r8   r   Fc                    t          |          D ]O\  }}t          |t                    r$|r!t          | |j                  }|d         |c S >|j        | k    r||fc S PdS )Nr   r7  )r!  r1   r=   r.  rD   r   )r/  r   r3  ir(  founds         r6   r.  r.    s    D//  3c5!! 	 !!'38448 ! LLLX  	c6MMM	:r8   r  r  r   c                   |t                      }g }| dS |g }|t          |           t          |          z
  }t          j        | |          }t	          |          D ]\  }\  }}	|j        |v rt          |t                    r,|                    dt          |j
                   d           S|j        }
d}|	|
d|	                                z   z  }
d}|                    |
           |?||k    r9|||z
           .|dxx         ||||z
                                           z   z  cc<   d                    |          S )	N ()=z: z = r   r  )setr  r
  zip_longestr!  r   r1   r=   r  r  rD   r"  r  )r   r   r   r  valuesdefault_offsetpackedr>  r(  r&  r/  default_seps               r6   r  r    s      %%F r  3TS]]2"455F )& 1 1 Y YC8& 	c5!! 	YMM7l38447778888hGK $4*"6"6"8"888#MM'""" Y^(; YA./ Y2JJJ+^9K0L0V0V0X0X"XXJJJ99Vr8   c                       e Zd ZU dZdZdZded<    ej        d          	 	 	 	 ddddd fd            Z	dddZ
ded<   	 d Z xZS )r?   a  Variation of :class:`ast.Assign` representing assignment to an attribute.

    >>> import astroid
    >>> node = astroid.extract_node('self.attribute = range(10)')
    >>> node
    <Assign l.1 at 0x7effe1d521d0>
    >>> list(node.get_children())
    [<AssignAttr.attribute l.1 at 0x7effe1d52320>, <Call l.1 at 0x7effe1d522e8>]
    >>> list(node.get_children())[0].as_string()
    'self.attribute'
    exprattrnamezClassVar[InferLHS[AssignAttr]]r   r   Nr   rO  r   r   r   r   r}   r   r   r   r-   r   c               t    d| _         	 || _        	 t                                          |||||           dS )a  
        :param attrname: The name of the attribute being assigned to.

        :param lineno: The line that this node appears on in the source code.

        :param col_offset: The column that this node appears on in the
            source code.

        :param parent: The parent node in the syntax tree.

        :param end_lineno: The last line this node appears on in the source code.

        :param end_col_offset: The end column this node appears on in the
            source code. Note: This is after the last symbol.
        Nr   rM  rO  r   r   r   rO  r   r   r}   r   r   r   s          r6   r   zAssignAttr.__init__'  sS    4 $(	?$,:!!) 	 	
 	
 	
 	
 	
r8   rM  c                    || _         dS )ztDo some setup after initialisation.

        :param expr: What has the attribute that is being assigned to.
        NrL  r   rM  s     r6   r   zAssignAttr.postinitO  r   r8   z'ClassVar[AssignedStmtsCall[AssignAttr]]r   c              #     K   | j         V  d S r0   rL  r   s    r6   r   zAssignAttr.get_children[        ir8   r   rO  r   r   r   r   r   r}   r   r   r   r   r   r-   r   r0   rM  r   r-   r   )r   r   r   r   r   r   r   r   r   r   r   r   r   r   s   @r6   r?   r?     s         
 
  O!M----1Z15AAA  $!!% $%
 "&%)%
 %
 %
 %
 %
 %
 %
 BA%
N     <;;;      r8   r?   c                  H     e Zd ZdZdZ	 	 	 ddddd fdZdddZd Z xZS )Asserta  Class representing an :class:`ast.Assert` node.

    An :class:`Assert` node represents an assert statement.

    >>> import astroid
    >>> node = astroid.extract_node('assert len(things) == 10, "Not enough things"')
    >>> node
    <Assert l.1 at 0x7effe1d527b8>
    testfailNr   r   r   r   r}   r   r   r   r-   r   c               t    d| _         	 d| _        	 t                                          |||||           dS r   Nr   )r\  r]  r   r   r   s         r6   r   zAssert.__init__l  sS    , $(	:#'	9!!) 	 	
 	
 	
 	
 	
r8   r\  r]  c                "    || _         || _        dS )zDo some setup after initialisation.

        :param test: The test that passes or fails the assertion.

        :param fail: The message shown when the assertion fails.
        N)r]  r\  )r   r\  r]  s      r6   r   zAssert.postinit  s     				r8   c              #  @   K   | j         V  | j        | j        V  d S d S r0   r[  r   s    r6   r   zAssert.get_children  s4      i9 	)OOOOO	 	r8   r   r   r7  )r\  r   r]  r   r-   r   	r   r   r   r   r   r   r   r   r   r   s   @r6   rZ  rZ  _  s          'O "!% $	"
 "&%)"
 "
 "
 "
 "
 "
 "
 "
H          r8   rZ  c                       e Zd ZU dZdZdZ	 	 	 ddddd fdZ	 	 	 dddZded<   	 d Z	e
j        d             Zd Z xZS )Assigna  Class representing an :class:`ast.Assign` node.

    An :class:`Assign` is a statement where something is explicitly
    asssigned to.

    >>> import astroid
    >>> node = astroid.extract_node('variable = range(10)')
    >>> node
    <Assign l.1 at 0x7effe1db8550>
    targetsr5   type_annotationNr   r   r   r   r}   r   r   r   r-   r   c                   g | _         	 d| _        	 d| _        	 t                                          |||||           dS r_  )rf  r5   rh  r   r   r   s         r6   r   zAssign.__init__  s^    , &(($(
8.2X!!) 	 	
 	
 	
 	
 	
r8   rf  r   r5   rh  c                4    ||| _         || _        || _        dS )zDo some setup after initialisation.

        :param targets: What is being assigned to.
        :param value: The value being assigned to the variables.
        :param type_annotation:
        N)rf  r5   rh  )r   rf  r5   rh  s       r6   r   zAssign.postinit  s(      	#"DL
.r8   z#ClassVar[AssignedStmtsCall[Assign]]r   c              #  6   K   | j         E d {V  | j        V  d S r0   re  r   s    r6   r   zAssign.get_children  s4      <jr8   c                V    | gt          | j                                                  z   S r0   )r	  r5   _get_assign_nodesr   s    r6   rm  zAssign._get_assign_nodes  s%    vTZ99;;<<<<r8   c              #  H   K   | j                                         E d {V  d S r0   )r5   _get_yield_nodes_skip_lambdasr   s    r6   ro  z$Assign._get_yield_nodes_skip_lambdas  s2      :;;===========r8   r   r   )rf  r   r5   r   rh  r   r-   r   )r   r   r   r   r   _other_other_fieldsr   r   r   r   r   cachedrm  ro  r   r   s   @r6   rd  rd    s         	 	 +O. "!% $	%
 "&%)%
 %
 %
 %
 %
 %
 %
 %
R (,#)-	/ / / / /" 8777  
 = = => > > > > > >r8   rd  c                  \     e Zd ZU dZdZdZ	 	 	 ddddd fdZ	 dddZded<   	 d Z	 xZ
S )	AnnAssigna  Class representing an :class:`ast.AnnAssign` node.

    An :class:`AnnAssign` is an assignment with a type annotation.

    >>> import astroid
    >>> node = astroid.extract_node('variable: List[int] = range(10)')
    >>> node
    <AnnAssign l.1 at 0x7effe1d4c630>
    targetr&  r5   )simpleNr   r   r   r   r}   r   r   r   r-   r   c                   d| _         	 d| _        	 d| _        	 d| _        	 t	                                          |||||           dS r_  )ru  r&  r5   rv  r   r   r   s         r6   r   zAnnAssign.__init__  sg    , &*()-?$(
8"&K!!) 	 	
 	
 	
 	
 	
r8   ru  r   r&  rv  rj   r5   c                >    || _         || _        || _        || _        dS )aQ  Do some setup after initialisation.

        :param target: What is being assigned to.

        :param annotation: The type annotation of what is being assigned to.

        :param simple: Whether :attr:`target` is a pure name
            or a complex statement.

        :param value: The value being assigned to the variables.
        N)ru  r&  r5   rv  )r   ru  r&  rv  r5   s        r6   r   zAnnAssign.postinit2  s$    $ $
r8   z&ClassVar[AssignedStmtsCall[AnnAssign]]r   c              #  R   K   | j         V  | j        V  | j        | j        V  d S d S r0   rt  r   s    r6   r   zAnnAssign.get_childrenN  sJ      ko: 	*	 	r8   r   r   r0   )
ru  r   r&  r   rv  rj   r5   r   r-   r   r   r   r   r   r   r   r   r   r   r   r   r   s   @r6   rs  rs    s           8OM "!% $	(
 "&%)(
 (
 (
 (
 (
 (
 (
 (
^  $    . ;:::      r8   rs  c                       e Zd ZU dZdZdZ ej        d          	 	 	 	 ddddd  fd            Z	 d!d"dZ	de
d<   	 de
d<   d#d$dZd Z fdZ xZS )%	AugAssignzClass representing an :class:`ast.AugAssign` node.

    An :class:`AugAssign` is an assignment paired with an operator.

    >>> import astroid
    >>> node = astroid.extract_node('variable += 1')
    >>> node
    <AugAssign l.1 at 0x7effe1db4d68>
    ru  r5   opr   Nr   r  r   r   r   r   r}   r   r   r   r-   r   c                   d| _         	 || _        	 d| _        	 t                                          |||||           dS )aH  
        :param op: The operator that is being combined with the assignment.
            This includes the equals sign.

        :param lineno: The line that this node appears on in the source code.

        :param col_offset: The column that this node appears on in the
            source code.

        :param parent: The parent node in the syntax tree.

        :param end_lineno: The last line this node appears on in the source code.

        :param end_col_offset: The end column this node appears on in the
            source code. Note: This is after the last symbol.
        Nr   )ru  r  r5   r   r   r   r  r   r   r}   r   r   r   s          r6   r   zAugAssign.__init__d  sa    6 &*( 	
 %)
7!!) 	 	
 	
 	
 	
 	
r8   ru  r5   c                "    || _         || _        dS )zDo some setup after initialisation.

        :param target: What is being assigned to.

        :param value: The value being assigned to the variable.
        Nr}  r   ru  r5   s      r6   r   zAugAssign.postinit  s     


r8   z&ClassVar[AssignedStmtsCall[AugAssign]]r   zIClassVar[InferBinaryOperation[AugAssign, util.BadBinaryOperationMessage]]_infer_augassignr@   rA   c                l    	 |                      |          }d |D             S # t          $ r g cY S w xY w)a&  Get a list of type errors which can occur during inference.

        Each TypeError is represented by a :class:`BadBinaryOperationMessage` ,
        which holds the original exception.

        :returns: The list of possible type errors.
        :rtype: list(BadBinaryOperationMessage)
        rh   c                F    g | ]}t          |t          j                  |S r   r1   r   BadBinaryOperationMessagers   r  s     r6   r   z)AugAssign.type_errors.<locals>.<listcomp>  ;       fd&DEE  r8   )r  r   r   r@   resultss      r6   type_errorszAugAssign.type_errors  sd    	++G+<<G %   
  	 	 	III	   !$ 33c              #  .   K   | j         V  | j        V  d S r0   r}  r   s    r6   r   zAugAssign.get_children  s(      kjr8   c              #     K   | j                                         E d{V  t                                                      E d{V  dS )z7An AugAssign node can contain a Yield node in the valueN)r5   ro  r   r   r   s    r6   ro  z'AugAssign._get_yield_nodes_skip_lambdas  s[      :;;=========7788:::::::::::r8   r   r  r   r   r   r   r   r}   r   r   r   r   r   r-   r   r7  )ru  r   r5   r   r-   r   r0   r@   rA   )r   r   r   r   r   r   r   r   r   r   r   r  r   ro  r   r   s   @r6   r|  r|  V  s          *OM1Z1U;;; !!% $,
 "&%),
 ,
 ,
 ,
 ,
 ,
 ,
 <;,
^ DH
 
 
 
 
 ;:::
       &  ; ; ; ; ; ; ; ; ;r8   r|  c                       e Zd ZU dZdZdZ ej        d          	 	 	 	 ddddd  fd            Zd!d"dZ	de
d<   d#d$dZd Zd Zd%dZ xZS )&BinOpzClass representing an :class:`ast.BinOp` node.

    A :class:`BinOp` node is an application of a binary operator.

    >>> import astroid
    >>> node = astroid.extract_node('a + b')
    >>> node
    <BinOp l.1 at 0x7f23b2e8cfd0>
    leftrightr~  r   Nr   r  r   r   r   r   r}   r   r   r   r-   r   c                   d| _         	 || _        	 d| _        	 t                                          |||||           dS   
        :param op: The operator.

        :param lineno: The line that this node appears on in the source code.

        :param col_offset: The column that this node appears on in the
            source code.

        :param parent: The parent node in the syntax tree.

        :param end_lineno: The last line this node appears on in the source code.

        :param end_col_offset: The end column this node appears on in the
            source code. Note: This is after the last symbol.
        Nr   )r  r  r  r   r   r  s          r6   r   zBinOp.__init__  s]    4 $(	E $(
F!!) 	 	
 	
 	
 	
 	
r8   r  r  c                "    || _         || _        dS )zDo some setup after initialisation.

        :param left: What is being applied to the operator on the left side.

        :param right: What is being applied to the operator on the right side.
        Nr  )r   r  r  s      r6   r   zBinOp.postinit  s     	


r8   zEClassVar[InferBinaryOperation[BinOp, util.BadBinaryOperationMessage]]_infer_binopr@   rA   c                l    	 |                      |          }d |D             S # t          $ r g cY S w xY w)%  Get a list of type errors which can occur during inference.

        Each TypeError is represented by a :class:`BadBinaryOperationMessage`,
        which holds the original exception.

        :returns: The list of possible type errors.
        :rtype: list(BadBinaryOperationMessage)
        rh   c                F    g | ]}t          |t          j                  |S r   r  r  s     r6   r   z%BinOp.type_errors.<locals>.<listcomp>  r  r8   )r  r   r  s      r6   r  zBinOp.type_errors  sd    	'''88G %   
  	 	 	III	r  c              #  .   K   | j         V  | j        V  d S r0   r  r   s    r6   r   zBinOp.get_children  s%      ijr8   c                &    t           | j                 S r0   r   r  r   s    r6   op_precedencezBinOp.op_precedence#      TW%%r8   r.   c                    | j         dk    S )Nr  r~  r   s    r6   op_left_associativezBinOp.op_left_associative&  s    w$r8   r   r  r7  )r  r   r  r   r-   r   r0   r  r;  )r   r   r   r   r   r   r   r   r   r   r   r  r   r  r  r   r   s   @r6   r  r    s	          (OM1Z1U;;; !!% $(
 "&%)(
 (
 (
 (
 (
 (
 (
 <;(
T     XWWW    &  & & &       r8   r  c                       e Zd ZdZdZdZ ej        d          	 	 	 	 ddddd fd            ZdddZ	d Z
d Z xZS )BoolOpzClass representing an :class:`ast.BoolOp` node.

    A :class:`BoolOp` is an application of a boolean operator.

    >>> import astroid
    >>> node = astroid.extract_node('a and b')
    >>> node
    <BinOp l.1 at 0x7f23b2e71c50>
    rG  r~  r   Nr   r  r   r   r   r   r}   r   r   r   r-   r   c               t    || _         	 g | _        	 t                                          |||||           dS )r  r   N)r  rG  r   r   r  s          r6   r   zBoolOp.__init__9  sS    4 !$&7!!) 	 	
 	
 	
 	
 	
r8   rG  r   c                    |	|| _         dS dS )znDo some setup after initialisation.

        :param values: The values being applied to the operator.
        Nr  r   rG  s     r6   r   zBoolOp.postinita  s!    
  	! DKKK	! 	!r8   c              #  $   K   | j         E d {V  d S r0   r  r   s    r6   r   zBoolOp.get_childreni  &      ;r8   c                &    t           | j                 S r0   r  r   s    r6   r  zBoolOp.op_precedencel  r  r8   r   r  r0   rG  r   r-   r   )r   r   r   r   r   r   r   r   r   r   r   r  r   r   s   @r6   r  r  +  s          "OM1Z1U;;; !!% $%
 "&%)%
 %
 %
 %
 %
 %
 %
 <;%
N! ! ! ! !  & & & & & & &r8   r  c                      e Zd ZdZdS )BreakzClass representing an :class:`ast.Break` node.

    >>> import astroid
    >>> node = astroid.extract_node('break')
    >>> node
    <Break l.1 at 0x7f23b2e9e5c0>
    Nr   r   r   r   r   r8   r6   r  r  p             r8   r  c                  ~     e Zd ZdZdZ	 	 	 ddddd fdZ	 	 	 dddZedd            Zedd            Z	d Z
 xZS )CallzClass representing an :class:`ast.Call` node.

    A :class:`Call` node is a call to a function, method, etc.

    >>> import astroid
    >>> node = astroid.extract_node('function()')
    >>> node
    <Call l.1 at 0x7f23b2e71eb8>
    r-  r   keywordsNr   r   r   r   r}   r   r   r   r-   r   c                   d| _         	 g | _        	 g | _        	 t                                          |||||           dS r_  )r-  r   r  r   r   r   s         r6   r   zCall.__init__  s]    , $(	#"$	?')<!!) 	 	
 	
 	
 	
 	
r8   r-  r   r   r  list[Keyword] | Nonec                <    || _         ||| _        |	|| _        dS dS )zDo some setup after initialisation.

        :param func: What is being called.

        :param args: The positional arguments being given to the call.

        :param keywords: The keyword arguments being given to the call.
        Nr  )r   r-  r   r  s       r6   r   zCall.postinit  s7     	 	DI 	%$DMMM	% 	%r8   list[Starred]c                $    d | j         D             S )z/The positional arguments that unpack something.c                <    g | ]}t          |t                    |S r   )r1   Starred)rs   r(  s     r6   r   z!Call.starargs.<locals>.<listcomp>  s'    EEEJsG,D,DEEEEr8   )r   r   s    r6   starargszCall.starargs  s     FEtyEEEEr8   list[Keyword]c                $    d | j         D             S )z,The keyword arguments that unpack something.c                     g | ]}|j         	|S r0   r(  )rs   keywords     r6   r   zCall.kwargs.<locals>.<listcomp>  s    LLLGLLLLr8   )r  r   s    r6   kwargszCall.kwargs  s     MLt}LLLLr8   c              #  P   K   | j         V  | j        E d {V  | j        E d {V  d S r0   r  r   s    r6   r   zCall.get_children  sK      i9=         r8   r   r   )r-  r   r   r   r  r  r-   r   )r-   r  )r-   r  )r   r   r   r   r   r   r   propertyr  r  r   r   r   s   @r6   r  r  z  s          3O "!% $	%
 "&%)%
 %
 %
 %
 %
 %
 %
 %
R #$()-	% % % % %( F F F XF M M M XM! ! ! ! ! ! !r8   r  c                  R     e Zd ZdZdZ	 	 	 ddddd fdZ	 	 dddZd Zd Z xZ	S )CompareaL  Class representing an :class:`ast.Compare` node.

    A :class:`Compare` node indicates a comparison.

    >>> import astroid
    >>> node = astroid.extract_node('a <= b <= c')
    >>> node
    <Compare l.1 at 0x7f23b2e9e6d8>
    >>> node.ops
    [('<=', <Name.b l.1 at 0x7f23b2e9e2b0>), ('<=', <Name.c l.1 at 0x7f23b2e9e390>)]
    r  opsNr   r   r   r   r}   r   r   r   r-   r   c               t    d| _         	 g | _        	 t                                          |||||           dS r_  )r  r  r   r   r   s         r6   r   zCompare.__init__  sS    , $(	K-/Q!!) 	 	
 	
 	
 	
 	
r8   r  r  list[tuple[str, NodeNG]] | Nonec                *    || _         |	|| _        dS dS )zDo some setup after initialisation.

        :param left: The value at the left being applied to a comparison
            operator.

        :param ops: The remainder of the operators
            and their relevant right hand value.
        Nr  )r   r  r  s      r6   r   zCompare.postinit  s(     	 	DHHH	 	r8   c              #  >   K   | j         V  | j        D ]	\  }}|V  
dS )zGet the child nodes below this node.

        Overridden to handle the tuple fields and skip returning the operator
        strings.

        :returns: The children.
        :rtype: iterable(NodeNG)
        Nr  )r   _
comparators      r6   r   zCompare.get_children  sA       i!X 	 	MAz	 	r8   c                (    | j         d         d         S )zsAn optimized version of list(get_children())[-1]

        :returns: The last child.
        :rtype: NodeNG
        r   rO   )r  r   s    r6   
last_childzCompare.last_child%  s     x|Ar8   r   r   r7  )r  r   r  r  r-   r   )
r   r   r   r   r   r   r   r   r  r   r   s   @r6   r  r    s        
 
 &O "!% $	"
 "&%)"
 "
 "
 "
 "
 "
 "
 "
L #/3    "        r8   r  c                       e Zd ZU dZdZdZdZ	 ded<   ded<   ded<   ded	<   dd fdZ	 	 	 	 dd dZ	ded<   	 d Z
d!dZd Z xZS )"Comprehensiona  Class representing an :class:`ast.comprehension` node.

    A :class:`Comprehension` indicates the loop inside any type of
    comprehension including generator expressions.

    >>> import astroid
    >>> node = astroid.extract_node('[x for x in some_values]')
    >>> list(node.get_children())
    [<Name.x l.1 at 0x7f23b2e352b0>, <Comprehension l.1 at 0x7f23b2e35320>]
    >>> list(node.get_children())[1].as_string()
    'for x in some_values'
    ru  iterifs)is_asyncTr   r   r   r   r   Nr}   r   r-   c                    d| _         	 d| _        	 g | _        	 d| _        	 t	                                          |           dS )zD
        :param parent: The parent node in the syntax tree.
        Nr   )ru  r  r  r  r   r   r   r}   r   s     r6   r   zComprehension.__init__I  sN     &*7#'	9!#N%)C'''''r8   ru  r  r  r   r  bool | Nonec                B    || _         || _        ||| _        || _        dS )ab  Do some setup after initialisation.

        :param target: What is assigned to by the comprehension.

        :param iter: What is iterated over by the comprehension.

        :param ifs: The contents of any if statements that filter
            the comprehension.

        :param is_async: Whether this is an asynchronous comprehension or not.
        N)ru  r  r  r  )r   ru  r  r  r  s        r6   r   zComprehension.postinit\  s,    $ 	 	DH r8   z*ClassVar[AssignedStmtsCall[Comprehension]]r   c                    | S )zwThe type of assignment that this node performs.

        :returns: The assignment type.
        :rtype: NodeNG
        r   r   s    r6   assign_typezComprehension.assign_typey  s	     r8   mystmt_base_nodes.Statement | Nonec                    | |u r"t          |t          t          f          r|gdfS n|                     d          |u r|gdfS |dfS )zmethod used in filter_stmtsTfutureF)r1   ri   r   	statement)r   lookup_noderC   r   r  s        r6   _get_filtered_stmtsz!Comprehension._get_filtered_stmts  sm     6> 	 +t}55 +#}d**+ ^^4^((F2 	  64<e|r8   c              #  H   K   | j         V  | j        V  | j        E d {V  d S r0   r  r   s    r6   r   zComprehension.get_children  s?      ki8r8   r0   r}   r   r-   r   r   )
ru  r   r  r   r  r   r  r  r-   r   )r  r  )r   r   r   r   r   r   optional_assignr   r   r   r  r  r   r   r   s   @r6   r  r  0  s           0O!MO:LLL( ( ( ( ( ( (* !%"#' $! ! ! ! !0 ?>>>            r8   r  c                       e Zd ZU dZdZ	 	 	 	 d!dddd" fdZded<   ded<    fdZd#d$dZd%dZ	d Z
d&dZd#d$d Z xZS )'ri   a  Class representing any constant including num, str, bool, None, bytes.

    >>> import astroid
    >>> node = astroid.extract_node('(5, "This is a string.", True, None, b"bytes")')
    >>> node
    <Tuple.tuple l.1 at 0x7f23b2e358d0>
    >>> list(node.get_children())
    [<Const.int l.1 at 0x7f23b2e35940>,
    <Const.str l.1 at 0x7f23b2e35978>,
    <Const.bool l.1 at 0x7f23b2e359b0>,
    <Const.NoneType l.1 at 0x7f23b2e359e8>,
    <Const.bytes l.1 at 0x7f23b2e35a20>]
    )r5   kindNr   r5   r	   r   r   r   r}   r   r  r   r   r   r-   r   c                   || _         	 || _        	 t                                          |||||           t	          j        | d           dS )a}  
        :param value: The value that the constant represents.

        :param lineno: The line that this node appears on in the source code.

        :param col_offset: The column that this node appears on in the
            source code.

        :param parent: The parent node in the syntax tree.

        :param kind: The string prefix. "u" for u-prefixed strings and ``None`` otherwise. Python 3.8+ only.

        :param end_lineno: The last line this node appears on in the source code.

        :param end_col_offset: The end column this node appears on in the
            source code. Note: This is after the last symbol.
        r   N)r5   r  r   r   r   )	r   r5   r   r   r}   r  r   r   r   s	           r6   r   zConst.__init__  sd    8  
5 $	f!!) 	 	
 	
 	
 	$%%%%%r8   zClassVar[InferUnaryOp[Const]]infer_unary_opzClassVar[InferBinaryOp[Const]]infer_binary_opc                `    |dk    rt           t                                          |          S )Nr5   )AttributeErrorr   __getattr__)r   r   r   s     r6   r  zConst.__getattr__  s/     7? 	!  ww""4(((r8   r@   rA   c                V   t          |t                    r|j        }nGt          |t                    rt	          ||          }n t          dt          |           d          	 t          | j        t          t          f          rt          | j        |                   S no# t          $ r }t          d| j        d|          |d}~wt          $ r}t          d| ||          |d}~wt          $ r}t          d	| ||          |d}~ww xY wt          | d
| j         d          )a%  Get an item from this node if subscriptable.

        :param index: The node to use as a subscript index.
        :type index: Const or Slice

        :raises AstroidTypeError: When the given index cannot be used as a
            subscript index, or if this node is not subscriptable.
        rh   zCould not use type r   zCould not index z with NzIndex {index!r} out of rangerv   r   z (value=rC  )r1   ri   r5   r   r~   r   rk   r   bytesr   r   r   r   r   )r   rn   r@   index_valuer   s        r6   getitemzConst.getitem  s    eU## 	+KKu%% 	&ug>>>KK #Fd5kkFFF  	$*sEl33 6TZ45556 	 	 	#F4:FF{FF   	 	 	#6	  
   	 	 	".TPW  	
 $??$*???@@@s0   &:B" "
D,CDC((D5D		Dr.   c                    dS )zCheck if the node has a custom __getattr__ or __getattribute__.

        :returns: Whether the class has a custom __getattr__ or __getattribute__.
            For a :class:`Const` this is always ``False``.
        Fr   r   s    r6   has_dynamic_getattrzConst.has_dynamic_getattr  s	     ur8   c                    t          | j        t                    rd | j        D             S t          dt	          | j                            )zAn iterator over the elements this node contains.

        :returns: The contents of this node.
        :rtype: iterable(Const)

        :raises TypeError: If this node does not represent something that is iterable.
        c                ,    g | ]}t          |          S r   )r   rr   s     r6   r   z Const.itered.<locals>.<listcomp>  s     ???DM$''???r8   zCannot iterate over type )r1   r5   r   r   rk   r   s    r6   r   zConst.itered  sP     dj#&& 	@??DJ????HD4D4DHHIIIr8   r   c                4    | j                                         S )r   )_proxiedqnamer   s    r6   r   zConst.pytype  s    
 }""$$$r8   c                *    t          | j                  S zzDetermine the boolean value of this node.

        :returns: The boolean value of this node.
        :rtype: bool
        )r.   r5   r   s     r6   r   zConst.bool_value&       DJr8   r   )r5   r	   r   r   r   r   r}   r   r  r   r   r   r   r   r-   r   r0   r  r;  r   )r   r   r   r   r   r   r   r  r  r  r   r   r   r   r   s   @r6   ri   ri     s          &M
 "!% $*& "&%)*& *& *& *& *& *& *& *&X 21113333	) 	) 	) 	) 	)&A &A &A &A &AP   
J 
J 
J% % % %                 r8   ri   c                      e Zd ZdZdS )ContinuezClass representing an :class:`ast.Continue` node.

    >>> import astroid
    >>> node = astroid.extract_node('continue')
    >>> node
    <Continue l.1 at 0x7f23b2e35588>
    Nr  r   r8   r6   r  r  /  r  r8   r  c                  N     e Zd ZdZdZ	 	 	 ddddd fdZddZddZd Z xZ	S )
Decoratorsa  A node representing a list of decorators.

    A :class:`Decorators` is the decorators that are applied to
    a method or function.

    >>> import astroid
    >>> node = astroid.extract_node('''
    @property
    def my_property(self):
        return 3
    ''')
    >>> node
    <FunctionDef.my_property l.2 at 0x7f23b2e35d30>
    >>> list(node.get_children())[0]
    <Decorators l.1 at 0x7f23b2e35d68>
    r(   Nr   r   r   r   r}   r   r   r   r-   r   c               Z    |  	 t                                          |||||           dS r   r   r   r   s         r6   r   zDecorators.__init__M  sL    , 	 	
 	!!) 	 	
 	
 	
 	
 	
r8   r)   r   c                    || _         dS )zDo some setup after initialisation.

        :param nodes: The decorators that this node contains.
        :type nodes: list(Name or Call)
        Nr(   )r   r)   s     r6   r   zDecorators.postinitq  s     


r8   r*   c                    | j         st          |           | j         j         st          | j                   | j         j                                         S zThe first parent node defining a new scope.
        These can be Module, FunctionDef, ClassDef, Lambda, or GeneratorExp nodes.

        :returns: The first parent scope node.
        ru  )r}   r   r   r   s    r6   r   zDecorators.scopey  sV     { 	2$D1111{! 	9$DK8888{!'')))r8   c              #  $   K   | j         E d {V  d S r0   r(   r   s    r6   r   zDecorators.get_children  s&      :r8   r   r   )r)   r   r-   r   r-   r*   )
r   r   r   r   r   r   r   r   r   r   r   s   @r6   r  r  9  s         " !O "!% $	"
 "&%)"
 "
 "
 "
 "
 "
 "
 "
H   * * * *      r8   r  c                  |     e Zd ZdZdZdZ ej        d          	 	 	 	 ddddd fd            ZdddZ	d Z
 xZS )DelAttra  Variation of :class:`ast.Delete` representing deletion of an attribute.

    >>> import astroid
    >>> node = astroid.extract_node('del self.attr')
    >>> node
    <Delete l.1 at 0x7f23b2e35f60>
    >>> list(node.get_children())[0]
    <DelAttr.attr l.1 at 0x7f23b2e411d0>
    rL  rN  r   Nr   rO  r   r   r   r   r}   r   r   r   r-   r   c               t    d| _         	 || _        	 t                                          |||||           dS )a  
        :param attrname: The name of the attribute that is being deleted.

        :param lineno: The line that this node appears on in the source code.

        :param col_offset: The column that this node appears on in the
            source code.

        :param parent: The parent node in the syntax tree.

        :param end_lineno: The last line this node appears on in the source code.

        :param end_col_offset: The end column this node appears on in the
            source code. Note: This is after the last symbol.
        Nr   rQ  rR  s          r6   r   zDelAttr.__init__  sW    4 $(		
 %->!!) 	 	
 	
 	
 	
 	
r8   rM  c                    || _         dS zDo some setup after initialisation.

        :param expr: The name that this node represents.
        :type expr: Name or None
        NrL  rT  s     r6   r   zDelAttr.postinit       			r8   c              #     K   | j         V  d S r0   rL  r   s    r6   r   zDelAttr.get_children  rV  r8   r   rW  r0   rX  r   r   r   r   r   r   r   r   r   r   r   r   r   s   @r6   r  r    s           O!M1Z15AAA  $!!% $(
 "&%)(
 (
 (
 (
 (
 (
 (
 BA(
T          r8   r  c                  H     e Zd ZdZdZ	 	 	 ddddd fdZdddZd Z xZS )DeletezClass representing an :class:`ast.Delete` node.

    A :class:`Delete` is a ``del`` statement this is deleting something.

    >>> import astroid
    >>> node = astroid.extract_node('del self.attr')
    >>> node
    <Delete l.1 at 0x7f23b2e35f60>
    rf  Nr   r   r   r   r}   r   r   r   r-   r   c               d    g | _         	 t                                          |||||           dS r   )rf  r   r   r   s         r6   r   zDelete.__init__  sI    , &($!!) 	 	
 	
 	
 	
 	
r8   rf  r   c                    |	|| _         dS dS )z\Do some setup after initialisation.

        :param targets: What is being deleted.
        Nr  )r   rf  s     r6   r   zDelete.postinit  s!    
  	#"DLLL	# 	#r8   c              #  $   K   | j         E d {V  d S r0   r  r   s    r6   r   zDelete.get_children	  s&      <r8   r   r   r0   )rf  r   r-   r   rb  r   s   @r6   r  r    s          #O "!% $	
 "&%)
 
 
 
 
 
 
 
B# # # # #             r8   r  c                       e Zd ZU dZdZ	 	 	 d!dddd" fdZd#dZded<   ed$d            Z	d%dZ
d Zd Zd Z	 d$d&dZd$d'd Z xZS )(DictzClass representing an :class:`ast.Dict` node.

    A :class:`Dict` is a dictionary that is created with ``{}`` syntax.

    >>> import astroid
    >>> node = astroid.extract_node('{1: "1"}')
    >>> node
    <Dict.dict l.1 at 0x7f23b2e35cc0>
    itemsNr   r   r   r   r}   r   r   r   r-   r   c               d    g | _         	 t                                          |||||           dS r   )r   r   r   r   s         r6   r   zDict.__init__	  sN    0  	
 	?!!) 	 	
 	
 	
 	
 	
r8   r   Alist[tuple[SuccessfulInferenceResult, SuccessfulInferenceResult]]c                    || _         dS )ztDo some setup after initialisation.

        :param items: The key-value pairs contained in the dictionary.
        Nr  )r   r   s     r6   r   zDict.postinit9	  s     


r8   zClassVar[InferUnaryOp[Dict]]r  c                t     |             }|g |_         n#d |                                 D             |_         |S )zCreate a :class:`Dict` of constants from a live dictionary.

        :param items: The items to store in the node.
        :type items: dict

        :returns: The created dictionary node.
        :rtype: Dict
        Nc                    g | ]C\  }}t          |          t          |          t          |          rt          |          n|fDS r   r   )rs   kvs      r6   r   z&Dict.from_elements.<locals>.<listcomp>R	  s]       AqQ<<	q!!y||#J=#3#3#3K  r8   r  )r   r   rC   s      r6   r   zDict.from_elementsD	  sO     suu 	DJJ !KKMM  DJ r8   Literal['builtins.dict']c                    dS )r   zbuiltins.dictr   r   s    r6   r   zDict.pytypeZ	  	    
 r8   c              #  4   K   | j         D ]\  }}|V  |V  dS )zGet the key and value nodes below this node.

        Children are returned in the order that they are defined in the source
        code, key first then the value.

        :returns: The children.
        :rtype: iterable(NodeNG)
        Nr  )r   keyr5   s      r6   r   zDict.get_childrena	  s;       * 	 	JCIIIKKKK	 	r8   c                :    | j         r| j         d         d         S dS )zAn optimized version of list(get_children())[-1]

        :returns: The last child, or None if no children exist.
        :rtype: NodeNG or None
        r   rO   Nr  r   s    r6   r  zDict.last_childn	  s$     : 	%:b>!$$tr8   c                $    d | j         D             S )zAn iterator over the keys this node contains.

        :returns: The keys of this node.
        :rtype: iterable(NodeNG)
        c                    g | ]\  }}|S r   r   )rs   r,  r  s      r6   r   zDict.itered.<locals>.<listcomp>~	  s    ///a///r8   r  r   s    r6   r   zDict.iteredx	  s     0/DJ////r8   rn   Const | Slicer@   rA   r   c                   ddl m} | j        D ]\  }}t          |t                    rR |||          }t          |t
                    s<	 |                    ||          c S # t          t          f$ r Y hw xY w|	                    |          D ]Q}|t          j        u rt          |t                    r+t          |t                    r|j        |j        k    r|c c S Rt          |          )aT  Get an item from this node.

        :param index: The node to use as a subscript index.

        :raises AstroidTypeError: When the given index cannot be used as a
            subscript index, or if this node is not subscriptable.
        :raises AstroidIndexError: If the given index does not exist in the
            dictionary.
        r   )
safe_infer)astroid.helpersr2  r   r1   
DictUnpackr  r  r   r   rH   r   rE   ri   r5   )r   rn   r@   r2  r,  r5   inferred_valueinferredkeys           r6   r  zDict.getitem	  s2    	/.....* 	% 	%JC#z** !+E7!;!;!.$77 )11%AAAAA(*;<   H  #yy11 % %$"22 k511 %j6N6N %"(EK7 %$%  &&&s   A##A76A7c                *    t          | j                  S r  )r.   r   r   s     r6   r   zDict.bool_value	  r  r8   r   r   )r   r"  r-   r   r0   )r-   r(  )rn   r0  r@   rA   r-   r   r  )r   r   r   r   r   r   r   r   r   r   r   r   r  r   r  r   r   r   s   @r6   r  r  		  s.          !O "!% $	!
 "&%)!
 !
 !
 !
 !
 !
 !
 !
F    1000   [*       0 0 0 HL"' "' "' "' "'H                 r8   r  c                  N     e Zd ZdZdZ	 	 	 ddddd fdZdddZd Zd Z xZ	S )Expra6  Class representing an :class:`ast.Expr` node.

    An :class:`Expr` is any expression that does not have its value used or
    stored.

    >>> import astroid
    >>> node = astroid.extract_node('method()')
    >>> node
    <Call l.1 at 0x7f23b2e352b0>
    >>> node.parent
    <Expr l.1 at 0x7f23b2e35278>
    r4   Nr   r   r   r   r}   r   r   r   r-   r   c               d    d| _         	 t                                          |||||           dS r_  r5   r   r   r   s         r6   r   zExpr.__init__	  I    , %)
'!!) 	 	
 	
 	
 	
 	
r8   r5   c                    || _         dS )z]Do some setup after initialisation.

        :param value: What the expression does.
        Nr4   r   r5   s     r6   r   zExpr.postinit	      
 


r8   c              #     K   | j         V  d S r0   r4   r   s    r6   r   zExpr.get_children	        jr8   c              #  d   K   | j         j        s!| j                                         E d {V  d S d S r0   )r5   	is_lambdaro  r   s    r6   ro  z"Expr._get_yield_nodes_skip_lambdas	  sL      z# 	Bz??AAAAAAAAAAA	B 	Br8   r   r   r0   r5   r   r-   r   
r   r   r   r   r   r   r   r   ro  r   r   s   @r6   r9  r9  	  s          !O "!% $	
 "&%)
 
 
 
 
 
 
 
B      B B B B B B Br8   r9  c                      e Zd ZdZdS )EllipsiszClass representing an :class:`ast.Ellipsis` node.

    An :class:`Ellipsis` is the ``...`` syntax.

    Deprecated since v2.6.0 - Use :class:`Const` instead.
    Will be removed with the release v2.7.0
    Nr  r   r8   r6   rG  rG  	  r  r8   rG  c                      e Zd ZdZdZddZdS )	EmptyNodezAHolds an arbitrary object in the :attr:`LocalsDictNodeNG.locals`.Nr-   r.   c                0    | j         d uo| j         t          uS r0   )objectr   r   s    r6   has_underlying_objectzEmptyNode.has_underlying_object	  s    {$&R4;>R+RRr8   r;  )r   r   r   r   rK  rL  r   r8   r6   rI  rI  	  s9        KKFS S S S S Sr8   rI  c                  ~     e Zd ZU dZdZdZ	 	 	 ddddd fdZded<   	 d Z	 	 	 dd dZ	e
d             Zd!dZ xZS )"ExceptHandlera  Class representing an :class:`ast.ExceptHandler`. node.

    An :class:`ExceptHandler` is an ``except`` block on a try-except.

    >>> import astroid
    >>> node = astroid.extract_node('''
        try:
            do_something()
        except Exception as error:
            print("Error!")
        ''')
    >>> node
    <TryExcept l.2 at 0x7f23b2e9d908>
    >>> node.handlers
    [<ExceptHandler l.4 at 0x7f23b2e9e860>]
    rk   r   rQ   rQ   Nr   r   r   r   r}   r   r   r   r-   r   c                   d| _         	 d| _        	 g | _        	 t                                          |||||           dS r_  )rk   r   rQ   r   r   r   s         r6   r   zExceptHandler.__init__
  sa    , $(		
 (,	@"$	(!!) 	 	
 	
 	
 	
 	
r8   z*ClassVar[AssignedStmtsCall[ExceptHandler]]r   c              #  d   K   | j         	| j         V  | j        	| j        V  | j        E d {V  d S r0   rO  r   s    r6   r   zExceptHandler.get_childrenF
  sP      9 	)OOO9 	)OOO9r8   rk   r   AssignName | NonerQ   r   c                8    || _         || _        |	|| _        dS dS )a	  Do some setup after initialisation.

        :param type: The types that the block handles.
        :type type: Tuple or NodeNG or None

        :param name: The name that the caught exception is assigned to.

        :param body:The contents of the block.
        NrO  )r   rk   r   rQ   s       r6   r   zExceptHandler.postinitP
  s/     		 	DIII	 	r8   c                \    | j         r| j         j        S | j        r| j        j        S | j        S PThe line on which the beginning of this block ends.

        :type: int
        )r   tolinenork   r   r   s    r6   blockstart_tolinenoz!ExceptHandler.blockstart_tolinenod
  s6     9 	&9%%9 	&9%%{r8   rL   rM   r.   c                ~    | j         dS t          fd| j                                         D                       S )zzCheck if this node handles any of the given

        :param exceptions: The names of the exceptions to check for.
        NTc              3  *   K   | ]}|j         v V  d S r0   r   )rs   rC   rL   s     r6   ru   z&ExceptHandler.catch.<locals>.<genexpr>w
  s*      SSt49
*SSSSSSr8   )rk   rX   r   )r   rL   s    `r6   rW   zExceptHandler.catchp
  sL    
 9 	
 	4SSSSty7P7P7R7RSSSSSSr8   r   r   )rk   r   r   rS  rQ   r   r-   r   rL   rM   r-   r.   )r   r   r   r   r   _multi_line_block_fieldsr   r   r   r   r+   rY  rW   r   r   s   @r6   rN  rN   
  s          " /O( "!% $	(
 "&%)(
 (
 (
 (
 (
 (
 (
 (
T ?>>>   #"&$(	    ( 	 	 _	T T T T T T T Tr8   rN  c                      e Zd ZdZdS )ExtSlicezClass representing an :class:`ast.ExtSlice` node.

    An :class:`ExtSlice` is a complex slice expression.

    Deprecated since v2.6.0 - Now part of the :class:`Subscript` node.
    Will be removed with the release of v2.7.0
    Nr  r   r8   r6   r_  r_  z
  r  r8   r_  c                       e Zd ZU dZdZdZdZdZ	 	 	 	 ddddd fdZ	 	 	 	 	 dd dZ	de
d<   	 ed             Zd Z xZS )!ForzClass representing an :class:`ast.For` node.

    >>> import astroid
    >>> node = astroid.extract_node('for thing in things: print(thing)')
    >>> node
    <For l.1 at 0x7f23b2e8cf28>
    ru  r  rQ   rR   rg  rQ   rR   TNr   r   r   r   r}   r   r   r   r-   r   c                   d| _         	 d| _        	 g | _        	 g | _        	 d| _        	 t                                          |||||           dS r_  )ru  r  rQ   rR   rh  r   r   r   s         r6   r   zFor.__init__
  sr    , &*'#'	*"$	3$&=.2X!!) 	 	
 	
 	
 	
 	
r8   ru  r  rQ   r   rR   rh  c                T    || _         || _        ||| _        ||| _        || _        dS )a  Do some setup after initialisation.

        :param target: What the loop assigns to.

        :param iter: What the loop iterates over.

        :param body: The contents of the body of the loop.

        :param orelse: The contents of the ``else`` block of the loop.
        N)ru  r  rQ   rR   rh  )r   ru  r  rQ   rR   rh  s         r6   r   zFor.postinit
  s>    $ 	 	DI 	! DK.r8   z ClassVar[AssignedStmtsCall[For]]r   c                    | j         j        S rV  )r  rX  r   s    r6   rY  zFor.blockstart_tolineno
       y!!r8   c              #  b   K   | j         V  | j        V  | j        E d {V  | j        E d {V  d S r0   rb  r   s    r6   r   zFor.get_children
  sY      ki9;r8   r   r   )NNNNN)ru  r   r  r   rQ   r   rR   r   rh  r   r-   r   )r   r   r   r   r   rp  r]  r  r   r   r   r+   rY  r   r   r   s   @r6   ra  ra  
  s         
  ;O.1O "!% $	+
 "&%)+
 +
 +
 +
 +
 +
 +
 +
` !%"$(&*)-/ / / / /4 5444 " " _"      r8   ra  c                      e Zd ZdZdS )AsyncFora  Class representing an :class:`ast.AsyncFor` node.

    An :class:`AsyncFor` is an asynchronous :class:`For` built with
    the ``async`` keyword.

    >>> import astroid
    >>> node = astroid.extract_node('''
    async def func(things):
        async for thing in things:
            print(thing)
    ''')
    >>> node
    <AsyncFunctionDef.func l.2 at 0x7f23b2e416d8>
    >>> node.body[0]
    <AsyncFor l.3 at 0x7f23b2e417b8>
    Nr  r   r8   r6   rj  rj  
  s           r8   rj  c                  H     e Zd ZdZdZ	 	 	 ddddd fdZdddZd Z xZS )Awaita  Class representing an :class:`ast.Await` node.

    An :class:`Await` is the ``await`` keyword.

    >>> import astroid
    >>> node = astroid.extract_node('''
    async def func(things):
        await other_func()
    ''')
    >>> node
    <AsyncFunctionDef.func l.2 at 0x7f23b2e41748>
    >>> node.body[0]
    <Expr l.3 at 0x7f23b2e419e8>
    >>> list(node.body[0].get_children())[0]
    <Await l.3 at 0x7f23b2e41a20>
    r4   Nr   r   r   r   r}   r   r   r   r-   r   c               d    d| _         	 t                                          |||||           dS r_  r;  r   s         r6   r   zAwait.__init__  sI    , %)
!!) 	 	
 	
 	
 	
 	
r8   r5   c                    || _         dS )zUDo some setup after initialisation.

        :param value: What to wait for.
        Nr4   r>  s     r6   r   zAwait.postinit@  r?  r8   c              #     K   | j         V  d S r0   r4   r   s    r6   r   zAwait.get_childrenG  rA  r8   r   r   r0   rD  rb  r   s   @r6   rl  rl    s         " !O "!% $	
 "&%)
 
 
 
 
 
 
 
B          r8   rl  c                  :     e Zd ZdZdZ	 	 	 	 ddddd fdZ xZS )
ImportFromzClass representing an :class:`ast.ImportFrom` node.

    >>> import astroid
    >>> node = astroid.extract_node('from my_package import my_module')
    >>> node
    <ImportFrom l.1 at 0x7f23b2e415c0>
    )modnamenameslevelr   Nr   fromnamer   rs  list[tuple[str, str | None]]rt  r   r   r   r}   r   r   r   r-   r   c                   || _         	 || _        	 || _        	 t                                          |||||           dS )a  
        :param fromname: The module that is being imported from.

        :param names: What is being imported from the module.

        :param level: The level of relative import.

        :param lineno: The line that this node appears on in the source code.

        :param col_offset: The column that this node appears on in the
            source code.

        :param parent: The parent node in the syntax tree.

        :param end_lineno: The last line this node appears on in the source code.

        :param end_col_offset: The end column this node appears on in the
            source code. Note: This is after the last symbol.
        r   N)rr  rs  rt  r   r   )
r   ru  rs  rt  r   r   r}   r   r   r   s
            r6   r   zImportFrom.__init__V  si    > $,	
 49
	 "'
	 	!!) 	 	
 	
 	
 	
 	
r8   )r   NNN)ru  r   rs  rv  rt  r   r   r   r   r   r}   r   r   r   r   r   r-   r   r   r   r   r   r   r   r   r   s   @r6   rq  rq  K  ss          2M !!% $:
 "&%):
 :
 :
 :
 :
 :
 :
 :
 :
 :
 :
 :
r8   rq  c                  |     e Zd ZdZdZdZ ej        d          	 	 	 	 ddddd fd            ZdddZ	d Z
 xZS )	Attributez2Class representing an :class:`ast.Attribute` node.rL  rN  r   Nr   rO  r   r   r   r   r}   r   r   r   r-   r   c               t    d| _         	 || _        	 t                                          |||||           dS )a  
        :param attrname: The name of the attribute.

        :param lineno: The line that this node appears on in the source code.

        :param col_offset: The column that this node appears on in the
            source code.

        :param parent: The parent node in the syntax tree.

        :param end_lineno: The last line this node appears on in the source code.

        :param end_col_offset: The end column this node appears on in the
            source code. Note: This is after the last symbol.
        Nr   rQ  rR  s          r6   r   zAttribute.__init__  sW    4 $(		
 %-(!!) 	 	
 	
 	
 	
 	
r8   rM  c                    || _         dS r  rL  rT  s     r6   r   zAttribute.postinit  r  r8   c              #     K   | j         V  d S r0   rL  r   s    r6   r   zAttribute.get_children  rV  r8   r   rW  r0   rX  r  r   s   @r6   rz  rz    s        <<O!M1Z15AAA  $!!% $(
 "&%)(
 (
 (
 (
 (
 (
 (
 BA(
T          r8   rz  c                  >     e Zd ZdZdZ	 	 	 ddddd fdZd Z xZS )GlobalzClass representing an :class:`ast.Global` node.

    >>> import astroid
    >>> node = astroid.extract_node('global a_global')
    >>> node
    <Global l.1 at 0x7f23b2e9de10>
    rs  Nr   rs  	list[str]r   r   r   r}   r   r   r   r-   r   c               d    || _         	 t                                          |||||           dS )a  
        :param names: The names being declared as global.

        :param lineno: The line that this node appears on in the source code.

        :param col_offset: The column that this node appears on in the
            source code.

        :param parent: The parent node in the syntax tree.

        :param end_lineno: The last line this node appears on in the source code.

        :param end_col_offset: The end column this node appears on in the
            source code. Note: This is after the last symbol.
        r   Nrs  r   r   r   rs  r   r   r}   r   r   r   s          r6   r   zGlobal.__init__  sI    2 !&
1!!) 	 	
 	
 	
 	
 	
r8   c                    |S r0   r   r  s      r6   r  zGlobal._infer_name      r8   r   rs  r  r   r   r   r   r}   r   r   r   r   r   r-   r   r   r   r   r   r   r   r  r   r   s   @r6   r  r    s          M
 "!% $"
 "&%)"
 "
 "
 "
 "
 "
 "
 "
H      r8   r  c                       e Zd ZdZdZdZ	 	 	 ddddd fdZ	 	 	 dddZed             Z	d Z
d Zd Z fdZd dZd dZ xZS )!rT   zClass representing an :class:`ast.If` node.

    >>> import astroid
    >>> node = astroid.extract_node('if condition: print(True)')
    >>> node
    <If l.1 at 0x7f23b2e9dd30>
    r\  rQ   rR   rc  Nr   r   r   r   r}   r   r   r   r-   r   c                   d| _         	 g | _        	 g | _        	 d| _        	 t	                                          |||||           dS )r   NFr   )r\  rQ   rR   	is_orelser   r   r   s         r6   r   zIf.__init__  sg    , $(	5"$	($&1$S!!) 	 	
 	
 	
 	
 	
r8   r\  rQ   r   rR   c                    || _         ||| _        ||| _        t          | j        t
                    r| | j        j        v rd| _        dS dS dS )Do some setup after initialisation.

        :param test: The condition that the statement tests.

        :param body: The contents of the block.

        :param orelse: The contents of the ``else`` block.
        NT)r\  rQ   rR   r1   r}   rT   r  r   r\  rQ   rR   s       r6   r   zIf.postinit9  sm     	 	DI 	! DKdk2&& 	"44;3E+E 	"!DNNN	" 	" 	" 	"r8   c                    | j         j        S rV  r\  rX  r   s    r6   rY  zIf.blockstart_tolinenoO  rg  r8   c                    || j         d         j        k    r||fS || j         d         j        k    r|| j         d         j        fS |                     || j        | j         d         j        dz
            S )8  Get a range from the given line number to where this node ends.

        :param lineno: The line number to start the range at.
        :type lineno: int

        :returns: The range of line numbers that this node belongs to,
            starting at the given line number.
        :rtype: tuple(int, int)
        r   r   rO   )rQ   r  rX  _elsed_block_rangerR   r   r   s     r6   block_rangezIf.block_rangeW  sw     TYq\,, 	"6>!TYr]++ 	249R=111&&vt{DIaL<SVW<WXXXr8   c              #  P   K   | j         V  | j        E d {V  | j        E d {V  d S r0   r  r   s    r6   r   zIf.get_childreng  K      i9;r8   c                r    t          | j                  dk    ot          | j        d         t                    S )NrO   r   )r  rR   r1   rT   r   s    r6   has_elif_blockzIf.has_elif_blockm  s,    4;1$GDKNB)G)GGr8   c              #     K   | j                                         E d{V  t                                                      E d{V  dS )z/An If node can contain a Yield node in the testNr\  ro  r   r  s    r6   ro  z If._get_yield_nodes_skip_lambdasp  [      9::<<<<<<<<<7788:::::::::::r8   r.   c                   t          j        dt                     t          | j        t
                    rW| j        j        }t          |t                    r|j        }t          |t                    r|
                                dk    rdS dS )a^  Return True if IF stmt is a sys.version_info guard.

        >>> import astroid
        >>> node = astroid.extract_node('''
        import sys
        if sys.version_info > (3, 8):
            from typing import Literal
        else:
            from typing_extensions import Literal
        ''')
        >>> node.is_sys_guard()
        True
        zThe 'is_sys_guard' function is deprecated and will be removed in astroid 3.0.0 It has been moved to pylint and can be imported from 'pylint.checkers.utils' starting with pylint 2.12zsys.version_infoTF)warningswarnDeprecationWarningr1   r\  r  r  	Subscriptr5   rz  r"  r>  s     r6   is_sys_guardzIf.is_sys_guardu  s     	( 		
 	
 	
 di)) 	INE%++ $%++ 0A0AEW0W tur8   c                    t          j        dt                     t          | j        t
          t          f          o+| j                                                            d          S )a  Return True if IF stmt is a typing guard.

        >>> import astroid
        >>> node = astroid.extract_node('''
        from typing import TYPE_CHECKING
        if TYPE_CHECKING:
            from xyz import a
        ''')
        >>> node.is_typing_guard()
        True
        zThe 'is_typing_guard' function is deprecated and will be removed in astroid 3.0.0 It has been moved to pylint and can be imported from 'pylint.checkers.utils' starting with pylint 2.12r   )	r  r  r  r1   r\  r   rz  r"  endswithr   s    r6   is_typing_guardzIf.is_typing_guard  sf     	( 		
 	
 	
 Ii(
 
 >i!!##,,_==	>r8   r   r   r\  r   rQ   r   rR   r   r-   r   r;  )r   r   r   r   r   r]  r   r   r+   rY  r  r   r  ro  r  r  r   r   s   @r6   rT   rT     s*         1O1 "!% $	(
 "&%)(
 (
 (
 (
 (
 (
 (
 (
X #$(&*	" " " " ", " " _"Y Y Y   H H H; ; ; ; ;
   :> > > > > > > >r8   rT   c                  V     e Zd ZdZdZ	 	 	 ddddd fdZ	 	 	 dddZd ZddZ xZ	S )IfExpzClass representing an :class:`ast.IfExp` node.
    >>> import astroid
    >>> node = astroid.extract_node('value if condition else other')
    >>> node
    <IfExp l.1 at 0x7f23b2e9dbe0>
    r  Nr   r   r   r   r}   r   r   r   r-   r   c                   d| _         	 d| _        	 d| _        	 t                                          |||||           dS r_  r\  rQ   rR   r   r   r   s         r6   r   zIfExp.__init__  s]    , $(	5#'	(%)1!!) 	 	
 	
 	
 	
 	
r8   r\  rQ   rR   c                0    || _         || _        || _        dS )r  Nr  r  s       r6   r   zIfExp.postinit  s     		r8   c              #  @   K   | j         V  | j        V  | j        V  d S r0   r  r   s    r6   r   zIfExp.get_children  s0      iikr8   Literal[False]c                    dS )NFr   r   s    r6   r  zIfExp.op_left_associative  s	     ur8   r   r   )r\  r   rQ   r   rR   r   r-   r   )r-   r  )
r   r   r   r   r   r   r   r   r  r   r   s   @r6   r  r    s          1O "!% $	%
 "&%)%
 %
 %
 %
 %
 %
 %
 %
R #" $	    $  
       r8   r  c                  h     e Zd ZdZdZ ej        d          	 	 	 	 ddddd fd            Z xZS )ImportzClass representing an :class:`ast.Import` node.
    >>> import astroid
    >>> node = astroid.extract_node('import astroid')
    >>> node
    <Import l.1 at 0x7f23b2e4e5c0>
    r  rv  Nr   rs  #list[tuple[str, str | None]] | Noner   r   r   r}   r   r   r   r-   r   c               h    |pg | _         	 t                                          |||||           dS )a  
        :param names: The names being imported.

        :param lineno: The line that this node appears on in the source code.

        :param col_offset: The column that this node appears on in the
            source code.

        :param parent: The parent node in the syntax tree.

        :param end_lineno: The last line this node appears on in the source code.

        :param end_col_offset: The end column this node appears on in the
            source code. Note: This is after the last symbol.
        r   Nr  r  s          r6   r   zImport.__init__  sQ    4 49;B
	 	!!) 	 	
 	
 	
 	
 	
r8   r   )rs  r  r   r   r   r   r}   r   r   r   r   r   r-   r   r   r   s   @r6   r  r    s          M1Z18VWWW 6:!!% $&
 "&%)&
 &
 &
 &
 &
 &
 &
 XW&
 &
 &
 &
 &
r8   r  c                      e Zd ZdZdS )IndexzClass representing an :class:`ast.Index` node.

    An :class:`Index` is a simple subscript.

    Deprecated since v2.6.0 - Now part of the :class:`Subscript` node.
    Will be removed with the release of v2.7.0
    Nr  r   r8   r6   r  r  +  r  r8   r  c                  N     e Zd ZdZdZdZ	 	 	 	 ddddd fdZdddZd Z xZ	S )KeywordzClass representing an :class:`ast.keyword` node.

    >>> import astroid
    >>> node = astroid.extract_node('function(a_kwarg=True)')
    >>> node
    <Call l.1 at 0x7f23b2e9e320>
    >>> node.keywords
    [<Keyword l.1 at 0x7f23b2e9e9b0>]
    r4   r  Nr   r(  r   r   r   r   r}   r   r   r   r-   r   c               t    || _         	 d| _        	 t                                          |||||           dS )a  
        :param arg: The argument being assigned to.

        :param lineno: The line that this node appears on in the source code.

        :param col_offset: The column that this node appears on in the
            source code.

        :param parent: The parent node in the syntax tree.

        :param end_lineno: The last line this node appears on in the source code.

        :param end_col_offset: The end column this node appears on in the
            source code. Note: This is after the last symbol.
        Nr   )r(  r5   r   r   )r   r(  r   r   r}   r   r   r   s          r6   r   zKeyword.__init__C  sS    2  #-$(
?!!) 	 	
 	
 	
 	
 	
r8   r5   c                    || _         dS )zuDo some setup after initialisation.

        :param value: The value being assigned to the keyword argument.
        Nr4   r>  s     r6   r   zKeyword.postinitj  r?  r8   c              #     K   | j         V  d S r0   r4   r   s    r6   r   zKeyword.get_childrenq  rA  r8   r   )r(  r   r   r   r   r   r}   r   r   r   r   r   r-   r   r0   rD  
r   r   r   r   r   r   r   r   r   r   r   s   @r6   r  r  5  s          !OM !!% $%
 "&%)%
 %
 %
 %
 %
 %
 %
 %
N          r8   r  c                  n     e Zd ZU dZdZ	 	 	 	 ddddd fdZded<   	 ded<   ded<   ddZdd dZ xZ	S )!r<   zClass representing an :class:`ast.List` node.

    >>> import astroid
    >>> node = astroid.extract_node('[1, 2, 3]')
    >>> node
    <List.list l.1 at 0x7f23b2e9e128>
    ctxNr   r  Context | Noner   r   r   r}   r   r   r   r-   r   c               d    || _         	 t                                          |||||           dS )  
        :param ctx: Whether the list is assigned to or loaded from.

        :param lineno: The line that this node appears on in the source code.

        :param col_offset: The column that this node appears on in the
            source code.

        :param parent: The parent node in the syntax tree.

        :param end_lineno: The last line this node appears on in the source code.

        :param end_col_offset: The end column this node appears on in the
            source code. Note: This is after the last symbol.
        r   Nr  r   r   r   r  r   r   r}   r   r   r   s          r6   r   zList.__init__  sI    2 $'=!!) 	 	
 	
 	
 	
 	
r8   z!ClassVar[AssignedStmtsCall[List]]r   zClassVar[InferUnaryOp[List]]r  zClassVar[InferBinaryOp[List]]r  Literal['builtins.list']c                    dS )r   zbuiltins.listr   r   s    r6   r   zList.pytype  r*  r8   r@   rA   c                2    t          | | j        ||          S zGet an item from this node.

        :param index: The node to use as a subscript index.
        :type index: Const or Slice
        rh   r   rD   r   rn   r@   s      r6   r  zList.getitem       "$	5'JJJJr8   r   r  r  r   r   r   r   r}   r   r   r   r   r   r-   r   )r-   r  r0   r  
r   r   r   r   r   r   r   r   r  r   r   s   @r6   r<   r<   u  s           M #!!% $"
 "&%)"
 "
 "
 "
 "
 "
 "
 "
H 6555 10002222   K K K K K K K K Kr8   r<   c                  >     e Zd ZdZdZ	 	 	 ddddd fdZd Z xZS )Nonlocala   Class representing an :class:`ast.Nonlocal` node.

    >>> import astroid
    >>> node = astroid.extract_node('''
    def function():
        nonlocal var
    ''')
    >>> node
    <FunctionDef.function l.2 at 0x7f23b2e9e208>
    >>> node.body[0]
    <Nonlocal l.3 at 0x7f23b2e9e908>
    r  Nr   rs  r  r   r   r   r}   r   r   r   r-   r   c               d    || _         	 t                                          |||||           dS )a  
        :param names: The names being declared as not local.

        :param lineno: The line that this node appears on in the source code.

        :param col_offset: The column that this node appears on in the
            source code.

        :param parent: The parent node in the syntax tree.

        :param end_lineno: The last line this node appears on in the source code.

        :param end_col_offset: The end column this node appears on in the
            source code. Note: This is after the last symbol.
        r   Nr  r  s          r6   r   zNonlocal.__init__  sI    2 !&
4!!) 	 	
 	
 	
 	
 	
r8   c                    |S r0   r   r  s      r6   r  zNonlocal._infer_name  r  r8   r   r  r  r   s   @r6   r  r    s          M
 "!% $"
 "&%)"
 "
 "
 "
 "
 "
 "
 "
H      r8   r  c                      e Zd ZdZdS )PasszClass representing an :class:`ast.Pass` node.

    >>> import astroid
    >>> node = astroid.extract_node('pass')
    >>> node
    <Pass l.1 at 0x7f23b2e9e748>
    Nr  r   r8   r6   r  r    r  r8   r  c                  T     e Zd ZdZdZ	 	 	 ddddd fdZ	 	 dddZddZd Z xZ	S )RaisezClass representing an :class:`ast.Raise` node.

    >>> import astroid
    >>> node = astroid.extract_node('raise RuntimeError("Something bad happened!")')
    >>> node
    <Raise l.1 at 0x7f23b2e9e828>
    r   causeNr   r   r   r   r}   r   r   r   r-   r   c               t    d| _         	 d| _        	 t                                          |||||           dS r_  )r   r  r   r   r   s         r6   r   zRaise.__init__	  sS    , #'#$(
9!!) 	 	
 	
 	
 	
 	
r8   r   r  c                "    || _         || _        dS )zDo some setup after initialisation.

        :param exc: What is being raised.

        :param cause: The exception being used to raise this one.
        Nr  )r   r   r  s      r6   r   zRaise.postinit-  s     


r8   r.   c                t    | j         sdS t          d | j                                         D                       S )zCheck if this node raises a :class:`NotImplementedError`.

        :returns: Whether this node raises a :class:`NotImplementedError`.
        Fc              3  ,   K   | ]}|j         d k    V  dS )NotImplementedErrorNr   )rs   r   s     r6   ru   z/Raise.raises_not_implemented.<locals>.<genexpr>B  s;       
 
37DI..
 
 
 
 
 
r8   )r   rX   r   r   s    r6   raises_not_implementedzRaise.raises_not_implemented;  sO    
 x 	5 
 
;?8;S;S;U;U
 
 
 
 
 	
r8   c              #  N   K   | j         	| j         V  | j        | j        V  d S d S r0   r  r   s    r6   r   zRaise.get_childrenF  sC      8 	(NNN: 	*	 	r8   r   r   r7  )r   r   r  r   r-   r   r;  )
r   r   r   r   r   r   r   r  r   r   r   s   @r6   r  r    s          'O "!% $	"
 "&%)"
 "
 "
 "
 "
 "
 "
 "
L "#    	
 	
 	
 	
      r8   r  c                  T     e Zd ZdZdZ	 	 	 ddddd fdZdddZd Zd Zd Z	 xZ
S )ReturnzClass representing an :class:`ast.Return` node.

    >>> import astroid
    >>> node = astroid.extract_node('return True')
    >>> node
    <Return l.1 at 0x7f23b8211908>
    r4   Nr   r   r   r   r}   r   r   r   r-   r   c               d    d| _         	 t                                          |||||           dS r_  r;  r   s         r6   r   zReturn.__init__Y  r<  r8   r5   c                    || _         dS )z]Do some setup after initialisation.

        :param value: The value being returned.
        Nr4   r>  s     r6   r   zReturn.postinitz  r?  r8   c              #  .   K   | j         | j         V  d S d S r0   r4   r   s    r6   r   zReturn.get_children  .      : 	*	 	r8   c                6    t          | j        t                    S r0   )r1   r5   r=   r   s    r6   is_tuple_returnzReturn.is_tuple_return  s    $*e,,,r8   c              #     K   | V  d S r0   r   r   s    r6    _get_return_nodes_skip_functionsz'Return._get_return_nodes_skip_functions        




r8   r   r   r0   rD  )r   r   r   r   r   r   r   r   r  r  r   r   s   @r6   r  r  N  s          !O "!% $	
 "&%)
 
 
 
 
 
 
 
B      - - -      r8   r  c                  &    e Zd ZU dZded<   ddZdS )	SetzClass representing an :class:`ast.Set` node.

    >>> import astroid
    >>> node = astroid.extract_node('{1, 2, 3}')
    >>> node
    <Set.set l.1 at 0x7f23b2e71d68>
    zClassVar[InferUnaryOp[Set]]r  r-   Literal['builtins.set']c                    dS )r   zbuiltins.setr   r   s    r6   r   z
Set.pytype  s	    
 ~r8   N)r-   r  )r   r   r   r   r   r   r   r8   r6   r  r    sB           0///     r8   r  c                       e Zd ZdZdZ	 	 	 ddddd fdZ	 	 	 dddZd Zed d            Z	d!dZ
d"d#dZd"d#dZd Z xZS )$r   zClass representing an :class:`ast.Slice` node.

    >>> import astroid
    >>> node = astroid.extract_node('things[1:3]')
    >>> node
    <Subscript l.1 at 0x7f23b2e71f60>
    >>> node.slice
    <Slice l.1 at 0x7f23b2e71e80>
    rx   ry   rz   Nr   r   r   r   r}   r   r   r   r-   r   c                   d| _         	 d| _        	 d| _        	 t                                          |||||           dS r_  )rx   ry   rz   r   r   r   s         r6   r   zSlice.__init__  s]    , %)
+$(
+#'	/!!) 	 	
 	
 	
 	
 	
r8   rx   ry   rz   c                0    || _         || _        || _        dS )zDo some setup after initialisation.

        :param lower: The lower index in the slice.

        :param upper: The upper index in the slice.

        :param step: The step to take between index.
        Nr  )r   rx   ry   rz   s       r6   r   zSlice.postinit  s     

			r8   c                :    |st          |          }| |_        |S |S )z7Wrap the empty attributes of the Slice in a Const node.)r   r}   )r   attrconsts      r6   _wrap_attributezSlice._wrap_attribute  s(     	!$''EELLr8   nodes.ClassDefc                ^    t                      j        }|                    d          d         S )Nr|   r   )r   builtins_moduler  )r   builtinss     r6   r  zSlice._proxied  s)    !##3((++r8   Literal['builtins.slice']c                    dS )r   zbuiltins.slicer   r   s    r6   r   zSlice.pytype  
    
  r8   r@   rA   c              #    K   |dk    r|                      | j                  V  dS |dk    r|                      | j                  V  dS |dk    r|                      | j                  V  dS |                     ||          E d{V  dS )zInfer the possible values of the given attribute on the slice.

        :param attrname: The name of the attribute to infer.
        :type attrname: str

        :returns: The inferred possible values.
        :rtype: iterable(NodeNG)
        startstoprz   rh   N)r  rx   ry   rz   r  r   rO  r@   s      r6   igetattrzSlice.igetattr  s       w 	?&&tz2222222 	?&&tz2222222 	?&&ty1111111||Hg|>>>>>>>>>>>r8   c                8    | j                             ||          S r0   )r  r  r  s      r6   r  zSlice.getattr  s    }$$Xw777r8   c              #  n   K   | j         	| j         V  | j        	| j        V  | j        | j        V  d S d S r0   r  r   s    r6   r   zSlice.get_children  sY      : 	*: 	*9 	)OOOOO	 	r8   r   r   )rx   r   ry   r   rz   r   r-   r   )r-   r  )r-   r  r0   r  )r   r   r   r   r   r   r   r  r+   r  r   r   r  r   r   r   s   @r6   r   r     s         1O "!% $	%
 "&%)%
 %
 %
 %
 %
 %
 %
 %
R  $#"	    $   , , , _,       ? ? ? ? ?$8 8 8 8 8      r8   r   c                  \     e Zd ZU dZdZdZ	 	 	 	 ddddd fdZdddZded<   	 d Z	 xZ
S )r  zClass representing an :class:`ast.Starred` node.

    >>> import astroid
    >>> node = astroid.extract_node('*args')
    >>> node
    <Starred l.1 at 0x7f23b2e41978>
    r4   r  Nr   r  r  r   r   r   r}   r   r   r   r-   r   c               t    d| _         	 || _        	 t                                          |||||           dS )r  Nr   )r5   r  r   r   r  s          r6   r   zStarred.__init__%  sS    2 %)
%#&E!!) 	 	
 	
 	
 	
 	
r8   r5   c                    || _         dS )z[Do some setup after initialisation.

        :param value: What is being unpacked.
        Nr4   r>  s     r6   r   zStarred.postinitL  r?  r8   z$ClassVar[AssignedStmtsCall[Starred]]r   c              #     K   | j         V  d S r0   r4   r   s    r6   r   zStarred.get_childrenX  rA  r8   r   r  r0   rD  rz  r   s   @r6   r  r    s           !OM #!!% $%
 "&%)%
 %
 %
 %
 %
 %
 %
 %
N     9888      r8   r  c                  \     e Zd ZU dZdZdZded<   	 	 	 	 ddddd fdZ	 dddZd Z	 xZ
S )r  zClass representing an :class:`ast.Subscript` node.

    >>> import astroid
    >>> node = astroid.extract_node('things[1:3]')
    >>> node
    <Subscript l.1 at 0x7f23b2e71f60>
    r5   r|   r  zClassVar[InferLHS[Subscript]]r   Nr   r  r  r   r   r   r}   r   r   r   r-   r   c                   d| _         	 d| _        	 || _        	 t                                          |||||           dS )a!  
        :param ctx: Whether the subscripted item is assigned to or loaded from.

        :param lineno: The line that this node appears on in the source code.

        :param col_offset: The column that this node appears on in the
            source code.

        :param parent: The parent node in the syntax tree.

        :param end_lineno: The last line this node appears on in the source code.

        :param end_col_offset: The end column this node appears on in the
            source code. Note: This is after the last symbol.
        Nr   )r5   r|   r  r   r   r  s          r6   r   zSubscript.__init__j  s]    2 %)
$$(
-#&I!!) 	 	
 	
 	
 	
 	
r8   r5   r|   c                "    || _         || _        dS )zDo some setup after initialisation.

        :param value: What is being indexed.

        :param slice: The slice being used to lookup.
        Nr  )r   r5   r|   s      r6   r   zSubscript.postinit  s     



r8   c              #  .   K   | j         V  | j        V  d S r0   r  r   s    r6   r   zSubscript.get_children  s(      jjr8   r   r  r7  )r5   r   r|   r   r-   r   )r   r   r   r   r   r   r   r   r   r   r   r   s   @r6   r  r  \  s           )OM,,,, #!!% $(
 "&%)(
 (
 (
 (
 (
 (
 (
 (
X CG
 
 
 
 
      r8   r  c                  ^     e Zd ZdZdZdZ	 	 	 ddddd fdZ	 	 	 dddZd Zd Z	d Z
 xZS )rV   a  Class representing an :class:`ast.TryExcept` node.

    >>> import astroid
    >>> node = astroid.extract_node('''
        try:
            do_something()
        except Exception as error:
            print("Error!")
        ''')
    >>> node
    <TryExcept l.2 at 0x7f23b2e9d908>
    rQ   rP   rR   Nr   r   r   r   r}   r   r   r   r-   r   c                   g | _         	 g | _        	 g | _        	 t                                          |||||           dS r   )rQ   rP   rR   r   r   r   s         r6   r   zTryExcept.__init__  s]    , #%	A-/%$&1!!) 	 	
 	
 	
 	
 	
r8   rQ   r   rP   list[ExceptHandler] | NonerR   c                @    ||| _         ||| _        |	|| _        dS dS )zDo some setup after initialisation.

        :param body: The contents of the block to catch exceptions from.

        :param handlers: The exception handlers.

        :param orelse: The contents of the ``else`` block.
        Nr  )r   rQ   rP   rR   s       r6   r   zTryExcept.postinit  s?      	DI 	%$DM 	! DKKK	! 	!r8   c                    |S r0   r   r  s      r6   r  zTryExcept._infer_name  r  r8   c                F   d}| j         D ]|}|j        r||j        j        k    r||fc S |j        d         j        |cxk    r|j        d         j        k    rn n||j        d         j        fc S ||j        d         j        dz
  }}|                     || j        |          S )r  Nr   r   rO   )rP   rk   r  rQ   rX  r  rR   )r   r   last	exhandlers       r6   r  zTryExcept.block_range  s      	8 	8I~ &&IN,E"E &v~%%%~a +v ; ; ; ;9K9T ; ; ; ; ;y~b1::::: 8 ~a(3a7&&vt{DAAAr8   c              #  `   K   | j         E d {V  | j        pdE d {V  | j        pdE d {V  d S r9  r  r   s    r6   r   zTryExcept.get_children
  sd      9=&B&&&&&&&;$"$$$$$$$$$r8   r   r   )rQ   r   rP   r  rR   r   r-   r   )r   r   r   r   r   r]  r   r   r  r  r   r   r   s   @r6   rV   rV     s          5O= "!% $	%
 "&%)%
 %
 %
 %
 %
 %
 %
 %
R %)/3&*	! ! ! ! !*  B B B(% % % % % % %r8   rV   c                  V     e Zd ZdZdZdZ	 	 	 ddddd fdZ	 	 dddZd Zd Z	 xZ
S )
TryFinallya3  Class representing an :class:`ast.TryFinally` node.

    >>> import astroid
    >>> node = astroid.extract_node('''
    try:
        do_something()
    except Exception as error:
        print("Error!")
    finally:
        print("Cleanup!")
    ''')
    >>> node
    <TryFinally l.2 at 0x7f23b2e41d68>
    rQ   	finalbodyNr   r   r   r   r}   r   r   r   r-   r   c               t    g | _         	 g | _        	 t                                          |||||           dS r   )rQ   r  r   r   r   s         r6   r   zTryFinally.__init__$  sS    , /1	=')4!!) 	 	
 	
 	
 	
 	
r8   rQ   list[NodeNG | TryExcept] | Noner  r   c                .    ||| _         |	|| _        dS dS )zDo some setup after initialisation.

        :param body: The try-except that the finally is attached to.

        :param finalbody: The contents of the ``finally`` block.
        Nr  )r   rQ   r  s      r6   r   zTryFinally.postinitH  s0      	DI 	'&DNNN	' 	'r8   c                    | j         d         }t          |t                    r?|j        | j        k    r/|j        |cxk    r| j        k    rn n|                    |          S |                     || j                  S )r  r   )rQ   r1   rV   r  rX  r  r  r  )r   r   childs      r6   r  zTryFinally.block_rangeX  s     	! ui((	- DO3	- &	- 	- 	- 	- ,0?	- 	- 	- 	- 	-
 $$V,,,&&vt~>>>r8   c              #  >   K   | j         E d {V  | j        E d {V  d S r0   r  r   s    r6   r   zTryFinally.get_childrenl  s@      9>!!!!!!!!!r8   r   r   r7  )rQ   r  r  r   r-   r   )r   r   r   r   r   r]  r   r   r  r   r   r   s   @r6   r  r    s          ,O4 "!% $	"
 "&%)"
 "
 "
 "
 "
 "
 "
 "
L 15)-' ' ' ' ' ? ? ?(" " " " " " "r8   r  c                  n     e Zd ZU dZdZ	 	 	 	 ddddd fdZded<   	 ded<   ded<   ddZdd dZ xZ	S )!r=   zClass representing an :class:`ast.Tuple` node.

    >>> import astroid
    >>> node = astroid.extract_node('(1, 2, 3)')
    >>> node
    <Tuple.tuple l.1 at 0x7f23b2e41780>
    r  Nr   r  r  r   r   r   r}   r   r   r   r-   r   c               d    || _         	 t                                          |||||           dS )a  
        :param ctx: Whether the tuple is assigned to or loaded from.

        :param lineno: The line that this node appears on in the source code.

        :param col_offset: The column that this node appears on in the
            source code.

        :param parent: The parent node in the syntax tree.

        :param end_lineno: The last line this node appears on in the source code.

        :param end_col_offset: The end column this node appears on in the
            source code. Note: This is after the last symbol.
        r   Nr  r  s          r6   r   zTuple.__init__|  sI    2 $'>!!) 	 	
 	
 	
 	
 	
r8   z"ClassVar[AssignedStmtsCall[Tuple]]r   zClassVar[InferUnaryOp[Tuple]]r  zClassVar[InferBinaryOp[Tuple]]r  Literal['builtins.tuple']c                    dS )r   zbuiltins.tupler   r   s    r6   r   zTuple.pytype  r  r8   r@   rA   c                2    t          | | j        ||          S r  r  r  s      r6   r  zTuple.getitem  r  r8   r   r  )r-   r"  r0   r  r  r   s   @r6   r=   r=   q  s           M #!!% $"
 "&%)"
 "
 "
 "
 "
 "
 "
 "
H 7666 21113333       K K K K K K K K Kr8   r=   c                       e Zd ZU dZdZdZ ej        d          	 	 	 	 ddddd fd            ZdddZ	de
d<   dd dZd Z fdZ xZS )!UnaryOpzClass representing an :class:`ast.UnaryOp` node.

    >>> import astroid
    >>> node = astroid.extract_node('-5')
    >>> node
    <UnaryOp l.1 at 0x7f23b2e4e198>
    operandr~  r   Nr   r  r   r   r   r   r}   r   r   r   r-   r   c               t    || _         	 d| _        	 t                                          |||||           dS r  )r  r(  r   r   r  s          r6   r   zUnaryOp.__init__  sS    4 !&*4!!) 	 	
 	
 	
 	
 	
r8   r(  c                    || _         dS )zlDo some setup after initialisation.

        :param operand: What the unary operator is applied to.
        Nr'  )r   r(  s     r6   r   zUnaryOp.postinit  s    
 r8   zFClassVar[InferBinaryOperation[UnaryOp, util.BadUnaryOperationMessage]]_infer_unaryopr@   rA   c                l    	 |                      |          }d |D             S # t          $ r g cY S w xY w)r  rh   c                F    g | ]}t          |t          j                  |S r   )r1   r   BadUnaryOperationMessager  s     r6   r   z'UnaryOp.type_errors.<locals>.<listcomp>  s;       fd&CDD  r8   )r+  r   r  s      r6   r  zUnaryOp.type_errors  sd    	))')::G %   
  	 	 	III	r  c              #     K   | j         V  d S r0   r'  r   s    r6   r   zUnaryOp.get_children  s      lr8   c                ~    | j         dk    rt          | j                  S t                                                      S )Nnot)r  r   r   r  r  s    r6   r  zUnaryOp.op_precedence  s5    7e 	* ))ww$$&&&r8   r   r  r0   )r(  r   r-   r   r  )r   r   r   r   r   r   r   r   r   r   r   r  r   r  r   r   s   @r6   r&  r&    s          #OM1Z1U;;; !!% $%
 "&%)%
 %
 %
 %
 %
 %
 %
 <;%
N           &  ' ' ' ' ' ' ' ' 'r8   r&  c                  x     e Zd ZdZdZdZ	 	 	 ddddd fdZ	 	 	 dddZed             Z	d Z
d Z fdZ xZS )WhilezClass representing an :class:`ast.While` node.

    >>> import astroid
    >>> node = astroid.extract_node('''
    while condition():
        print("True")
    ''')
    >>> node
    <While l.2 at 0x7f23b2e4e390>
    r  rc  Nr   r   r   r   r}   r   r   r   r-   r   c                   d| _         	 g | _        	 g | _        	 t                                          |||||           dS r_  r  r   s         r6   r   zWhile.__init__$  s]    , $(	0"$	'$&1!!) 	 	
 	
 	
 	
 	
r8   r\  rQ   r   rR   c                <    || _         ||| _        |	|| _        dS dS )zDo some setup after initialisation.

        :param test: The condition that the loop tests.

        :param body: The contents of the loop.

        :param orelse: The contents of the ``else`` block.
        Nr  r  s       r6   r   zWhile.postinitK  s7     	 	DI 	! DKKK	! 	!r8   c                    | j         j        S rV  r  r   s    r6   rY  zWhile.blockstart_tolineno_  rg  r8   c                8    |                      || j                  S )r  )r  rR   r  s     r6   r  zWhile.block_rangeg  s     &&vt{;;;r8   c              #  P   K   | j         V  | j        E d {V  | j        E d {V  d S r0   r  r   s    r6   r   zWhile.get_childrens  r  r8   c              #     K   | j                                         E d{V  t                                                      E d{V  dS )z1A While node can contain a Yield node in the testNr  r  s    r6   ro  z#While._get_yield_nodes_skip_lambdasy  r  r8   r   r   r  )r   r   r   r   r   r]  r   r   r+   rY  r  r   ro  r   r   s   @r6   r3  r3    s        	 	 1O1 "!% $	%
 "&%)%
 %
 %
 %
 %
 %
 %
 %
R #$(&*	! ! ! ! !( " " _"
< 
< 
<  ; ; ; ; ; ; ; ; ;r8   r3  c                  z     e Zd ZU dZdZdZdZ	 	 	 ddddd fdZ	 	 	 dddZde	d<   	 e
d             Zd Z xZS )WithzClass representing an :class:`ast.With` node.

    >>> import astroid
    >>> node = astroid.extract_node('''
    with open(file_path) as file_:
        print(file_.read())
    ''')
    >>> node
    <With l.2 at 0x7f23b2e4e710>
    r   rQ   rg  rP  Nr   r   r   r   r}   r   r   r   r-   r   c                   g | _         	 g | _        	 d| _        	 t                                          |||||           dS r_  )r   rQ   rh  r   r   r   s         r6   r   zWith.__init__  s^    , :<
O"$	1.2X!!) 	 	
 	
 	
 	
 	
r8   r   )list[tuple[NodeNG, NodeNG | None]] | NonerQ   r   rh  c                8    ||| _         ||| _        || _        dS )zDo some setup after initialisation.

        :param items: The pairs of context managers and the names
            they are assigned to.

        :param body: The contents of the ``with`` block.
        N)r   rQ   rh  )r   r   rQ   rh  s       r6   r   zWith.postinit  s0      	DJ 	DI.r8   z!ClassVar[AssignedStmtsCall[With]]r   c                2    | j         d         d         j        S )rW  r   r   )r   rX  r   s    r6   rY  zWith.blockstart_tolineno  s     z"~a ))r8   c              #  R   K   | j         D ]\  }}|V  |r|V  | j        E d{V  dS )zoGet the child nodes below this node.

        :returns: The children.
        :rtype: iterable(NodeNG)
        Nr<  )r   rM  vars      r6   r   zWith.get_children  sX        	 	ID#JJJ 			9r8   r   r   )r   r>  rQ   r   rh  r   r-   r   )r   r   r   r   r   rp  r]  r   r   r   r+   rY  r   r   r   s   @r6   r;  r;    s         
	 	 (O.( "!% $	%
 "&%)%
 %
 %
 %
 %
 %
 %
 %
R <@$()-	/ / / / /& 6555 * * _*
 
 
 
 
 
 
r8   r;  c                      e Zd ZdZdS )	AsyncWithz7Asynchronous ``with`` built with the ``async`` keyword.Nr  r   r8   r6   rD  rD    s        AAAAr8   rD  c                  N     e Zd ZdZdZ	 	 	 ddddd fdZdddZd Zd Z xZ	S )YieldzClass representing an :class:`ast.Yield` node.

    >>> import astroid
    >>> node = astroid.extract_node('yield True')
    >>> node
    <Yield l.1 at 0x7f23b2e4e5f8>
    r4   Nr   r   r   r   r}   r   r   r   r-   r   c               d    d| _         	 t                                          |||||           dS r_  r;  r   s         r6   r   zYield.__init__  sI    , %)
!!!) 	 	
 	
 	
 	
 	
r8   r5   c                    || _         dS )zWDo some setup after initialisation.

        :param value: The value to yield.
        Nr4   r>  s     r6   r   zYield.postinit  r?  r8   c              #  .   K   | j         | j         V  d S d S r0   r4   r   s    r6   r   zYield.get_children  r  r8   c              #     K   | V  d S r0   r   r   s    r6   ro  z#Yield._get_yield_nodes_skip_lambdas"  r  r8   r   r   r0   rD  rE  r   s   @r6   rF  rF    s          !O "!% $	
 "&%)
 
 
 
 
 
 
 
B            r8   rF  c                      e Zd ZdZdS )	YieldFromz2Class representing an :class:`ast.YieldFrom` node.Nr  r   r8   r6   rL  rL  &  s        <<<<r8   rL  c                      e Zd ZdZdS )r4  z>Represents the unpacking of dicts into dicts using :pep:`448`.Nr  r   r8   r6   r4  r4  *  s        HHHHr8   r4  c                  P     e Zd ZdZdZdZ	 	 	 ddddd fdZ	 	 dddZd Z xZ	S )FormattedValueaP  Class representing an :class:`ast.FormattedValue` node.

    Represents a :pep:`498` format string.

    >>> import astroid
    >>> node = astroid.extract_node('f"Format {type_}"')
    >>> node
    <JoinedStr l.1 at 0x7f23b2e4ed30>
    >>> node.values
    [<Const.str l.1 at 0x7f23b2e4eda0>, <FormattedValue l.1 at 0x7f23b2e4edd8>]
    r5   format_spec)
conversionNr   r   r   r   r}   r   r   r   r-   r   c               z    |  	 d| _         	 d| _        	 t                                          |||||           dS r_  )rR  rQ  r   r   r   s         r6   r   zFormattedValue.__init__>  se    , 	8&*	 +/	 	!!) 	 	
 	
 	
 	
 	
r8   r5   r   rR  rQ  c                0    || _         || _        || _        dS )a2  Do some setup after initialisation.

        :param value: The value to be formatted into the string.

        :param conversion: The type of formatting to be applied to the value.

        :param format_spec: The formatting to be applied to the value.
        :type format_spec: JoinedStr or None
        N)r5   rR  rQ  )r   r5   rR  rQ  s       r6   r   zFormattedValue.postinito  s      
$&r8   c              #  @   K   | j         V  | j        | j        V  d S d S r0   rP  r   s    r6   r   zFormattedValue.get_children  s>      j 	#""""""	# 	#r8   r   r   r7  )r5   r   rR  r   rQ  r   r-   r   r  r   s   @r6   rO  rO  .  s        
 
 /O#M "!% $	/
 "&%)/
 /
 /
 /
 /
 /
 /
 /
h "&%)	' ' ' ' '&# # # # # # #r8   rO  c                  H     e Zd ZdZdZ	 	 	 ddddd fdZdddZd Z xZS )	JoinedStrzRepresents a list of string expressions to be joined.

    >>> import astroid
    >>> node = astroid.extract_node('f"Format {type_}"')
    >>> node
    <JoinedStr l.1 at 0x7f23b2e4ed30>
    r  Nr   r   r   r   r}   r   r   r   r-   r   c               d    g | _         	 t                                          |||||           dS r   )rG  r   r   r   s         r6   r   zJoinedStr.__init__  sM    , %'	
 	!!) 	 	
 	
 	
 	
 	
r8   rG  r   c                    |	|| _         dS dS )zDo some setup after initialisation.

        :param value: The string expressions to be joined.

        :type: list(FormattedValue or Const)
        Nr  r  s     r6   r   zJoinedStr.postinit  s!      	! DKKK	! 	!r8   c              #  $   K   | j         E d {V  d S r0   r  r   s    r6   r   zJoinedStr.get_children  r  r8   r   r   r0   r  rb  r   s   @r6   rW  rW    s          "O "!% $	"
 "&%)"
 "
 "
 "
 "
 "
 "
 "
H! ! ! ! !      r8   rW  c                  r     e Zd ZU dZdZdZ	 	 	 	 d!dddd" fdZd#dZded<   	 ddd$dZ	d%dZ
d&d Z xZS )'	NamedExprzRepresents the assignment from the assignment expression

    >>> import astroid
    >>> module = astroid.parse('if a := 1: pass')
    >>> module.body[0].test
    <NamedExpr l.1 at 0x7f23b2e4ed30>
    r}  TNr   r   r   r   r}   r   r   r   r-   r   c               `    |  	 |  	 t                                          |||||           dS r   r  r   s         r6   r   zNamedExpr.__init__  sU    , 		
 	<!!) 	 	
 	
 	
 	
 	
r8   ru  r   r5   c                "    || _         || _        d S r0   r}  r  s      r6   r   zNamedExpr.postinit  s    


r8   z&ClassVar[AssignedStmtsCall[NamedExpr]]r   r  r  Literal[None, True]@nodes.FunctionDef | nodes.Module | nodes.ClassDef | nodes.Lambdac                  | j         st          |           t          | j         t          t          t
          f          rq| j         j         st          | j                   | j         j         j         st          | j         j                   | j         j         j                             d          S | j                             d          S )zThe first parent frame node.

        A frame node is a :class:`Module`, :class:`FunctionDef`,
        or :class:`ClassDef`.

        :returns: The first parent frame node.
        r  Tr  )r}   r   r1   r   r  r  r   )r   r  s     r6   r   zNamedExpr.frame  s     { 	2$D1111 dkIw#FGG 	@;% =(<<<<;%, D(0BCCCC;%,22$2???{   ---r8   r*   c                   | j         st          |           t          | j         t          t          t
          f          ro| j         j         st          | j                   | j         j         j         st          | j         j                   | j         j         j                                         S | j                                         S r  )r}   r   r1   r   r  r  r   r   s    r6   r   zNamedExpr.scope  s     { 	2$D1111 dkIw#FGG 	5;% =(<<<<;%, D(0BCCCC;%,22444{  """r8   r   r   rI   c                Z    |                      d                              ||           dS )a{  Define that the given name is declared in the given statement node.
        NamedExpr's in Arguments, Keyword or Comprehension are evaluated in their
        parent's parent scope. So we add to their frame's locals.

        .. seealso:: :meth:`scope`

        :param name: The name that is being defined.

        :param stmt: The statement that defines the given name.
        Tr  N)r   	set_local)r   r   rI   s      r6   rd  zNamedExpr.set_local0  s.     	

$
))$55555r8   r   r   )ru  r   r5   r   r-   r   )r  r_  r-   r`  r  )r   r   rI   r   r-   r   )r   r   r   r   r   r  r   r   r   r   r   rd  r   r   s   @r6   r\  r\    s           *OOH "!% $	%
 "&%)%
 %
 %
 %
 %
 %
 %
 %
N    ;:::
 04. . . . . ..# # # #&6 6 6 6 6 6 6 6r8   r\  c                  (    e Zd ZdZd Zd	dZd
ddZdS )UnknownzThis node represents a node in a constructed AST where
    introspection is not possible.  At the moment, it's only used in
    the args attribute of FunctionDef nodes where function signature
    introspection failed.
    r-   Literal['Unknown']c                    dS )Nrf  r   r   s    r6   r  zUnknown.qnameG  s    yr8   Nr@   rA   c              +  &   K   t           j        V  dS )z4Inference on an Unknown node immediately terminates.N)r   rE   r   r@   r  s      r6   _inferzUnknown._inferJ  s      r8   )r-   rg  r0   r  )r   r   r   r   r   r  rk  r   r8   r6   rf  rf  >  sR          D         r8   rf  c                  <     e Zd ZdZd ZdZdZd fd
Z	 dddZ xZ	S )EvaluatedObjectzContains an object that has already been inferred

    This class is useful to pre-evaluate a particular node,
    with the resulting class acting as the non-evaluated node.
    )originalr4   rn  r   r5   NodeNG | type[util.Uninferable]r-   r   c                    || _         	 || _        	 t                                          | j         j        | j         j        | j         j                   d S )N)r   r   r}   )rn  r5   r   r   r   r   r}   )r   rn  r5   r   s      r6   r   zEvaluatedObject.__init__Z  s\     !)?6;
 ='}/=' 	 	
 	
 	
 	
 	
r8   Nr@   rA   r  r	   6Generator[NodeNG | type[util.Uninferable], None, None]c              +     K   | j         V  d S r0   r4   rj  s      r6   rk  zEvaluatedObject._inferi  s       jr8   )rn  r   r5   ro  r-   r   r0   )r@   rA   r  r	   r-   rq  )
r   r   r   r   r   r   r   r   rk  r   r   s   @r6   rm  rm  O  sv          D#OM
 
 
 
 
 
  26        r8   rm  c                  @     e Zd ZdZdZ	 	 	 ddddd fdZddZ xZS )MatchzClass representing a :class:`ast.Match` node.

    >>> import astroid
    >>> node = astroid.extract_node('''
    match x:
        case 200:
            ...
        case _:
            ...
    ''')
    >>> node
    <Match l.2 at 0x10c24e170>
    subjectcasesNr   r   r   r   r}   r   r   r   r-   r   c               \    |  |  t                                          |||||           d S Nr   r  r   s         r6   r   zMatch.__init__  sK     	#!!) 	 	
 	
 	
 	
 	
r8   rv  r   rw  list[MatchCase]c               "    || _         || _        d S r0   ru  )r   rv  rw  s      r6   r   zMatch.postinit  s     


r8   r   r   )rv  r   rw  rz  r-   r   r   r   r   r   r   r   r   r   r   s   @r6   rt  rt  r  s          +O "!% $	
 "&%)
 
 
 
 
 
 
 
&       r8   rt  c                      e Zd ZdZdS )Patternz!Base class for all Pattern nodes.Nr  r   r8   r6   r~  r~    s        ++++r8   r~  c                  d     e Zd ZU dZdZdZded<   ded<   ded<   ded<   d	d
d fdZddZ xZ	S )	MatchCasezClass representing a :class:`ast.match_case` node.

    >>> import astroid
    >>> node = astroid.extract_node('''
    match x:
        case 200:
            ...
    ''')
    >>> node.cases[0]
    <MatchCase l.3 at 0x10c24e590>
    patternguardrQ   rP  r   r   r   r   r   Nr   r}   r   r-   c               X    |  |  |  t                                          |           d S )Nr   r  r  s     r6   r   zMatchCase.__init__  s6    !'''''r8   r  r~  r  rQ   r   c               0    || _         || _        || _        d S r0   r  )r   r  r  rQ   s       r6   r   zMatchCase.postinit  s     
			r8   r  )r  r~  r  r   rQ   r   r-   r   )
r   r   r   r   r   r]  r   r   r   r   r   s   @r6   r  r    s         
 
 3O(LLL26 ( ( ( ( ( ( ( (	 	 	 	 	 	 	 	r8   r  c                  @     e Zd ZdZdZ	 	 	 ddddd fdZddZ xZS )
MatchValuezClass representing a :class:`ast.MatchValue` node.

    >>> import astroid
    >>> node = astroid.extract_node('''
    match x:
        case 200:
            ...
    ''')
    >>> node.cases[0].pattern
    <MatchValue l.3 at 0x10c24e200>
    r4   Nr   r   r   r   r}   r   r   r   r-   r   c               X    |  t                                          |||||           d S ry  r  r   s         r6   r   zMatchValue.__init__  sE     	!!) 	 	
 	
 	
 	
 	
r8   r5   r   c                   || _         d S r0   r4   r>  s     r6   r   zMatchValue.postinit  s    


r8   r   r   )r5   r   r-   r   r|  r   s   @r6   r  r    s        
 
 !O "!% $	
 "&%)
 
 
 
 
 
 
 
$       r8   r  c                  6     e Zd ZdZdZddddddd fdZ xZS )MatchSingletona  Class representing a :class:`ast.MatchSingleton` node.

    >>> import astroid
    >>> node = astroid.extract_node('''
    match x:
        case True:
            ...
        case False:
            ...
        case None:
            ...
    ''')
    >>> node.cases[0].pattern
    <MatchSingleton l.3 at 0x10c2282e0>
    >>> node.cases[1].pattern
    <MatchSingleton l.5 at 0x10c228af0>
    >>> node.cases[2].pattern
    <MatchSingleton l.7 at 0x10c229f90>
    r4   Nr   r5   Literal[True, False, None]r   r   r   r   r   r}   r   r-   r   c               b    || _         t                                          |||||           d S ry  r;  )r   r5   r   r   r   r   r}   r   s          r6   r   zMatchSingleton.__init__  sF     
!!) 	 	
 	
 	
 	
 	
r8   )r5   r  r   r   r   r   r   r   r   r   r}   r   r-   r   rx  r   s   @r6   r  r    si         ( M "!%!%%) $
 
 
 
 
 
 
 
 
 
 
 
r8   r  c                  @     e Zd ZdZdZ	 	 	 ddddd fdZddZ xZS )MatchSequenceah  Class representing a :class:`ast.MatchSequence` node.

    >>> import astroid
    >>> node = astroid.extract_node('''
    match x:
        case [1, 2]:
            ...
        case (1, 2, *_):
            ...
    ''')
    >>> node.cases[0].pattern
    <MatchSequence l.3 at 0x10ca80d00>
    >>> node.cases[1].pattern
    <MatchSequence l.5 at 0x10ca80b20>
    patternsNr   r   r   r   r}   r   r   r   r-   r   c               X    |  t                                          |||||           d S ry  r  r   s         r6   r   zMatchSequence.__init__.  E     	$!!) 	 	
 	
 	
 	
 	
r8   r  list[Pattern]c                   || _         d S r0   r  r   r  s     r6   r   zMatchSequence.postinit@       r8   r   r   r  r  r-   r   r|  r   s   @r6   r  r    s           $O "!% $	
 "&%)
 
 
 
 
 
 
 
$! ! ! ! ! ! ! !r8   r  c                  L     e Zd ZU dZdZ	 	 	 ddddd fdZddZded<    xZS )MatchMappinga  Class representing a :class:`ast.MatchMapping` node.

    >>> import astroid
    >>> node = astroid.extract_node('''
    match x:
        case {1: "Hello", 2: "World", 3: _, **rest}:
            ...
    ''')
    >>> node.cases[0].pattern
    <MatchMapping l.3 at 0x10c8a8850>
    keysr  restNr   r   r   r   r}   r   r   r   r-   r   c               `    |  |  |  t                                          |||||           d S ry  r  r   s         r6   r   zMatchMapping.__init__S  sQ     	$$!!) 	 	
 	
 	
 	
 	
r8   r  r   r  r  r  rS  c               0    || _         || _        || _        d S r0   r  )r   r  r  r  s       r6   r   zMatchMapping.postinitg  s     	 			r8   zlClassVar[Callable[[MatchMapping, AssignName, InferenceContext | None, None], Generator[NodeNG, None, None]]]r   r   r   )r  r   r  r  r  rS  r-   r   	r   r   r   r   r   r   r   r   r   r   s   @r6   r  r  D  s         
 
 3O "!% $	
 "&%)
 
 
 
 
 
 
 
(	 	 	 	
 
 
 
   r8   r  c                  D     e Zd ZdZdZdZ	 	 	 ddddd fdZddZ xZS )
MatchClassar  Class representing a :class:`ast.MatchClass` node.

    >>> import astroid
    >>> node = astroid.extract_node('''
    match x:
        case Point2D(0, 0):
            ...
        case Point3D(x=0, y=0, z=0):
            ...
    ''')
    >>> node.cases[0].pattern
    <MatchClass l.3 at 0x10ca83940>
    >>> node.cases[1].pattern
    <MatchClass l.5 at 0x10ca80880>
    )r   r  kwd_patterns)	kwd_attrsNr   r   r   r   r}   r   r   r   r-   r   c               d    |  |  |  |  t                                          |||||           d S ry  r  r   s         r6   r   zMatchClass.__init__  sW     	$!(!!) 	 	
 	
 	
 	
 	
r8   r   r   r  r  r  r  r  c               >    || _         || _        || _        || _        d S r0   )r   r  r  r  )r   r   r  r  r  s        r6   r   zMatchClass.postinit  s'      "(r8   r   r   )
r   r   r  r  r  r  r  r  r-   r   )	r   r   r   r   r   r   r   r   r   r   s   @r6   r  r    s           :O"M "!% $	
 "&%)
 
 
 
 
 
 
 
*) ) ) ) ) ) ) )r8   r  c                  L     e Zd ZU dZdZ	 	 	 ddddd fdZddZded<    xZS )	MatchStarzClass representing a :class:`ast.MatchStar` node.

    >>> import astroid
    >>> node = astroid.extract_node('''
    match x:
        case [1, *_]:
            ...
    ''')
    >>> node.cases[0].pattern.patterns[1]
    <MatchStar l.3 at 0x10ca809a0>
    r   Nr   r   r   r   r}   r   r   r   r-   r   c               X    |  t                                          |||||           d S ry  r  r   s         r6   r   zMatchStar.__init__  r  r8   r   rS  c                   || _         d S r0   r   r   s     r6   r   zMatchStar.postinit  s    			r8   ziClassVar[Callable[[MatchStar, AssignName, InferenceContext | None, None], Generator[NodeNG, None, None]]]r   r   r   )r   rS  r-   r   r  r   s   @r6   r  r    s         
 
  O "!% $	
 "&%)
 
 
 
 
 
 
 
$   
 
 
 
   r8   r  c                  L     e Zd ZU dZdZ	 	 	 ddddd fdZddZded<    xZS )MatchAsa=  Class representing a :class:`ast.MatchAs` node.

    >>> import astroid
    >>> node = astroid.extract_node('''
    match x:
        case [1, a]:
            ...
        case {'key': b}:
            ...
        case Point2D(0, 0) as c:
            ...
        case d:
            ...
    ''')
    >>> node.cases[0].pattern.patterns[1]
    <MatchAs l.3 at 0x10d0b2da0>
    >>> node.cases[1].pattern.patterns[0]
    <MatchAs l.5 at 0x10d0b2920>
    >>> node.cases[2].pattern
    <MatchAs l.7 at 0x10d0b06a0>
    >>> node.cases[3].pattern
    <MatchAs l.9 at 0x10d09b880>
    r  r   Nr   r   r   r   r}   r   r   r   r-   r   c               \    |  |  t                                          |||||           d S ry  r  r   s         r6   r   zMatchAs.__init__  sK     	$$!!) 	 	
 	
 	
 	
 	
r8   r  Pattern | Noner   rS  c               "    || _         || _        d S r0   r  )r   r  r   s      r6   r   zMatchAs.postinit  s     			r8   zgClassVar[Callable[[MatchAs, AssignName, InferenceContext | None, None], Generator[NodeNG, None, None]]]r   r   r   )r  r  r   rS  r-   r   r  r   s   @r6   r  r    s          0 *O "!% $	
 "&%)
 
 
 
 
 
 
 
&   
 
 
 
   r8   r  c                  @     e Zd ZdZdZ	 	 	 ddddd fdZddZ xZS )MatchOrzClass representing a :class:`ast.MatchOr` node.

    >>> import astroid
    >>> node = astroid.extract_node('''
    match x:
        case 400 | 401 | 402:
            ...
    ''')
    >>> node.cases[0].pattern
    <MatchOr l.3 at 0x10d0b0b50>
    r  Nr   r   r   r   r}   r   r   r   r-   r   c               X    |  t                                          |||||           d S ry  r  r   s         r6   r   zMatchOr.__init__C  r  r8   r  r  c                   || _         d S r0   r  r  s     r6   r   zMatchOr.postinitU  r  r8   r   r   r  r|  r   s   @r6   r  r  4  s        
 
 $O "!% $	
 "&%)
 
 
 
 
 
 
 
$! ! ! ! ! ! ! !r8   r  .zdict[type, type[NodeNG]]r3   r5   Iterable[Any]rC   List | Set | Tupler   c                j    g }| D ]-}t          |          }||_        |                    |           .|S )zACreate a list of nodes to function as the elements of a new node.)r   r}   r  )r5   rC   elementselementelement_nodes        r6   _create_basic_elementsr  n  sG      H & &$W--"%%%%Or8   rG  Mapping[Any, Any]r"  c                    g }|                                  D ]H\  }}t          |          }||_        t          |          }||_        |                    ||f           I|S )zHCreate a list of node pairs to function as the items of a new dict node.)r   r   r}   r  )rG  rC   r  r,  r5   key_node
value_nodes          r6   _create_dict_itemsr  z  sn     SUHllnn 0 0
U %%"5))
 
:.////Or8   r	   r    c                   t          | t                    rJ | j        t          vrt	                      }| |_        |S t          | j                 }t          |t          t          t          f          r/ |            }|
                    t          | |                     |S t          |t                    r/ |            }|
                    t          | |                     |S t          |           S )z*Return an astroid node for a python value.)r1   r   r   r3   rI  rK  
issubclassr<   r  r=   r   r  r  r  ri   )r5   rC   initializer_clsr   s       r6   r   r     s    %(((((
 i' {{  0O/D#u#566 "?$$0AABBB/4(( "?$$,UH==>>><<r8   r;  r0   r  r\  r<  r   r:  )r5   r  rC   r  r-   r   )rG  r  rC   r  r-   r"  )r5   r	   r-   r    )r   
__future__r   r   r
  systypingr  collections.abcr   r   r   	functoolsr   r   r	   r
   r   r   r   r   astroidr   r   astroid.basesr   r   astroid.constr   r   astroid.contextr   astroid.exceptionsr   r   r   r   r   r   astroid.managerr   astroid.nodesr   astroid.nodes.constr   astroid.nodes.node_ngr   astroid.typingr    r!   r"   r#   r$   version_infor'   typing_extensionsr)   r*   r+   astroid.decoratorsr,   r7   r9   BadOperationMessager;   AssignedStmtsPossibleNoder<   rj   AssignedStmtsCallInferBinaryOperationInferLHSr   InferUnaryOpraise_if_nothing_inferredrF   rf   rK  rm   ro   r~   r   ParentAssignNodeABCMetar   r   NoChildrenNoder>   r   r   AssignTypeNoder   r.  r  r?   	StatementrZ  rd  rs  r|  r  r  r  r  r  r  ri   r  r  r  r  r  r9  rG  rI  MultiLineBlockNoderN  r_  MultiLineWithElseBlockNodera  rj  rl  
ImportNoderq  rz  r  rT   r  r  r  r  r  r  r  r  r  r   r  r  rV   r  r=   r&  r3  r;  rD  rF  rL  r4  rO  rW  r\  rf  rm  rt  r~  r  r  r  r  r  r  r  r  r  r	  r2   dictrE  rk   NotImplementedr.   floatcomplexr  r3   r   r  r  r   r   r8   r6   <module>r     s  
 B A A " " " " " " 



     



   8 8 8 8 8 8 8 8 8 8       S S S S S S S S S S S S S S S S S S $ $ $ $ $ $ $ $ 0 0 0 0 0 0 0 0 7 7 7 7 7 7 7 7 , , , , , ,                + * * * * * % % % % % % - - - - - - ( ( ( ( ( (              v *)))))) /......v E)))))))DDDDDD/ / / / ')6
*
*
*)1IJJJ!"ST !!"S!"	 	   h'()
U?N:;T4GHJ  h'()
_dH5G,HHIK #(::; %. . . . &%.4B B B B BN &((    6    H H H H HBU U U U UK0(ck U U U Ur3 3 3 3 3& 3 3 3J< < < < <+[+:V < < <~2
 2
 2
 2
 2
k(+{7S 2
 2
 2
j;4 ;4 ;4 ;4 ;4;%{ ;4 ;4 ;4|q q q q q* q q qh	 	 	 	 OS    @G G G G G- G G GT? ? ? ? ?[" ? ? ?DV> V> V> V> V>[')> V> V> V>rY Y Y Y Y*K,A Y Y Yxm; m; m; m; m;*K,A m; m; m;`b b b b bF b b bJB& B& B& B& B&V B& B& B&J    K&(=   W! W! W! W! W!6 W! W! W!tX X X X Xf X X Xxe e e e eF e e ePT  T  T  T  T K& T  T  T n    {);+@   N N N N N N N NbB B B B Bk* B B BJ7  7  7  7  7 [')> 7  7  7 ta  a  a  a  a 68 a  a  a H=B =B =B =B =B;  =B =B =B@    {)   S S S S S* S S SwT wT wT wT wT"K$>@UwT wT wTt    v   q q q q q*q q qh    s   &= = = = =F = = =@E
 E
 E
 E
 E
' E
 E
 E
P: : : : : : : :z0 0 0 0 0[')> 0 0 0fc> c> c> c> c>	/1F c> c> c>LK K K K KF K K K\1
 1
 1
 1
 1
[# 1
 1
 1
h    F   = = = = =f = = =@DK DK DK DK DK= DK DK DKN5 5 5 5 5{);+@ 5 5 5p    ;%{'<   M M M M MK! M M M`; ; ; ; ;[" ; ; ;|    -   &w w w w wF w w wt@ @ @ @ @k* @ @ @FG G G G G G G GTh% h% h% h% h%68M h% h% h%V]" ]" ]" ]" ]"79N ]" ]" ]"@DK DK DK DK DKM DK DK DKNZ' Z' Z' Z' Z'f Z' Z' Z'zg; g; g; g; g;K2K4I g; g; g;Te e e e e*e e ePB B B B B B B B8 8 8 8 8F 8 8 8v= = = = = = = =I I I I I+ I I IX# X# X# X# X#V X# X# X#v: : : : : : : :zu6 u6 u6 u6 u6* u6 u6 u6p    k(   "    f   F+ + + + +K! + + +\, , , , ,f , , ,$ $ $ $ $. $ $ $N" " " " " " " "J(
 (
 (
 (
 (
W (
 (
 (
V&! &! &! &! &!G &! &! &!R; ; ; ; ;;-w ; ; ;|4) 4) 4) 4) 4) 4) 4) 4)n1 1 1 1 1*G 1 1 1hD D D D Dk(' D D DN"! "! "! "! "!g "! "! "!T 	$	5$DJJD%DIIu%	5U	5'	    "	 	 	 	        r8   