
%![c           @   s  d  Z  d d l Z d d l Z d d l Z y d d l m Z Wn! e k
 ra d d l m Z n Xd d l Z d d l	 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	 m Z d d
 l	 m Z d d l	 m Z e j j j Z e j   Z e j e d   Z e d  Z e   Z e d  Z e d  Z  e d  Z! d e f d     YZ" d e" f d     YZ# e j$ e j%  d e j& e" e j' f d     Y Z( d e f d     YZ) d e) e j& e" f d     YZ* d e) e j& e" f d     YZ+ d e) e" f d     YZ, d e j- e" f d      YZ. e/ d!  Z0 e e d"  Z1 d# e j& e" f d$     YZ2 d% e# f d&     YZ3 d' e j- e# f d(     YZ4 d) e j- e# f d*     YZ5 d+ e j- e# f d,     YZ6 d- e" f d.     YZ7 d/ e" f d0     YZ8 d1 e" f d2     YZ9 d3 e# f d4     YZ: d5 e" f d6     YZ; d7 e" f d8     YZ< d9 e" f d:     YZ= d; e" e j' f d<     YZ> d= e# f d>     YZ? d? e" f d@     YZ@ dA e j& e" f dB     YZA dC e j- e# f dD     YZB dE e" e j' f dF     YZC dG e# f dH     YZD dI e" f dJ     YZE dK e" f dL     YZF dM e j- e# f dN     YZG dO e# f dP     YZH dQ e" f dR     YZI dS e jJ e j- e# f dT     YZK dU eK f dV     YZL dW e" f dX     YZM dY e jN e# f dZ     YZO d[ e" f d\     YZP d] e# f d^     YZQ d_ e jJ e# f d`     YZR da e" f db     YZS dc e jN e# f dd     YZT de e" f df     YZU dg e" f dh     YZV di e( f dj     YZW dk e# f dl     YZX dm e# f dn     YZY do e# f dp     YZZ dq e# f dr     YZ[ ds e# f dt     YZ\ du e( f dv     YZ] dw e" f dx     YZ^ dy e j& e" f dz     YZ_ d{ e" f d|     YZ` d} e jJ e# f d~     YZa d e jJ e# f d     YZb d e( f d     YZc d e" f d     YZd d e jJ e# f d     YZe d e jJ e j- e# f d     YZf d ef f d     YZg d e" f d     YZh d eh f d     YZi d e" f d     YZj d e" f d     YZk d e" f d     YZl d e j- e" f d     YZm i eW en 6ec eo 6eC ep 6e] eq 6e> er e  6e> er es  6Zt d   Zu eu   d   Zv d   Zw i ev eW 6ev ec 6ew eC 6ev e] 6d   e> 6Zx d   Zy e jz d e7  Z{ e jz d eD  Z| e jz d e*  Z} e jz d e2  Z~ e jz d eP  Z e jz d e;  Z e jz d eO  Z d S(   s<   Module for some node classes. More nodes in scoped_nodes.py
iN(   t   singledispatch(   t	   as_string(   t   bases(   t   context(   t
   decorators(   t
   exceptions(   t   manager(   t   mixins(   t   utilc         c   s3  t  |  t t f  r xJ |  j D]? } | t j k r? | Vq n  x t | |  D] } | VqO Wq Wt t d |  d |    n  t	 |  j
 |   } | |  k r | Vt t d |  d |    n  xM |  j
 |  D]< } | t j k r | Vq x t | |  D] } | VqWq Wt t d |  d |    d S(   s   recursively generate nodes inferred by the given statement.
    If the inferred value is a list or a tuple, recurse on the elements
    t   nodeR   N(   t
   isinstancet   Listt   Tuplet   eltsR   t   Uninferablet   unpack_infert   StopIterationt   dictt   nextt   infer(   t   stmtR   t   eltt   inferred_eltt   inferredt   inf_inf(    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR   &   s$    c         C   s  i  } i  } |  j  } |  } x- | rJ d | | <| | | <| } | j  } q W| j  } | } x| r| | k rt | t  r | d k r | j |  d | j | |  d k	 rt Snt | t  r| j |  \ } } | j | |  \ }	 }
 |
 | k	 r| d k o(|	 d k o(| j |  } | d k oS|	 d k oS| | j |  } | d k ok|	 d k } | d k o|	 d k } t | | | | f  rt Sq| d k r|	 d k r| | | k	 Sn  t	 S| } | j  } q] Wt	 S(   s  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
    i   t   handlerst   bodyt   orelseN(
   t   parentR
   t   Ift   Nonet   locate_childt   Truet	   TryExceptt   catcht   anyt   False(   t   stmt1t   stmt2R   t   stmt1_parentst   childrenR	   t   previoust   c2attrt   c2nodet   c1attrt   c1nodet    first_in_body_caught_by_handlerst!   second_in_body_caught_by_handlerst   first_in_else_other_in_handlerst    second_in_else_other_in_handlers(    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyt   are_exclusiveF   sP    		

		c         C   s   t  |  t  r7 t  |  j t t d  f  r |  j Snz |  d k rG d Sy t |  j d |   } Wn t j	 k
 ry n8 Xt  | t  r t  | j t t d  f  r | j Sn  t
 S(   s'   Get the value of the given slice index.R   N(   R
   t   Constt   valuet   intt   typeR   R   R   R   t   InferenceErrort   _SLICE_SENTINEL(   t   indexR   R   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyt   _slice_value   s    

c      	   C   s   t  |  j |  } t  |  j |  } t  |  j |  } t d   | | | f D  re t | | |  St j d d d |  d |  j d |   d  S(   Nc         s   s   |  ] } | t  k	 Vq d  S(   N(   R8   (   t   .0t   elem(    (    s3   lib/python2.7/site-packages/astroid/node_classes.pys	   <genexpr>   s    t   messages'   Could not infer slice used in subscriptR	   R9   R   (	   R:   t   lowert   uppert   stept   allt   sliceR   t   AstroidTypeErrorR   (   R	   R   R>   R?   R@   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyt   _infer_slice   s    	c         C   s  yh t  | t  rM t | d | } |  j   } | | | _ |  j | _ | St  | t  rg | | j SWn t k
 r t	 j
 t j d d d |  d | d |   nD t k
 r } t	 j
 t j d d d | d |  d | d |   n Xt j d |   d	 S(
   sH   Get a slice or an item, using the given *index*, for the given sequence.R   R=   s   Index {index!s} out of rangeR	   R9   s   Type error {error!r}t   errors#   Could not use %s as subscript indexN(   R
   t   SliceRD   t	   __class__R   R   R3   R4   t
   IndexErrorR   t   reraiseR   t   AstroidIndexErrort	   TypeErrorRC   (   t   instanceR   R9   R   t   index_slicet   new_clst   exc(    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyt   _container_getitem   s&    t   NodeNGc           B   s  e  Z d  Z e Z e Z e Z d' Z d' Z	 d' Z
 d( Z d) Z d* Z d' Z d' d' d' d  Z d' d  Z d   Z d   Z d   Z d   Z d   Z d   Z d	   Z d
   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z  e! j" d    Z# e! j" d    Z$ d   Z% d   Z& d   Z' d' d  Z( d   Z) d' d  Z* d   Z+ d   Z, d   Z- d   Z. d   Z/ d    Z0 d!   Z1 e e e d" d# d$ d%  Z2 d&   Z3 RS(+   sm    A node of the new Abstract Syntax Tree (AST).

    This is the base class for all Astroid node classes.
    c         C   s   | |  _  | |  _ | |  _ d S(   sa  
        :param lineno: The line that this node appears on in the source code.
        :type lineno: int or None

        :param col_offset: The column that this node appears on in the
            source code.
        :type col_offset: int or None

        :param parent: The parent node in the syntax tree.
        :type parent: NodeNG or None
        N(   t   linenot
   col_offsetR   (   t   selfRR   RS   R   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyt   __init__  s    		c         K   s   |  j  d k	 r@ y |  j  |  | |  SWq@ t j k
 r< q@ Xn  | sV |  j | |  S|  | j | j | j f } | | j k r t	 | j |  S| j
 | |  j | |   S(   sV  Get a generator of the inferred values.

        This is the main entry point to the inference system.

        .. seealso:: :ref:`inference`

        If the instance has some explicit inference function set, it will be
        called instead of the default interface.

        :returns: The inferred values.
        :rtype: iterable
        N(   t   _explicit_inferenceR   R   t   UseInferenceDefaultt   _infert
   lookupnamet   callcontextt	   boundnodeR   t   itert   cache_generator(   RT   R   t   kwargst   key(    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR     s    	c         C   s   t  |  d t  |  d d   S(   s   Get a name for nice representation.

        This is either :attr:`name`, :attr:`attrname`, or the empty string.

        :returns: The nice name.
        :rtype: str
        t   namet   attrnamet    (   t   getattr(   RT   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyt
   _repr_name5  s    c         C   sG  |  j    } t |   j } | rD d } t |  t |  d } n d } t |  d } g  } x |  j |  j D] } t |  |  } d t |  | } t j | d d d | j	 t
  }	 |	 d g }
 x' |	 d D] } |
 j d	 | |  q W| j d
 | d j |
  f  qq W| i | d 6| d 6d d	 | j |  d 6S(   Ns   %(cname)s.%(rname)s(%(fields)s)i   s   %(cname)s(%(fields)s)i   iP   t   indentt   widthi    t    s   %s=%sRb   t   cnamet   rnames   ,
t   fields(   Rd   R6   t   __name__t   lent   _other_fieldst   _astroid_fieldsRc   t   pprintt   pformatt
   splitlinesR    t   appendt   join(   RT   Ri   Rh   t   stringt	   alignmentt   resultt   fieldR4   Rf   t   linest   innert   line(    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyt   __str__?  s(    $c         C   sW   |  j    } | r d } n d } | i t |   j d 6| d 6|  j d 6t |   d 6S(   Ns.   <%(cname)s.%(rname)s l.%(lineno)s at 0x%(id)x>s$   <%(cname)s l.%(lineno)s at 0x%(id)x>Rh   Ri   RR   t   id(   Rd   R6   Rk   t
   fromlinenoR|   (   RT   Ri   Rt   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyt   __repr__X  s    	
c         C   s)   t  | d |  j j j    } | |   S(   s(   Visit this node using the given visitor.t   visit_(   Rc   RG   Rk   R>   (   RT   t   visitort   func(    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyt   acceptc  s    c         c   sl   xe |  j  D]Z } t |  |  } | d k r1 q
 n  t | t t f  r_ x | D] } | VqM Wq
 | Vq
 Wd S(   so   Get the child nodes below this node.

        :returns: The children.
        :rtype: iterable(NodeNG)
        N(   Rn   Rc   R   R
   t   listt   tuple(   RT   Rw   t   attrR   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyt   get_childrenh  s    c         C   s^   xW |  j  d d d  D]? } t |  |  } | s8 q n  t | t t f  rU | d S| SWd S(   s   An optimized version of list(get_children())[-1]

        :returns: The last child, or None if no children exist.
        :rtype: NodeNG or None
        Ni(   Rn   Rc   R
   R   R   R   (   RT   Rw   R   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyt
   last_childx  s    c         C   s9   | j  } x) | d k	 r4 |  | k r( t S| j  } q Wt S(   s  Check if this node is the parent of the given node.

        :param node: The node to check if it is the child.
        :type node: NodeNG

        :returns: True if this node is the parent of the given node,
            False otherwise.
        :rtype: bool
        N(   R   R   R    R$   (   RT   R	   R   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyt	   parent_of  s    
	c         C   s   |  j  r |  S|  j j   S(   s   The first parent node, including self, marked as statement node.

        :returns: The first parent statement.
        :rtype: NodeNG
        (   t   is_statementR   t	   statement(   RT   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR     s    	c         C   s   |  j  j   S(   s   The first parent frame node.

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

        :returns: The first parent frame node.
        :rtype: Module or FunctionDef or ClassDef
        (   R   t   frame(   RT   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR     s    	c         C   s   |  j  j   S(   s   The first parent node defining a new scope.

        :returns: The first parent scope node.
        :rtype: Module or FunctionDef or ClassDef or Lambda or GenExpr
        (   R   t   scope(   RT   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR     s    c         C   s   |  j  r |  j  j   S|  S(   sj   Return the root node of the syntax tree.

        :returns: The root node.
        :rtype: Module
        (   R   t   root(   RT   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR     s    	c         C   s   xX |  j  D]M } t |  |  } | | k r2 | g St | t t f  r
 | | k r
 | Sq
 Wd } t j | t |  t |   f   d S(   s_  Search for the sequence that contains this child.

        :param child: The child node to search sequences for.
        :type child: NodeNG

        :returns: The sequence containing the given child node.
        :rtype: iterable(NodeNG)

        :raises AstroidError: If no sequence could be found that contains
            the given child.
        s"   Could not find %s in %s's childrenN(   Rn   Rc   R
   R   R   R   t   AstroidErrort   repr(   RT   t   childRw   t   node_or_sequencet   msg(    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyt   child_sequence  s    c         C   s   xa |  j  D]V } t |  |  } | | k r5 | | f St | t t f  r
 | | k r
 | | f Sq
 Wd } t j | t |  t |   f   d S(   s  Find the field of this node that contains the given child.

        :param child: The child node to search fields for.
        :type child: NodeNG

        :returns: A tuple of the name of the field that contains the child,
            and the sequence or node that contains the child node.
        :rtype: tuple(str, iterable(NodeNG) or NodeNG)

        :raises AstroidError: If no field could be found that contains
            the given child.
        s"   Could not find %s in %s's childrenN(   Rn   Rc   R
   R   R   R   R   R   (   RT   R   Rw   R   R   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR     s    
!c         C   s   |  j  j   S(   s|   The next sibling statement node.

        :returns: The next sibling statement node.
        :rtype: NodeNG or None
        (   R   t   next_sibling(   RT   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR     s    c         C   s   |  j  j   S(   s   The previous sibling statement.

        :returns: The previous sibling statement node.
        :rtype: NodeNG or None
        (   R   t   previous_sibling(   RT   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR     s    c         C   s   |  j    } |  j } d } xq | D]i } | j    | k sP t d |  | f   | j } | j | k rl Pn  | | d k r" | | f } q" q" W| d S(   s  Get the node closest to this one from the given list of nodes.

        :param nodes: The list of nodes to search. All of these nodes must
            belong to the same module as this one. The list should be
            sorted by the line number of the nodes, smallest first.
        :type nodes: iterable(NodeNG)

        :returns: The node closest to this one in the source code,
            or None if one could not be found.
        :rtype: NodeNG or None
        i    s,   nodes %s and %s are not from the same modulei   N(   Ni    (   R   R}   R   t   AssertionError(   RT   t   nodest   myroott   mylinenot   nearestR	   RR   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR     s    		c         C   s    |  j  d k r |  j   S|  j  S(   sa   The first line that this node appears on in the source code.

        :type: int or None
        N(   RR   R   t   _fixed_source_line(   RT   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR}     s    
c         C   s8   |  j  s d } n |  j   } | d k r1 |  j S| j S(   s`   The last line that this node appears on in the source code.

        :type: int or None
        N(   Rn   R   R   R}   t   tolineno(   RT   t	   lastchild(    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR   )  s    		c         C   s   |  j  } |  } y2 x+ | d k r? t | j    } | j  } q WWnE t k
 r |  j } x, | r | d k r | j  } | j } q] Wn X| S(   s  Attempt to find the line that this node appears on.

        We need this method since not all nodes have :attr:`lineno` set.

        :returns: The line number of this node,
            or None if this could not be determined.
        :rtype: int or None
        N(   RR   R   R   R   R   R   (   RT   Rz   t   _node(    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR   9  s    				c         C   s   | |  j  f S(   s@  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 or None)
        (   R   (   RT   RR   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyt   block_rangeO  s    
c         C   s   |  j  j | |  d S(   sW  Define that the given name is declared in the given statement node.

        This definition is stored on the parent scope node.

        .. seealso:: :meth:`scope`

        :param name: The name that is being defined.
        :type name: str

        :param stmt: The statement that defines the given name.
        :type stmt: NodeNG
        N(   R   t	   set_local(   RT   R`   R   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR   [  s    c         c   su   t  |  |  r |  Vn  xW |  j   D]I } | d k	 rK t  | |  rK q$ n  x | j | |  D] } | Vq^ Wq$ Wd S(   s  Get the nodes (including this one or below) of the given type.

        :param klass: The type of node to search for.
        :type klass: builtins.type

        :param skip_klass: A type of node to ignore. This is useful to ignore
            subclasses of :attr:`klass`.
        :type skip_klass: builtins.type

        :returns: The node of the given type.
        :rtype: iterable(NodeNG)
        N(   R
   R   R   t   nodes_of_class(   RT   t   klasst
   skip_klasst
   child_nodet   matching(    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR   j  s    c         C   s   d  S(   N(   R   (   RT   R   R`   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyt   _infer_name  s    c         C   s   t  j d d |  d |  d S(   s3   we don't know how to resolve a statement by defaults#   No inference function for {node!r}.R	   R   N(   R   R7   (   RT   R   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyRX     s    c         C   s   t  |  j    S(   s   Get a list of the inferred values.

        .. seealso:: :ref:`inference`

        :returns: The inferred values.
        :rtype: list
        (   R   R   (   RT   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR     s    c         C   s<   t  j d t |   j t |   j f t d d |  j   S(   s   A deprecated alias of :meth:`inferred`.

        .. deprecated:: 1.5

        :returns: The inferred values.
        :rtype: list
        s\   %s.infered() is deprecated and slated for removal in astroid 2.0, use %s.inferred() instead.t
   stackleveli   (   t   warningst   warnR6   Rk   t   PendingDeprecationWarningR   (   RT   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyt   infered  s    	c         C   s   |  S(   s   Instantiate a instance of the defined class.

        .. note::

            On anything other than a :class:`ClassDef` this will return self.

        :returns: An instance of the defined class.
        :rtype: object
        (    (   RT   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyt   instantiate_class  s    
c         C   s   t  S(   s   Check if this node inherits from the given type.

        :param node: The node defining the base to look for.
            Usually this is a :class:`Name` node.
        :type node: NodeNG
        (   R$   (   RT   R	   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyt   has_base  s    c         C   s   t  S(   s   Whether this node defines something that is callable.

        :returns: True if this defines something that is callable,
            False otherwise.
        :rtype: bool
        (   R$   (   RT   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyt   callable  s    c         C   s   t  S(   N(   R$   (   RT   R4   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyt   eq  s    c         C   s   t  j |   S(   so   Get the source code that this node represents.

        :returns: The source code.
        :rtype: str
        (   R   t   to_code(   RT   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR     s    s      i    iP   c   
   	      s   t  d d  f d       j t    j t  d d    f d    }   j t  d d        f d   } g  }	   |  |	 t    d j |	  S(   s  Get a string representation of the AST from this node.

        :param ids: If true, includes the ids with the node type names.
        :type ids: bool

        :param include_linenos: If true, includes the line numbers and
            column offsets.
        :type include_linenos: bool

        :param ast_state: If true, includes information derived from
            the whole AST like local and global variables.
        :type ast_state: bool

        :param indent: A string to use to indent the output string.
        :type indent: str

        :param max_depth: If set to a positive integer, won't return
            nodes deeper than max_depth in the string.
        :type max_depth: int

        :param max_width: Attempt to format the output string to stay
            within this number of characters, but can exceed it under some
            circumstances. Only positive integer values are valid, the default is 80.
        :type max_width: int

        :returns: The string representation of the AST.
        :rtype: str
        Rb   i   c            sz   t  j |  d t   t |  d  j t  } | j | d  | j g  | d D] } | | ^ qS  t |  d k S(   s   Outputs a representation of a non-tuple/list, non-node that's
            contained within an AST, including strings.
            Rf   i   i    (   Ro   Rp   t   maxRl   Rq   R    Rr   t   extend(   R	   Rv   t   donet
   cur_indentt   depthRx   Rz   (   t	   max_width(    s3   lib/python2.7/site-packages/astroid/node_classes.pyt
   _repr_tree  s    (c            sj  |  7} | j  d  |  s& t } n3t |   d k rW   |  d | | | |  } nt |   d k r   |  d | | | |  } | s | j  d  n | j  d  | j  |    |  d | | | |  p | } n | j  d  | j  |  xB |  d  D]6 }   | | | | |  | j  d  | j  |  q W  |  d | | | |  t } | j  d	  | S(
   sF   Outputs a representation of a sequence that's contained within an AST.t   [i   i    i   s   , s   ,
s   
it   ](   Rr   R$   Rl   R    (   R	   Rv   R   R   R   t   brokenR   (   R   Re   (    s3   lib/python2.7/site-packages/astroid/node_classes.pyt	   _repr_seq  s0    
		c            sB  |  | k r: | j   d t |   j t |   f  t S| j |    rj |  k rj | j  d  t S| d 7} |  7}  r | j  d t |   j t |   f  n | j  d t |   j  g  }  r | j d  n  | j |  j  | j |  j   r| j |  j	  n  | s+t } nt
 |  d k rz| j  d | d	    t |  | d	  | | | |  } n | j  d
  | j  |  x\ | d  D]P } | j  d |    t |  |  | | | |  | j  d  | j  |  qW| j  d | d    t |  | d  | | | |  t } | j  d  | S(   s4   Outputs a strings representation of an astroid node.s   <Recursion on %s with id=%ss   ...i   s
   %s<0x%x>(
s   %s(RR   RS   s   %s=i    s   
is   ,
t   )(   RR   RS   (   Rr   R6   Rk   R|   R$   t   addR   Rm   Rn   t   _other_other_fieldsRl   Rc   R    (   R	   Rv   R   R   R   Rj   R   Rw   (   R   t	   ast_statet   idst   include_linenosRe   t	   max_depth(    s3   lib/python2.7/site-packages/astroid/node_classes.pyt
   _repr_node  sP    

)	(   t   _singledispatcht   registerR   R   RQ   t   setRs   (
   RT   R   R   R   Re   R   R   R   R   Rv   (    (   R   R   R   R   Re   R   R   s3   lib/python2.7/site-packages/astroid/node_classes.pyt	   repr_tree  s    '.c         C   s   t  j S(   sk  Determine the boolean value of this node.

        The boolean value of a node can have three
        possible values:

            * False: For instance, empty data structures,
              False, empty strings, instances which return
              explicitly False from the __nonzero__ / __bool__
              method.
            * True: Most of constructs are True by default:
              classes, functions, modules etc
            * Uninferable: The inference engine is uncertain of the
              node's value.

        :returns: The boolean value of this node.
        :rtype: bool or Uninferable
        (   R   R   (   RT   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyt
   bool_valueH  s    N(    (    (    (4   Rk   t
   __module__t   __doc__R$   R   t   optional_assignt   is_functionR   RR   RS   R   Rn   Rm   R   RV   RU   R   Rd   R{   R~   R   R   R   R   R   R   R   R   R   R   R   R   R   R   t   cachedpropertyR}   R   R   R   R   R   R   RX   R   R   R   R   R   R   R   R   R   (    (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyRQ      s^   		
							
			
										
								}t	   Statementc           B   s&   e  Z d  Z e Z d   Z d   Z RS(   s&   Statement node adding a few attributesc         C   sI   |  j  j |   } | j |   } y | | d SWn t k
 rD n Xd S(   s|   The next sibling statement node.

        :returns: The next sibling statement node.
        :rtype: NodeNG or None
        i   N(   R   R   R9   RH   (   RT   t   stmtsR9   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR   e  s    c         C   s=   |  j  j |   } | j |   } | d k r9 | | d Sd S(   s   The previous sibling statement.

        :returns: The previous sibling statement node.
        :rtype: NodeNG or None
        i   N(   R   R   R9   R   (   RT   R   R9   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR   r  s
    (   Rk   R   R   R    R   R   R   (    (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR   ]  s   	t   _BaseContainerc           B   se   e  Z d  Z d Z d	 d	 d	 d  Z d   Z e d	 d   Z d   Z	 d   Z
 e j d    Z RS(
   s.   Base class for Set, FrozenSet, Tuple and List.R   c         C   s)   g  |  _  t t |   j | | |  d S(   sa  
        :param lineno: The line that this node appears on in the source code.
        :type lineno: int or None

        :param col_offset: The column that this node appears on in the
            source code.
        :type col_offset: int or None

        :param parent: The parent node in the syntax tree.
        :type parent: NodeNG or None
        N(   R   t   superR   RU   (   RT   RR   RS   R   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyRU     s    	c         C   s   | |  _  d S(   s   Do some setup after initialisation.

        :param elts: The list of elements the that node contains.
        :type elts: list(NodeNG)
        N(   R   (   RT   R   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyt   postinit  s    c         C   sG   |    } | d k r! g  | _ n" g  | D] } t |  ^ q( | _ | S(   s  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
        N(   R   R   t   const_factory(   t   clsR   R	   t   e(    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyt   from_constants  s
    
	"c         C   s   |  j  S(   s   An iterator over the elements this node contains.

        :returns: The contents of this node.
        :rtype: iterable(NodeNG)
        (   R   (   RT   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyt   itered  s    c         C   s   t  |  j  S(   s   Determine the boolean value of this node.

        :returns: The boolean value of this node.
        :rtype: bool or Uninferable
        (   t   boolR   (   RT   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR     s    c         C   s   d S(   sy   Get the name of the type that this node represents.

        :returns: The name of the type.
        :rtype: str
        N(    (   RT   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyt   pytype  s    (   R   N(   Rk   R   R   Rn   R   RU   R   t   classmethodR   R   R   t   abct   abstractmethodR   (    (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR   ~  s   			t   LookupMixInc           B   s)   e  Z d  Z d   Z d   Z d   Z RS(   s+   Mixin to look up a name in the right scope.c         C   s   |  j    j |  |  S(   sd  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.
        :type name: str

        :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).
        :rtype: tuple(str, list(NodeNG))
        (   R   t   scope_lookup(   RT   R`   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyt   lookup  s    c         C   s4   |  j  |  \ } } t j   } t j | | |  S(   s
  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   t
   contextmodt   InferenceContextR   t   _infer_stmts(   RT   R`   R   R   R   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyt   ilookup  s    
c         C   s  | d k r$ |  j    j j    } n9 |  j    } |  j   | k r] | j r] | j j    } n  |  j   } | | k r | j d k	 r | j d k	 s t |   | j | } n d } g  } g  } x| D]}	 |	 j   }
 | d k r |
 j | k r Pn  t |	 d  s,t |	 |	 j   |	 j   j f   |	 j	   } |	 j
 |   rKPn  | j |  |	 | |  \ } } | rsPn  | j } | r| j |   r|	 g } |
 j g } q n  y | j |
 j  } Wn t k
 rnJ X| | j	   j |  rq n  | pt | | |	  s| | =| | =n  t |	 t  rY| rz|
 j | j k rzg  } g  } qzn! t |	 t  rzg  } g  } q n  t |  |	  s | j |	  | j |
 j  q q W| S(   sp  Filter the given list of statements to remove ignorable statements.

        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 stmts: The statements to filter.
        :type stmts: list(NodeNG)

        :param frame: The frame that all of the given statements belong to.
        :type frame: NodeNG

        :param offset: The line offset to filter statements up to.
        :type offset: int

        :returns: The filtered statements.
        :rtype: list(NodeNG)
        ii    t   assign_typeN(   R   R   R   R}   R   R   t   hasattrR   t   localsR   R   t   _get_filtered_stmtsR   R   R9   t
   ValueErrorR2   R
   t
   AssignNamet   DelNameRr   (   RT   R   R   t   offsett   myframet   mystmtR   t   _stmtst   _stmt_parentsR	   R   R   R   R   t   pindex(    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyt   _filter_stmts  sd    		
(   Rk   R   R   R   R   R   (    (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR     s   		R   c           B   s)   e  Z d  Z d Z d d d d d  Z RS(   s  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.

    >>> 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`   c         C   s)   | |  _  t t |   j | | |  d S(   s  
        :param name: The name that is assigned to.
        :type name: str or None

        :param lineno: The line that this node appears on in the source code.
        :type lineno: int or None

        :param col_offset: The column that this node appears on in the
            source code.
        :type col_offset: int or None

        :param parent: The parent node in the syntax tree.
        :type parent: NodeNG or None
        N(   R`   R   R   RU   (   RT   R`   RR   RS   R   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyRU     s    	(   R`   N(   Rk   R   R   Rm   R   RU   (    (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR   p  s   R   c           B   s)   e  Z d  Z d Z d d d d d  Z RS(   sQ  Variation of :class:`ast.Delete` represention deletion of a name.

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

    >>> 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`   c         C   s)   | |  _  t t |   j | | |  d S(   s  
        :param name: The name that is being deleted.
        :type name: str or None

        :param lineno: The line that this node appears on in the source code.
        :type lineno: int or None

        :param col_offset: The column that this node appears on in the
            source code.
        :type col_offset: int or None

        :param parent: The parent node in the syntax tree.
        :type parent: NodeNG or None
        N(   R`   R   R   RU   (   RT   R`   RR   RS   R   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyRU     s    	(   R`   N(   Rk   R   R   Rm   R   RU   (    (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR     s   
t   Namec           B   s)   e  Z d  Z d Z d d d d d  Z RS(   s  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`.

    >>> 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`   c         C   s)   | |  _  t t |   j | | |  d S(   s  
        :param name: The name that this node refers to.
        :type name: str or None

        :param lineno: The line that this node appears on in the source code.
        :type lineno: int or None

        :param col_offset: The column that this node appears on in the
            source code.
        :type col_offset: int or None

        :param parent: The parent node in the syntax tree.
        :type parent: NodeNG or None
        N(   R`   R   R   RU   (   RT   R`   RR   RS   R   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyRU     s    	(   R`   N(   Rk   R   R   Rm   R   RU   (    (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR     s   t	   Argumentsc           B   s   e  Z d  Z e j r* d Z d Z d Z n d Z d Z	 d d d d  Z
 d d d d  Z d   Z e j d    Z d   Z d   Z d   Z e d  Z d   Z RS(   s;  Class representing an :class:`ast.arguments` node.

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

    >>> node = astroid.extract_node('def foo(bar): pass')
    >>> node
    <FunctionDef.foo l.1 at 0x7effe1db8198>
    >>> node.args
    <Arguments l.1 at 0x7effe1db82e8>
    t   argst   defaultst
   kwonlyargst   kw_defaultst   annotationst   varargannotationt   kwargannotationt   kwonlyargs_annotationst   varargt   kwargc         C   se   t  t |   j d |  | |  _ | |  _ g  |  _ g  |  _ g  |  _ g  |  _ g  |  _	 g  |  _
 d S(   s9  
        :param vararg: The name of the variable length arguments.
        :type vararg: str or None

        :param kwarg: The name of the variable length keyword arguments.
        :type kwarg: str or None

        :param parent: The parent node in the syntax tree.
        :type parent: NodeNG or None
        R   N(   R   R   RU   R   R   R   R   R   R   R   R   (   RT   R   R   R   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyRU     s    								c	   	      C   sL   | |  _  | |  _ | |  _ | |  _ | |  _ | |  _ | |  _ | |  _ d S(   s  Do some setup after initialisation.

        :param args: The names of the required arguments.
        :type args: list(AssignName)

        :param defaults: The default values for arguments that can be passed
            positionally.
        :type defaults: list(NodeNG)

        :param kwonlyargs: The keyword arguments that cannot be passed
            positionally.
        :type kwonlyargs: list(AssignName)

        :param kw_defaults: The default values for keyword arguments that
            cannot be passed positionally.
        :type kw_defaults: list(NodeNG)

        :param annotations: The type annotations of arguments that can be
            passed positionally.
        :type annotations: list(NodeNG)

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

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

        :param kwargannotation: The type annotation for the variable length
            keyword arguments.
        :type kwargannotation: NodeNG
        N(   R   R   R   R   R   R   R   R   (	   RT   R   R   R   R   R   R   R   R   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR   J  s    '							c         C   s   |  j  | k r | Sd  S(   N(   R   R   (   RT   R   R`   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR   z  s    c         C   s+   t  t |   j } t | |  j j p' d  S(   sa   The first line that this node appears on in the source code.

        :type: int or None
        i    (   R   R   R}   R   R   (   RT   RR   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR}     s    c         C   s   g  } |  j  r= | j t |  j  |  j t |  d d    n  |  j r] | j d |  j  n  |  j r |  j s | j d  n  | j t |  j |  j |  j	   n  |  j
 r | j d |  j
  n  d j |  S(   so   Get the arguments formatted as string.

        :returns: The formatted arguments.
        :rtype: str
        R   s   *%st   *s   **%ss   , N(   R   Rr   t   _format_argsR   Rc   R   R   R   R   R   R   Rs   (   RT   Rv   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyt   format_args  s"    						c         C   s   t  | |  j  d } | d k	 r\ | t |  j  t |  j  } | d k r\ |  j | Sn  t  | |  j  d } | d k	 r |  j | d k	 r |  j | St j d |  j	 d |   d S(   s   Get 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.
        i    R   R`   N(
   t	   _find_argR   R   Rl   R   R   R   R   t	   NoDefaultR   (   RT   t   argnamet   it   idx(    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyt   default_value  s    	 c         C   sh   | |  j  k r t S| |  j k r& t S|  j | t  d d k	 pg |  j og t | |  j t  d d k	 S(   s   Check if the given name is defined in the arguments.

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

        :returns: True if the given name is defined in the arguments,
            False otherwise.
        :rtype: bool
        i   N(   R   R    R   t   find_argnameR   R   R  (   RT   R`   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyt   is_argument  s    
c         C   s    |  j  r t | |  j  |  Sd S(   s  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)
        N(   NN(   R   R  R   (   RT   R  t   rec(    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR    s    	c         c   s8   x1 t  t |   j   D] } | d k	 r | Vq q Wd S(   s   Get the child nodes below this node.

        This skips over `None` elements in :attr:`kw_defaults`.

        :returns: The children.
        :rtype: iterable(NodeNG)
        N(   R   R   R   R   (   RT   R   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR     s    (   R   R   R   R   R   R   R   R   N(   R   R   R   R   (   R   R   (   Rk   R   R   t   sixt   PY3Rn   R   R   R   Rm   RU   R   R   R   R   R}   R   R  R  R$   R  R   (    (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR     s*   	  >,					c         C   s{   xt t  |  D]f \ } } t | t  rZ | rs t |  | j  } | d d  k	 rW | Sqs q | j |  k r | | f Sq Wd S(   Ni    (   NN(   t	   enumerateR
   R   R  R   R   R`   (   R  R   R	  R  t   argt   found(    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR    s    
c   
      C   sN  g  } |  d  k r d S| d  k r+ g  } n  | d  k	 rP t |   t |  } n  t j j |  |  } x t |  D] \ } \ } } t | t  r | j d t	 | j
   qr | j }	 | d  k	 r |	 d | j   7}	 n  | j |	  | d  k	 rr | | k rr | | | d  k	 r=| d c d | | | j   7<q=qr qr Wd j |  S(   NRb   s   (%s)t   :it   =s   , (   R   Rl   R
  t   movest   zip_longestR  R
   R   Rr   R   R   R`   R   Rs   (
   R   R   R   t   valuest   default_offsett   packedR  R  t
   annotationR  (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR     s&    		,t
   AssignAttrc           B   sA   e  Z d  Z d Z d Z d Z d d d d d  Z d d  Z RS(   sz  Variation of :class:`ast.Assign` representing assignment to an attribute.

    >>> 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'
    t   exprRa   c         C   s)   | |  _  t t |   j | | |  d S(   s  
        :param attrname: The name of the attribute being assigned to.
        :type attrname: str or None

        :param lineno: The line that this node appears on in the source code.
        :type lineno: int or None

        :param col_offset: The column that this node appears on in the
            source code.
        :type col_offset: int or None

        :param parent: The parent node in the syntax tree.
        :type parent: NodeNG or None
        N(   Ra   R   R  RU   (   RT   Ra   RR   RS   R   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyRU     s    	c         C   s   | |  _  d S(   s   Do some setup after initialisation.

        :param expr: What has the attribute that is being assigned to.
        :type expr: NodeNG or None
        N(   R  (   RT   R  (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR   2  s    (   R  (   Ra   N(	   Rk   R   R   Rn   Rm   R   R  RU   R   (    (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR    s   
t   Assertc           B   s/   e  Z d  Z d Z d Z d Z d d d  Z RS(   s   Class representing an :class:`ast.Assert` node.

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

    >>> node = astroid.extract_node('assert len(things) == 10, "Not enough things"')
    >>> node
    <Assert l.1 at 0x7effe1d527b8>
    t   testt   failc         C   s   | |  _  | |  _ d S(   s   Do some setup after initialisation.

        :param test: The test that passes or fails the assertion.
        :type test: NodeNG or None

        :param fail: The message shown when the assertion fails.
        :type fail: NodeNG or None
        N(   R  R  (   RT   R  R  (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR   P  s    		(   R  R  N(   Rk   R   R   Rn   R   R  R  R   (    (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR  ;  s
   t   Assignc           B   s/   e  Z d  Z d Z d Z d Z d d d  Z RS(   s   Class representing an :class:`ast.Assign` node.

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

    >>> node = astroid.extract_node('variable = range(10)')
    >>> node
    <Assign l.1 at 0x7effe1db8550>
    t   targetsR4   c         C   s   | |  _  | |  _ d S(   s   Do some setup after initialisation.

        :param targets: What is being assigned to.
        :type targets: list(NodeNG) or None

        :param value: The value being assigned to the variables.
        :type: NodeNG or None
        N(   R  R4   (   RT   R  R4   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR   s  s    		(   R  R4   N(   Rk   R   R   Rn   R   R  R4   R   (    (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR  ]  s
   	t	   AnnAssignc           B   s>   e  Z d  Z d Z d Z d Z d Z d Z d Z	 d d  Z
 RS(	   s   Class representing an :class:`ast.AnnAssign` node.

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

    >>> node = astroid.extract_node('variable: List[int] = range(10)')
    >>> node
    <AnnAssign l.1 at 0x7effe1d4c630>
    t   targetR  R4   t   simplec         C   s(   | |  _  | |  _ | |  _ | |  _ d S(   s  Do some setup after initialisation.

        :param target: What is being assigned to.
        :type target: NodeNG

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

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

        :param value: The value being assigned to the variables.
        :type: NodeNG or None
        N(   R  R  R4   R   (   RT   R  R  R   R4   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR     s    			(   R  R  R4   (   R   N(   Rk   R   R   Rn   Rm   R   R  R  R4   R   R   (    (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR    s   t	   AugAssignc           B   sb   e  Z d  Z d Z d	 Z d
 Z d
 Z d
 d
 d
 d
 d  Z d
 d
 d  Z	 d
 d  Z
 d
 d  Z RS(   s   Class representing an :class:`ast.AugAssign` node.

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

    >>> node = astroid.extract_node('variable += 1')
    >>> node
    <AugAssign l.1 at 0x7effe1db4d68>
    R  R4   t   opc         C   s)   | |  _  t t |   j | | |  d S(   s  
        :param op: The operator that is being combined with the assignment.
            This includes the equals sign.
        :type op: str or None

        :param lineno: The line that this node appears on in the source code.
        :type lineno: int or None

        :param col_offset: The column that this node appears on in the
            source code.
        :type col_offset: int or None

        :param parent: The parent node in the syntax tree.
        :type parent: NodeNG or None
        N(   R"  R   R!  RU   (   RT   R"  RR   RS   R   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyRU     s    	c         C   s   | |  _  | |  _ d S(   s   Do some setup after initialisation.

        :param target: What is being assigned to.
        :type target: NodeNG or None

        :param value: The value being assigned to the variable.
        :type: NodeNG or None
        N(   R  R4   (   RT   R  R4   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR     s    		c         C   s
   t   d  S(   N(   t   NotImplementedError(   RT   R   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyt   _infer_augassign  s    c         C   s[   y? |  j  d |  } g  | D] } t | t j  r | ^ q SWn t j k
 rV g  SXd S(   s&  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)
        R   N(   R$  R
   R   t   BadBinaryOperationMessageR   R7   (   RT   R   t   resultsRv   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyt   type_errors  s    	 (   R  R4   (   R"  N(   Rk   R   R   Rn   Rm   R   R  R4   RU   R   R$  R'  (    (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR!    s   t   Reprc           B   s&   e  Z d  Z d Z d Z d d  Z RS(   s  Class representing an :class:`ast.Repr` node.

    A :class:`Repr` node represents the backtick syntax,
    which is a deprecated alias for :func:`repr` removed in Python 3.

    >>> node = astroid.extract_node('`variable`')
    >>> node
    <Repr l.1 at 0x7fa0951d75d0>
    R4   c         C   s   | |  _  d S(   s   Do some setup after initialisation.

        :param value: What is having :func:`repr` called on it.
        :type value: NodeNG or None
        N(   R4   (   RT   R4   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR     s    (   R4   N(   Rk   R   R   Rn   R   R4   R   (    (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR(    s   	t   BinOpc           B   sb   e  Z d  Z d Z d	 Z d
 Z d
 Z d
 d
 d
 d
 d  Z d
 d
 d  Z	 d
 d  Z
 d
 d  Z RS(   s   Class representing an :class:`ast.BinOp` node.

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

    >>> node = astroid.extract_node('a + b')
    >>> node
    <BinOp l.1 at 0x7f23b2e8cfd0>
    t   leftt   rightR"  c         C   s)   | |  _  t t |   j | | |  d S(   s  
        :param op: The operator.
        :type: str or None

        :param lineno: The line that this node appears on in the source code.
        :type lineno: int or None

        :param col_offset: The column that this node appears on in the
            source code.
        :type col_offset: int or None

        :param parent: The parent node in the syntax tree.
        :type parent: NodeNG or None
        N(   R"  R   R)  RU   (   RT   R"  RR   RS   R   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyRU   8  s    	c         C   s   | |  _  | |  _ d S(   s  Do some setup after initialisation.

        :param left: What is being applied to the operator on the left side.
        :type left: NodeNG or None

        :param right: What is being applied to the operator on the right side.
        :type right: NodeNG or None
        N(   R*  R+  (   RT   R*  R+  (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR   O  s    		c         C   s
   t   d  S(   N(   R#  (   RT   R   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyt   _infer_binop\  s    c         C   s[   y? |  j  d |  } g  | D] } t | t j  r | ^ q SWn t j k
 rV g  SXd S(   s%  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)
        R   N(   R,  R
   R   R%  R   R7   (   RT   R   R&  Rv   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR'  _  s    	 (   R*  R+  (   R"  N(   Rk   R   R   Rn   Rm   R   R*  R+  RU   R   R,  R'  (    (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR)  "  s   t   BoolOpc           B   sA   e  Z d  Z d Z d Z d Z d d d d d  Z d d  Z RS(   s   Class representing an :class:`ast.BoolOp` node.

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

    >>> node = astroid.extract_node('a and b')
    >>> node
    <BinOp l.1 at 0x7f23b2e71c50>
    R  R"  c         C   s)   | |  _  t t |   j | | |  d S(   s  
        :param op: The operator.
        :type: str or None

        :param lineno: The line that this node appears on in the source code.
        :type lineno: int or None

        :param col_offset: The column that this node appears on in the
            source code.
        :type col_offset: int or None

        :param parent: The parent node in the syntax tree.
        :type parent: NodeNG or None
        N(   R"  R   R-  RU   (   RT   R"  RR   RS   R   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyRU     s    	c         C   s   | |  _  d S(   s   Do some setup after initialisation.

        :param values: The values being applied to the operator.
        :type values: list(NodeNG) or None
        N(   R  (   RT   R  (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR     s    (   R  (   R"  N(	   Rk   R   R   Rn   Rm   R   R  RU   R   (    (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR-  p  s   t   Breakc           B   s   e  Z d  Z RS(   s   Class representing an :class:`ast.Break` node.

    >>> node = astroid.extract_node('break')
    >>> node
    <Break l.1 at 0x7f23b2e9e5c0>
    (   Rk   R   R   (    (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR.    s   t   Callc           B   sV   e  Z d  Z d Z d Z d Z d Z d d d d  Z e	 d    Z
 e	 d    Z RS(	   s   Class representing an :class:`ast.Call` node.

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

    >>> node = astroid.extract_node('function()')
    >>> node
    <Call l.1 at 0x7f23b2e71eb8>
    R   R   t   keywordsc         C   s   | |  _  | |  _ | |  _ d S(   sb  Do some setup after initialisation.

        :param func: What is being called.
        :type func: NodeNG or None

        :param args: The positional arguments being given to the call.
        :type args: list(NodeNG) or None

        :param keywords: The keyword arguments being given to the call.
        :type keywords: list(NodeNG) or None
        N(   R   R   R0  (   RT   R   R   R0  (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR     s    		c         C   s5   |  j  p g  } g  | D] } t | t  r | ^ q S(   sV   The positional arguments that unpack something.

        :type: list(Starred)
        (   R   R
   t   Starred(   RT   R   R  (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyt   starargs  s    c         C   s5   |  j  p g  } g  | D] } | j d k r | ^ q S(   sS   The keyword arguments that unpack something.

        :type: list(Keyword)
        N(   R0  R  R   (   RT   R0  t   keyword(    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR^     s    (   R   R   R0  N(   Rk   R   R   Rn   R   R   R   R0  R   t   propertyR2  R^   (    (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR/    s   	t   Comparec           B   sA   e  Z d  Z d Z d Z d Z d d d  Z d   Z d   Z	 RS(   s5  Class representing an :class:`ast.Compare` node.

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

    >>> 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*  t   opsc         C   s   | |  _  | |  _ d S(   sH  Do some setup after initialisation.

        :param left: The value at the left being applied to a comparison
            operator.
        :type left: NodeNG or None

        :param ops: The remainder of the operators
            and their relevant right hand value.
        :type ops: list(tuple(str, NodeNG)) or None
        N(   R*  R6  (   RT   R*  R6  (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR     s    	c         c   s+   |  j  Vx |  j D] \ } } | Vq Wd S(   s   Get the child nodes below this node.

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

        :returns: The children.
        :rtype: iterable(NodeNG)
        N(   R*  R6  (   RT   t   _t
   comparator(    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR     s    	c         C   s   |  j  d d S(   ss   An optimized version of list(get_children())[-1]

        :returns: The last child.
        :rtype: NodeNG
        ii   (   R6  (   RT   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR     s    (   R*  R6  N(
   Rk   R   R   Rn   R   R*  R6  R   R   R   (    (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR5    s   
	t   Comprehensionc           B   st   e  Z d  Z d
 Z d Z d Z d Z d Z d Z	 d d  Z
 d d d d d  Z e Z d   Z d   Z d	   Z RS(   s  Class representing an :class:`ast.comprehension` node.

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

    >>> 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'
    R  R\   t   ifst   is_asyncc         C   s    t  t |   j   | |  _ d S(   si   
        :param parent: The parent node in the syntax tree.
        :type parent: NodeNG or None
        N(   R   R9  RU   R   (   RT   R   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyRU   G  s    c         C   s(   | |  _  | |  _ | |  _ | |  _ d S(   s  Do some setup after initialisation.

        :param target: What is assigned to by the comprehension.
        :type target: NodeNG or None

        :param iter: What is iterated over by the comprehension.
        :type iter: NodeNG or None

        :param ifs: The contents of any if statements that filter
            the comprehension.
        :type ifs: list(NodeNG) or None

        :param is_async: Whether this is an asynchronous comprehension or not.
        :type: bool or None
        N(   R  R\   R:  R;  (   RT   R  R\   R:  R;  (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR   P  s    			c         C   s   |  S(   sw   The type of assignment that this node performs.

        :returns: The assignment type.
        :rtype: NodeNG
        (    (   RT   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR   j  s    c         C   s<   t  j d t |   j t |   j f t d d |  j   S(   s   A deprecated alias of :meth:`assign_type`.

        .. deprecated:: 1.5

        :returns: The assignment type.
        :rtype: NodeNG
        s_   %s.ass_type() is deprecated and slated for removalin astroid 2.0, use %s.assign_type() instead.R   i   (   R   R   R6   Rk   R   R   (   RT   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyt   ass_typer  s    	c         C   sZ   |  | k r1 t  | t t f  rP | g t f Sn |  j   | k rP | g t f S| t f S(   s   method used in filter_stmts(   R
   R3   R   R    R   R$   (   RT   t   lookup_nodeR	   R   R   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR     s    (   R  R\   R:  (   R;  N(   Rk   R   R   Rn   Rm   R   R  R\   R:  R;  RU   R   R    R   R   R<  R   (    (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR9  $  s   			R3   c           B   sV   e  Z d  Z d Z d	 d	 d	 d  Z d	 d  Z d   Z d   Z d   Z	 d   Z
 RS(
   s  Class representing any constant including num, str, bool, None, bytes.

    >>> 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>]
    R4   c         C   s)   | |  _  t t |   j | | |  d S(   s  
        :param value: The value that the constant represents.
        :type value: object

        :param lineno: The line that this node appears on in the source code.
        :type lineno: int or None

        :param col_offset: The column that this node appears on in the
            source code.
        :type col_offset: int or None

        :param parent: The parent node in the syntax tree.
        :type parent: NodeNG or None
        N(   R4   R   R3   RU   (   RT   R4   RR   RS   R   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyRU     s    	c         C   s]  t  | t  r | j } nB t  | t  r? t | d | } n t j d j t |     yV t  |  j t	 j
  r t |  j |  St  |  j t  r t	 j r t |  j |  SWn t k
 r } t j t j d d d | d |  d | d |   nD t k
 r<} t j t j d d d | d |  d | d |   n Xt j d	 |  |  j f   d
 S(   s%  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.
        R   s(   Could not use type {} as subscript indexR=   s   Index {index!r} out of rangeRE   R	   R9   s   Type error {error!r}s   %r (value=%s)N(   R
   R3   R4   RF   RD   R   RC   t   formatR6   R
  t   string_typest   bytesR  RH   R   RI   RJ   RK   (   RT   R9   R   t   index_valueRO   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyt   getitem  s*    	c         C   s   t  S(   s  Check if the node has a custom __getattr__ or __getattribute__.

        :returns: True if the class has a custom
            __getattr__ or __getattribute__, False otherwise.
            For a :class:`Const` this is always ``False``.
        :rtype: bool
        (   R$   (   RT   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyt   has_dynamic_getattr  s    c         C   s)   t  |  j t j  r |  j St    d S(   s   An iterator over the elements this node contains.

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

        :raises TypeError: If this node does not represent something that is iterable.
        N(   R
   R4   R
  R?  RK   (   RT   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR     s    c         C   s   |  j  j   S(   sy   Get the name of the type that this node represents.

        :returns: The name of the type.
        :rtype: str
        (   t   _proxiedt   qname(   RT   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR     s    c         C   s   t  |  j  S(   sz   Determine the boolean value of this node.

        :returns: The boolean value of this node.
        :rtype: bool
        (   R   R4   (   RT   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR     s    (   R4   N(   Rk   R   R   Rm   R   RU   RB  RC  R   R   R   (    (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR3     s   (	
		t   Continuec           B   s   e  Z d  Z RS(   s   Class representing an :class:`ast.Continue` node.

    >>> node = astroid.extract_node('continue')
    >>> node
    <Continue l.1 at 0x7f23b2e35588>
    (   Rk   R   R   (    (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyRF  	  s   t
   Decoratorsc           B   s,   e  Z d  Z d Z d Z d   Z d   Z RS(   s  A node representing a list of decorators.

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

    >>> 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   c         C   s   | |  _  d S(   s   Do some setup after initialisation.

        :param nodes: The decorators that this node contains.
        :type nodes: list(Name or Call)
        N(   R   (   RT   R   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR   $	  s    c         C   s   |  j  j  j   S(   s   The first parent node defining a new scope.

        :returns: The first parent scope node.
        :rtype: Module or FunctionDef or ClassDef or Lambda or GenExpr
        (   R   R   (   RT   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR   ,	  s    (   R   N(   Rk   R   R   Rn   R   R   R   R   (    (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyRG  	  s
   	t   DelAttrc           B   sA   e  Z d  Z d Z d Z d Z d d d d d  Z d d  Z RS(   s   Variation of :class:`ast.Delete` representing deletion of an attribute.

    >>> node = astroid.extract_node('del self.attr')
    >>> node
    <Delete l.1 at 0x7f23b2e35f60>
    >>> list(node.get_children())[0]
    <DelAttr.attr l.1 at 0x7f23b2e411d0>
    R  Ra   c         C   s)   | |  _  t t |   j | | |  d S(   s  
        :param attrname: The name of the attribute that is being deleted.
        :type attrname: str or None

        :param lineno: The line that this node appears on in the source code.
        :type lineno: int or None

        :param col_offset: The column that this node appears on in the
            source code.
        :type col_offset: int or None

        :param parent: The parent node in the syntax tree.
        :type parent: NodeNG or None
        N(   Ra   R   RH  RU   (   RT   Ra   RR   RS   R   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyRU   G	  s    	c         C   s   | |  _  d S(   s   Do some setup after initialisation.

        :param expr: The name that this node represents.
        :type expr: Name or None
        N(   R  (   RT   R  (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR   ^	  s    (   R  (   Ra   N(	   Rk   R   R   Rn   Rm   R   R  RU   R   (    (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyRH  6	  s   t   Deletec           B   s&   e  Z d  Z d Z d Z d d  Z RS(   s   Class representing an :class:`ast.Delete` node.

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

    >>> node = astroid.extract_node('del self.attr')
    >>> node
    <Delete l.1 at 0x7f23b2e35f60>
    R  c         C   s   | |  _  d S(   s   Do some setup after initialisation.

        :param targets: What is being deleted.
        :type targets: list(NodeNG) or None
        N(   R  (   RT   R  (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR   w	  s    (   R  N(   Rk   R   R   Rn   R   R  R   (    (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyRI  g	  s   t   Dictc           B   sz   e  Z d  Z d Z d d d d  Z d   Z e d d   Z d   Z	 d   Z
 d   Z d   Z d d	  Z d
   Z RS(   s   Class representing an :class:`ast.Dict` node.

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

    >>> node = astroid.extract_node('{1: "1"}')
    >>> node
    <Dict.dict l.1 at 0x7f23b2e35cc0>
    t   itemsc         C   s)   g  |  _  t t |   j | | |  d S(   sa  
        :param lineno: The line that this node appears on in the source code.
        :type lineno: int or None

        :param col_offset: The column that this node appears on in the
            source code.
        :type col_offset: int or None

        :param parent: The parent node in the syntax tree.
        :type parent: NodeNG or None
        N(   RK  R   RJ  RU   (   RT   RR   RS   R   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyRU   	  s    	c         C   s   | |  _  d S(   s   Do some setup after initialisation.

        :param items: The ley-value pairs contained in the dictionary.
        :type items: list(tuple(NodeNG, NodeNG))
        N(   RK  (   RT   RK  (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR   	  s    c         C   s_   |    } | d k r! g  | _ n: g  | j   D]$ \ } } t |  t |  f ^ q. | _ | S(   s   Create 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
        N(   R   RK  R   (   R   RK  R	   t   kt   v(    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR   	  s    
	7c         C   s   d t  S(   sy   Get the name of the type that this node represents.

        :returns: The name of the type.
        :rtype: str
        s   %s.dict(   t   BUILTINS(   RT   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR   	  s    c         c   s(   x! |  j  D] \ } } | V| Vq
 Wd S(   s   Get 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)
        N(   RK  (   RT   R_   R4   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR   	  s    	c         C   s   |  j  r |  j  d d Sd S(   s   An optimized version of list(get_children())[-1]

        :returns: The last child, or None if no children exist.
        :rtype: NodeNG or None
        ii   N(   RK  R   (   RT   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR   	  s    	c         C   s   |  j  d d d  S(   s   An iterator over the keys this node contains.

        :returns: The keys of this node.
        :rtype: iterable(NodeNG)
        Ni   (   RK  (   RT   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR   	  s    c         C   s   x |  j  D] \ } } t | t  r_ y | j | |  SWq_ t j t j f k
 r[ q
 q_ Xn  xc | j |  D]R } | t j	 k r qo n  t | t
  ro t | t
  ro | j | j k r | Sqo qo Wq
 Wt j |   d S(   sx  Get an item from this node.

        :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.
        :raises AstroidIndexError: If the given index does not exist in the
            dictionary.
        N(   RK  R
   t
   DictUnpackRB  R   RC   RJ   R   R   R   R3   R4   (   RT   R9   R   R_   R4   t   inferredkey(    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyRB  	  s    
c         C   s   t  |  j  S(   sz   Determine the boolean value of this node.

        :returns: The boolean value of this node.
        :rtype: bool
        (   R   RK  (   RT   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR   	  s    (   RK  N(   Rk   R   R   Rn   R   RU   R   R   R   R   R   R   R   RB  R   (    (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyRJ  	  s   				
	t   Exprc           B   s&   e  Z d  Z d Z d Z d d  Z RS(   s  Class representing an :class:`ast.Expr` node.

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

    >>> node = astroid.extract_node('method()')
    >>> node
    <Call l.1 at 0x7f23b2e352b0>
    >>> node.parent
    <Expr l.1 at 0x7f23b2e35278>
    R4   c         C   s   | |  _  d S(   s   Do some setup after initialisation.

        :param value: What the expression does.
        :type value: NodeNG or None
        N(   R4   (   RT   R4   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR   
  s    (   R4   N(   Rk   R   R   Rn   R   R4   R   (    (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyRQ  
  s   t   Ellipsisc           B   s   e  Z d  Z d   Z RS(   s   Class representing an :class:`ast.Ellipsis` node.

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

    >>> node = astroid.extract_node('...')
    >>> node
    <Ellipsis l.1 at 0x7f23b2e35160>
    c         C   s   t  S(   s   Determine the boolean value of this node.

        :returns: The boolean value of this node.
            For an :class:`Ellipsis` this is always ``True``.
        :rtype: bool
        (   R    (   RT   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR   *
  s    (   Rk   R   R   R   (    (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyRR   
  s   t	   EmptyNodec           B   s   e  Z d  Z d Z RS(   sA   Holds an arbitrary object in the :attr:`LocalsDictNodeNG.locals`.N(   Rk   R   R   R   t   object(    (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyRS  4
  s   t   ExceptHandlerc           B   sS   e  Z d  Z d Z d Z d Z d Z d d d d  Z e	 j
 d    Z d   Z RS(	   s  Class representing an :class:`ast.ExceptHandler`. node.

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

    >>> 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>]
    R6   R`   R   c         C   s   | |  _  | |  _ | |  _ d S(   sY  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.
        :type name: AssignName or None

        :param body:The contents of the block.
        :type body: list(NodeNG) or None
        N(   R6   R`   R   (   RT   R6   R`   R   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR   \
  s    		c         C   s-   |  j  r |  j  j S|  j r& |  j j S|  j S(   sP   The line on which the beginning of this block ends.

        :type: int
        (   R`   R   R6   RR   (   RT   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyt   blockstart_tolinenol
  s
    	
	
c         C   sS   |  j  d k s | d k r t Sx- |  j  j t  D] } | j | k r2 t Sq2 Wt S(   s   Check if this node handles any of the given exceptions.

        If ``exceptions`` is empty, this will default to ``True``.

        :param exceptions: The name of the exceptions to check for.
        :type exceptions: list(str)
        N(   R6   R   R    R   R   R`   R$   (   RT   R   R	   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR"   y
  s    (   R6   R`   R   N(   Rk   R   R   Rn   R   R6   R`   R   R   R   R   RV  R"   (    (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyRU  :
  s   t   Execc           B   s8   e  Z d  Z d Z d Z d Z d Z d d d d  Z RS(   s   Class representing the ``exec`` statement.

    >>> node = astroid.extract_node('exec "True"')
    >>> node
    <Exec l.1 at 0x7f0e8106c6d0>
    R  t   globalsR   c         C   s   | |  _  | |  _ | |  _ d S(   sN  Do some setup after initialisation.

        :param expr: The expression to be executed.
        :type expr: NodeNG or None

        :param globals:The globals dictionary to execute with.
        :type globals: NodeNG or None

        :param locals: The locals dictionary to execute with.
        :type locals: NodeNG or None
        N(   R  RX  R   (   RT   R  RX  R   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR   
  s    		(   R  RX  R   N(	   Rk   R   R   Rn   R   R  RX  R   R   (    (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyRW  
  s   t   ExtSlicec           B   s&   e  Z d  Z d Z d Z d d  Z RS(   s  Class representing an :class:`ast.ExtSlice` node.

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

    >>> node = astroid.extract_node('l[1:3, 5]')
    >>> node
    <Subscript l.1 at 0x7f23b2e9e550>
    >>> node.slice
    <ExtSlice l.1 at 0x7f23b7b05ef0>
    t   dimsc         C   s   | |  _  d S(   s   Do some setup after initialisation.

        :param dims: The simple dimensions that form the complete slice.
        :type dims: list(NodeNG) or None
        N(   RZ  (   RT   RZ  (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR   
  s    (   RZ  N(   Rk   R   R   Rn   R   RZ  R   (    (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyRY  
  s   
t   Forc           B   sY   e  Z d  Z d Z d Z d Z d Z d Z d d d d d  Z	 e
 Z e j d    Z RS(	   s   Class representing an :class:`ast.For` node.

    >>> node = astroid.extract_node('for thing in things: print(thing)')
    >>> node
    <For l.1 at 0x7f23b2e8cf28>
    R  R\   R   R   c         C   s(   | |  _  | |  _ | |  _ | |  _ d S(   s  Do some setup after initialisation.

        :param target: What the loop assigns to.
        :type target: NodeNG or None

        :param iter: What the loop iterates over.
        :type iter: NodeNG or None

        :param body: The contents of the body of the loop.
        :type body: list(NodeNG) or None

        :param orelse: The contents of the ``else`` block of the loop.
        :type orelse: list(NodeNG) or None
        N(   R  R\   R   R   (   RT   R  R\   R   R   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR   
  s    			c         C   s
   |  j  j S(   sP   The line on which the beginning of this block ends.

        :type: int
        (   R\   R   (   RT   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyRV    s    (   R  R\   R   R   N(   Rk   R   R   Rn   R   R  R\   R   R   R   R    R   R   R   RV  (    (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR[  
  s   t   AsyncForc           B   s   e  Z d  Z RS(   s  Class representing an :class:`ast.AsyncFor` node.

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

    >>> 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>
    (   Rk   R   R   (    (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR\    s   t   Awaitc           B   s&   e  Z d  Z d Z d Z d d  Z RS(   s  Class representing an :class:`ast.Await` node.

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

    >>> 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   c         C   s   | |  _  d S(   sy   Do some setup after initialisation.

        :param value: What to wait for.
        :type value: NodeNG or None
        N(   R4   (   RT   R4   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR   ;  s    (   R4   N(   Rk   R   R   Rn   R   R4   R   (    (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR]  #  s   t
   ImportFromc           B   s)   e  Z d  Z d Z d d d d d  Z RS(   s   Class representing an :class:`ast.ImportFrom` node.

    >>> node = astroid.extract_node('from my_package import my_module')
    >>> node
    <ImportFrom l.1 at 0x7f23b2e415c0>
    t   modnamet   namest   leveli    c         C   s;   | |  _  | |  _ | |  _ t t |   j | | |  d S(   s  
        :param fromname: The module that is being imported from.
        :type fromname: str or None

        :param names: What is being imported from the module.
        :type names: list(tuple(str, str or None))

        :param level: The level of relative import.
        :type level: int

        :param lineno: The line that this node appears on in the source code.
        :type lineno: int or None

        :param col_offset: The column that this node appears on in the
            source code.
        :type col_offset: int or None

        :param parent: The parent node in the syntax tree.
        :type parent: NodeNG or None
        N(   R_  R`  Ra  R   R^  RU   (   RT   t   fromnameR`  Ra  RR   RS   R   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyRU   M  s    					(   R_  R`  Ra  N(   Rk   R   R   Rm   R   RU   (    (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR^  D  s   t	   Attributec           B   sA   e  Z d  Z d Z d Z d Z d d d d d  Z d d  Z RS(   s2   Class representing an :class:`ast.Attribute` node.R  Ra   c         C   s)   | |  _  t t |   j | | |  d S(   s  
        :param attrname: The name of the attribute.
        :type attrname: str or None

        :param lineno: The line that this node appears on in the source code.
        :type lineno: int or None

        :param col_offset: The column that this node appears on in the
            source code.
        :type col_offset: int or None

        :param parent: The parent node in the syntax tree.
        :type parent: NodeNG or None
        N(   Ra   R   Rc  RU   (   RT   Ra   RR   RS   R   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyRU     s    	c         C   s   | |  _  d S(   s   Do some setup after initialisation.

        :param expr: The name that this node represents.
        :type expr: Name or None
        N(   R  (   RT   R  (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR     s    (   R  (   Ra   N(	   Rk   R   R   Rn   Rm   R   R  RU   R   (    (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyRc    s   t   Globalc           B   s/   e  Z d  Z d Z d d d d  Z d   Z RS(   s   Class representing an :class:`ast.Global` node.

    >>> node = astroid.extract_node('global a_global')
    >>> node
    <Global l.1 at 0x7f23b2e9de10>
    R`  c         C   s)   | |  _  t t |   j | | |  d S(   s  
        :param names: The names being declared as global.
        :type names: list(str)

        :param lineno: The line that this node appears on in the source code.
        :type lineno: int or None

        :param col_offset: The column that this node appears on in the
            source code.
        :type col_offset: int or None

        :param parent: The parent node in the syntax tree.
        :type parent: NodeNG or None
        N(   R`  R   Rd  RU   (   RT   R`  RR   RS   R   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyRU     s    	c         C   s   | S(   N(    (   RT   R   R`   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR     s    (   R`  N(   Rk   R   R   Rm   R   RU   R   (    (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyRd    s   R   c           B   sS   e  Z d  Z d Z d Z d Z d Z d d d d  Z e	 j
 d    Z d   Z RS(	   s   Class representing an :class:`ast.If` node.

    >>> node = astroid.extract_node('if condition: print(True)')
    >>> node
    <If l.1 at 0x7f23b2e9dd30>
    R  R   R   c         C   s   | |  _  | |  _ | |  _ d S(   sN  Do some setup after initialisation.

        :param test: The condition that the statement tests.
        :type test: NodeNG or None

        :param body: The contents of the block.
        :type body: list(NodeNG) or None

        :param orelse: The contents of the ``else`` block.
        :type orelse: list(NodeNG) or None
        N(   R  R   R   (   RT   R  R   R   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR     s    		c         C   s
   |  j  j S(   sP   The line on which the beginning of this block ends.

        :type: int
        (   R  R   (   RT   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyRV    s    c         C   sn   | |  j  d j k r  | | f S| |  j  d j k rJ | |  j  d j f S|  j | |  j |  j  d j d  S(   s8  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)
        i    ii   (   R   R}   R   t   _elsed_block_rangeR   (   RT   RR   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR     s    

(   R  R   R   N(   Rk   R   R   Rn   R   R  R   R   R   R   R   RV  R   (    (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR     s   t   IfExpc           B   s8   e  Z d  Z d Z d Z d Z d Z d d d d  Z RS(   s   Class representing an :class:`ast.IfExp` node.

    >>> node = astroid.extract_node('value if condition else other')
    >>> node
    <IfExp l.1 at 0x7f23b2e9dbe0>
    R  R   R   c         C   s   | |  _  | |  _ | |  _ d S(   sN  Do some setup after initialisation.

        :param test: The condition that the statement tests.
        :type test: NodeNG or None

        :param body: The contents of the block.
        :type body: list(NodeNG) or None

        :param orelse: The contents of the ``else`` block.
        :type orelse: list(NodeNG) or None
        N(   R  R   R   (   RT   R  R   R   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR   (  s    		(   R  R   R   N(	   Rk   R   R   Rn   R   R  R   R   R   (    (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyRf    s   t   Importc           B   s)   e  Z d  Z d Z d d d d d  Z RS(   s   Class representing an :class:`ast.Import` node.

    >>> node = astroid.extract_node('import astroid')
    >>> node
    <Import l.1 at 0x7f23b2e4e5c0>
    R`  c         C   s)   | |  _  t t |   j | | |  d S(   s  
        :param names: The names being imported.
        :type names: list(tuple(str, str or None)) or None

        :param lineno: The line that this node appears on in the source code.
        :type lineno: int or None

        :param col_offset: The column that this node appears on in the
            source code.
        :type col_offset: int or None

        :param parent: The parent node in the syntax tree.
        :type parent: NodeNG or None
        N(   R`  R   Rg  RU   (   RT   R`  RR   RS   R   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyRU   A  s    		(   R`  N(   Rk   R   R   Rm   R   RU   (    (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyRg  8  s   t   Indexc           B   s&   e  Z d  Z d Z d Z d d  Z RS(   s   Class representing an :class:`ast.Index` node.

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

    >>> node = astroid.extract_node('things[1]')
    >>> node
    <Subscript l.1 at 0x7f23b2e9e2b0>
    >>> node.slice
    <Index l.1 at 0x7f23b2e9e6a0>
    R4   c         C   s   | |  _  d S(   s   Do some setup after initialisation.

        :param value: The value to subscript with.
        :type value: NodeNG or None
        N(   R4   (   RT   R4   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR   n  s    (   R4   N(   Rk   R   R   Rn   R   R4   R   (    (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyRh  \  s   
t   Keywordc           B   sA   e  Z d  Z d Z d Z d Z d d d d d  Z d d  Z RS(   s   Class representing an :class:`ast.keyword` node.

    >>> node = astroid.extract_node('function(a_kwarg=True)')
    >>> node
    <Call l.1 at 0x7f23b2e9e320>
    >>> node.keywords
    [<Keyword l.1 at 0x7f23b2e9e9b0>]
    R4   R  c         C   s)   | |  _  t t |   j | | |  d S(   s  
        :param arg: The argument being assigned to.
        :type arg: Name or None

        :param lineno: The line that this node appears on in the source code.
        :type lineno: int or None

        :param col_offset: The column that this node appears on in the
            source code.
        :type col_offset: int or None

        :param parent: The parent node in the syntax tree.
        :type parent: NodeNG or None
        N(   R  R   Ri  RU   (   RT   R  RR   RS   R   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyRU     s    	c         C   s   | |  _  d S(   s   Do some setup after initialisation.

        :param value: The value being assigned to the ketword argument.
        :type value: NodeNG or None
        N(   R4   (   RT   R4   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR     s    (   R4   (   R  N(	   Rk   R   R   Rn   Rm   R   R4   RU   R   (    (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyRi  w  s   R   c           B   s>   e  Z d  Z d Z d d d d d  Z d   Z d d  Z RS(   s   Class representing an :class:`ast.List` node.

    >>> node = astroid.extract_node('[1, 2, 3]')
    >>> node
    <List.list l.1 at 0x7f23b2e9e128>
    t   ctxc         C   s)   | |  _  t t |   j | | |  d S(   s  
        :param ctx: Whether the list is assigned to or loaded from.
        :type ctx: Context or None

        :param lineno: The line that this node appears on in the source code.
        :type lineno: int or None

        :param col_offset: The column that this node appears on in the
            source code.
        :type col_offset: int or None

        :param parent: The parent node in the syntax tree.
        :type parent: NodeNG or None
        N(   Rj  R   R   RU   (   RT   Rj  RR   RS   R   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyRU     s    	c         C   s   d t  S(   sy   Get the name of the type that this node represents.

        :returns: The name of the type.
        :rtype: str
        s   %s.list(   RN  (   RT   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR     s    c         C   s   t  |  |  j | d | S(   s   Get an item from this node.

        :param index: The node to use as a subscript index.
        :type index: Const or Slice
        R   (   RP   R   (   RT   R9   R   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyRB    s    (   Rj  N(   Rk   R   R   Rm   R   RU   R   RB  (    (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR     s   	t   Nonlocalc           B   s/   e  Z d  Z d Z d d d d  Z d   Z RS(   s	  Class representing an :class:`ast.Nonlocal` node.

    >>> node = astroid.extract_node('''
    def function():
        nonlocal var
    ''')
    >>> node
    <FunctionDef.function l.2 at 0x7f23b2e9e208>
    >>> node.body[0]
    <Nonlocal l.3 at 0x7f23b2e9e908>
    R`  c         C   s)   | |  _  t t |   j | | |  d S(   s  
        :param names: The names being decalred as not local.
        :type names: list(str)

        :param lineno: The line that this node appears on in the source code.
        :type lineno: int or None

        :param col_offset: The column that this node appears on in the
            source code.
        :type col_offset: int or None

        :param parent: The parent node in the syntax tree.
        :type parent: NodeNG or None
        N(   R`  R   Rk  RU   (   RT   R`  RR   RS   R   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyRU     s    	c         C   s   | S(   N(    (   RT   R   R`   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR     s    (   R`  N(   Rk   R   R   Rm   R   RU   R   (    (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyRk    s   t   Passc           B   s   e  Z d  Z RS(   s   Class representing an :class:`ast.Pass` node.

    >>> node = astroid.extract_node('pass')
    >>> node
    <Pass l.1 at 0x7f23b2e9e748>
    (   Rk   R   R   (    (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyRl    s   t   Printc           B   sD   e  Z d  Z d Z d Z d Z d d d d d  Z d d d  Z RS(   s   Class representing an :class:`ast.Print` node.

    >>> node = astroid.extract_node('print "A message"')
    >>> node
    <Print l.1 at 0x7f0e8101d290>
    t   destR  c         C   s)   | |  _  t t |   j | | |  d S(   s  
        :param nl: Whether to print a new line.
        :type nl: bool or None

        :param lineno: The line that this node appears on in the source code.
        :type lineno: int or None

        :param col_offset: The column that this node appears on in the
            source code.
        :type col_offset: int or None

        :param parent: The parent node in the syntax tree.
        :type parent: NodeNG or None
        N(   t   nlR   Rm  RU   (   RT   Ro  RR   RS   R   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyRU     s    	c         C   s   | |  _  | |  _ d S(   s   Do some setup after initialisation.

        :param dest: Where to print to.
        :type dest: NodeNG or None

        :param values: What to print.
        :type values: list(NodeNG) or None
        N(   Rn  R  (   RT   Rn  R  (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR   6  s    		(   Rn  R  N(	   Rk   R   R   Rn   R   Rn  R  RU   R   (    (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyRm    s   t   Raisec           B   sh   e  Z d  Z d Z e j rB d	 Z d Z d Z	 d d d d  Z
 n d
 Z d Z d d d  Z
 d   Z RS(   s   Class representing an :class:`ast.Raise` node.

    >>> node = astroid.extract_node('raise RuntimeError("Something bad happened!")')
    >>> node
    <Raise l.1 at 0x7f23b2e9e828>
    RO   t   instt   tbackc         C   s   | |  _  | |  _ | |  _ d S(   sX  Do some setup after initialisation.

            :param exc: What is being raised.
            :type exc: NodeNG or None

            :param inst: The "value" of the exception being raised.
            :type inst: NodeNG or None

            :param tback: The traceback object to raise with.
            :type tback: NodeNG or None
            N(   RO   Rq  Rr  (   RT   RO   Rq  Rr  (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR   \  s    		t   causec         C   s   | |  _  | |  _ d S(   s   Do some setup after initialisation.

            :param exc: What is being raised.
            :type exc: NodeNG or None

            :param cause: The exception being used to raise this one.
            :type cause: NodeNG or None
            N(   RO   Rs  (   RT   RO   Rs  (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR   s  s    		c         C   sA   |  j  s t Sx- |  j  j t  D] } | j d k r  t Sq  Wt S(   s   Check if this node raises a :class:`NotImplementedError`.

        :returns: True if this node raises a :class:`NotImplementedError`,
            False otherwise.
        :rtype: bool
        R#  (   RO   R$   R   R   R`   R    (   RT   R`   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyt   raises_not_implemented  s    	N(   RO   Rq  Rr  (   RO   Rs  (   Rk   R   R   R   RO   R
  t   PY2Rn   Rq  Rr  R   Rs  Rt  (    (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyRp  C  s   	t   Returnc           B   s&   e  Z d  Z d Z d Z d d  Z RS(   s   Class representing an :class:`ast.Return` node.

    >>> node = astroid.extract_node('return True')
    >>> node
    <Return l.1 at 0x7f23b8211908>
    R4   c         C   s   | |  _  d S(   s   Do some setup after initialisation.

        :param value: The value being returned.
        :type value: NodeNG or None
        N(   R4   (   RT   R4   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR     s    (   R4   N(   Rk   R   R   Rn   R   R4   R   (    (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyRv    s   t   Setc           B   s   e  Z d  Z d   Z RS(   s   Class representing an :class:`ast.Set` node.

    >>> node = astroid.extract_node('{1, 2, 3}')
    >>> node
    <Set.set l.1 at 0x7f23b2e71d68>
    c         C   s   d t  S(   sy   Get the name of the type that this node represents.

        :returns: The name of the type.
        :rtype: str
        s   %s.set(   RN  (   RT   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR     s    (   Rk   R   R   R   (    (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyRw    s   RF   c           B   st   e  Z d  Z d
 Z d Z d Z d Z d d d d  Z d   Z	 e
 j d    Z d   Z d d  Z d d	  Z RS(   s   Class representing an :class:`ast.Slice` node.

    >>> node = astroid.extract_node('things[1:3]')
    >>> node
    <Subscript l.1 at 0x7f23b2e71f60>
    >>> node.slice
    <Slice l.1 at 0x7f23b2e71e80>
    R>   R?   R@   c         C   s   | |  _  | |  _ | |  _ d S(   s:  Do some setup after initialisation.

        :param lower: The lower index in the slice.
        :value lower: NodeNG or None

        :param upper: The upper index in the slice.
        :value upper: NodeNG or None

        :param step: The step to take between index.
        :param step: NodeNG or None
        N(   R>   R?   R@   (   RT   R>   R?   R@   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR     s    		c         C   s#   | s t  |  } |  | _ | S| S(   s7   Wrap the empty attributes of the Slice in a Const node.(   R   R   (   RT   R   t   const(    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyt   _wrap_attribute  s
    	c         C   s   t  j t } | j d  d S(   NRB   i    (   t   MANAGERt   astroid_cacheRN  Rc   (   RT   t   builtins(    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyRD    s    c         C   s   d t  S(   sy   Get the name of the type that this node represents.

        :returns: The name of the type.
        :rtype: str
        s   %s.slice(   RN  (   RT   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR     s    c         c   s   | d k r  |  j  |  j  Vne | d k r@ |  j  |  j  VnE | d k r` |  j  |  j  Vn% x" |  j | d | D] } | Vqv Wd S(   s   Infer 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)
        t   startt   stopR@   R   N(   Ry  R>   R?   R@   Rc   (   RT   Ra   R   R4   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyt   igetattr  s    	c         C   s   |  j  j | |  S(   N(   RD  Rc   (   RT   Ra   R   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyRc     s    (   R>   R?   R@   N(   Rk   R   R   Rn   R   R>   R?   R@   R   Ry  R   R   RD  R   R  Rc   (    (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyRF     s   		R1  c           B   sA   e  Z d  Z d Z d Z d Z d d d d d  Z d d  Z RS(   s   Class representing an :class:`ast.Starred` node.

    >>> node = astroid.extract_node('*args')
    >>> node
    <Starred l.1 at 0x7f23b2e41978>
    R4   Rj  c         C   s2   | |  _  t t |   j d | d | d |  d S(   s  
        :param ctx: Whether the list is assigned to or loaded from.
        :type ctx: Context or None

        :param lineno: The line that this node appears on in the source code.
        :type lineno: int or None

        :param col_offset: The column that this node appears on in the
            source code.
        :type col_offset: int or None

        :param parent: The parent node in the syntax tree.
        :type parent: NodeNG or None
        RR   RS   R   N(   Rj  R   R1  RU   (   RT   Rj  RR   RS   R   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyRU     s    	c         C   s   | |  _  d S(   s   Do some setup after initialisation.

        :param value: What is being unpacked.
        :type value: NodeNG or None
        N(   R4   (   RT   R4   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR   3  s    (   R4   (   Rj  N(	   Rk   R   R   Rn   Rm   R   R4   RU   R   (    (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR1    s   t	   Subscriptc           B   sJ   e  Z d  Z d Z d Z d Z d Z d d d d d  Z d d d  Z	 RS(	   s   Class representing an :class:`ast.Subscript` node.

    >>> node = astroid.extract_node('things[1:3]')
    >>> node
    <Subscript l.1 at 0x7f23b2e71f60>
    R4   RB   Rj  c         C   s2   | |  _  t t |   j d | d | d |  d S(   s  
        :param ctx: Whether the subscripted item is assigned to or loaded from.
        :type ctx: Context or None

        :param lineno: The line that this node appears on in the source code.
        :type lineno: int or None

        :param col_offset: The column that this node appears on in the
            source code.
        :type col_offset: int or None

        :param parent: The parent node in the syntax tree.
        :type parent: NodeNG or None
        RR   RS   R   N(   Rj  R   R  RU   (   RT   Rj  RR   RS   R   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyRU   P  s    	c         C   s   | |  _  | |  _ d S(   s   Do some setup after initialisation.

        :param value: What is being indexed.
        :type value: NodeNG or None

        :param slice: The slice being used to lookup.
        :type slice: NodeNG or None
        N(   R4   RB   (   RT   R4   RB   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR   i  s    		(   R4   RB   (   Rj  N(
   Rk   R   R   Rn   Rm   R   R4   RB   RU   R   (    (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR  <  s   R!   c           B   sJ   e  Z d  Z d Z d Z d Z d Z d d d d  Z d   Z	 d   Z
 RS(	   s  Class representing an :class:`ast.TryExcept` node.

    >>> node = astroid.extract_node('''
        try:
            do_something()
        except Exception as error:
            print("Error!")
        ''')
    >>> node
    <TryExcept l.2 at 0x7f23b2e9d908>
    R   R   R   c         C   s   | |  _  | |  _ | |  _ d S(   sl  Do some setup after initialisation.

        :param body: The contents of the block to catch exceptions from.
        :type body: list(NodeNG) or None

        :param handlers: The exception handlers.
        :type handlers: list(ExceptHandler) or None

        :param orelse: The contents of the ``else`` block.
        :type orelse: list(NodeNG) or None
        N(   R   R   R   (   RT   R   R   R   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR     s    		c         C   s   | S(   N(    (   RT   R   R`   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR     s    c         C   s   d } x |  j D] } | j r; | | j j k r; | | f S| j d j | k of | j d j k n r | | j d j f S| d k r | j d j d } q q W|  j | |  j |  S(   s8  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)
        i    ii   N(   R   R   R6   R}   R   R   Re  R   (   RT   RR   t   lastt	   exhandler(    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR     s    

0(   R   R   R   N(   Rk   R   R   Rn   R   R   R   R   R   R   R   (    (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR!   v  s   	t
   TryFinallyc           B   s8   e  Z d  Z d Z d Z d Z d d d  Z d   Z RS(   s  Class representing an :class:`ast.TryFinally` node.

    >>> node = astroid.extract_node('''
    try:
        do_something()
    except Exception as error:
        print("Error!")
    finally:
        print("Cleanup!")
    ''')
    >>> node
    <TryFinally l.2 at 0x7f23b2e41d68>
    R   t	   finalbodyc         C   s   | |  _  | |  _ d S(   s  Do some setup after initialisation.

        :param body: The try-except that the finally is attached to.
        :type body: list(TryExcept) or None

        :param finalbody: The contents of the ``finally`` block.
        :type finalbody: list(NodeNG) or None
        N(   R   R  (   RT   R   R  (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR     s    		c         C   sl   |  j  d } t | t  rY | j |  j k rY | |  j k rY | | j k rY | j |  S|  j | |  j  S(   s8  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)
        i    (   R   R
   R!   R}   R   R   Re  R  (   RT   RR   R   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR     s
    
!(   R   R  N(	   Rk   R   R   Rn   R   R   R  R   R   (    (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR    s   R   c           B   s>   e  Z d  Z d Z d d d d d  Z d   Z d d  Z RS(   s   Class representing an :class:`ast.Tuple` node.

    >>> node = astroid.extract_node('(1, 2, 3)')
    >>> node
    <Tuple.tuple l.1 at 0x7f23b2e41780>
    Rj  c         C   s)   | |  _  t t |   j | | |  d S(   s  
        :param ctx: Whether the tuple is assigned to or loaded from.
        :type ctx: Context or None

        :param lineno: The line that this node appears on in the source code.
        :type lineno: int or None

        :param col_offset: The column that this node appears on in the
            source code.
        :type col_offset: int or None

        :param parent: The parent node in the syntax tree.
        :type parent: NodeNG or None
        N(   Rj  R   R   RU   (   RT   Rj  RR   RS   R   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyRU     s    	c         C   s   d t  S(   sy   Get the name of the type that this node represents.

        :returns: The name of the type.
        :rtype: str
        s   %s.tuple(   RN  (   RT   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR     s    c         C   s   t  |  |  j | d | S(   s   Get an item from this node.

        :param index: The node to use as a subscript index.
        :type index: Const or Slice
        R   (   RP   R   (   RT   R9   R   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyRB    s    (   Rj  N(   Rk   R   R   Rm   R   RU   R   RB  (    (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR     s   	t   UnaryOpc           B   sY   e  Z d  Z d Z d Z d	 Z d	 d	 d	 d	 d  Z d	 d  Z d	 d  Z	 d	 d  Z
 RS(
   s   Class representing an :class:`ast.UnaryOp` node.

    >>> node = astroid.extract_node('-5')
    >>> node
    <UnaryOp l.1 at 0x7f23b2e4e198>
    t   operandR"  c         C   s)   | |  _  t t |   j | | |  d S(   s  
        :param op: The operator.
        :type: str or None

        :param lineno: The line that this node appears on in the source code.
        :type lineno: int or None

        :param col_offset: The column that this node appears on in the
            source code.
        :type col_offset: int or None

        :param parent: The parent node in the syntax tree.
        :type parent: NodeNG or None
        N(   R"  R   R  RU   (   RT   R"  RR   RS   R   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyRU   5  s    	c         C   s   | |  _  d S(   s   Do some setup after initialisation.

        :param operand: What the unary operator is applied to.
        :type operand: NodeNG or None
        N(   R  (   RT   R  (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR   L  s    c         C   s
   t   d  S(   N(   R#  (   RT   R   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyt   _infer_unaryopU  s    c         C   s[   y? |  j  d |  } g  | D] } t | t j  r | ^ q SWn t j k
 rV g  SXd S(   s%  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)
        R   N(   R  R
   R   t   BadUnaryOperationMessageR   R7   (   RT   R   R&  Rv   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR'  X  s    	 (   R  (   R"  N(   Rk   R   R   Rn   Rm   R   R  RU   R   R  R'  (    (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR  &  s   	t   Whilec           B   sS   e  Z d  Z d Z d Z d Z d Z d d d d  Z e	 j
 d    Z d   Z RS(	   s   Class representing an :class:`ast.While` node.

    >>> node = astroid.extract_node('''
    while condition():
        print("True")
    ''')
    >>> node
    <While l.2 at 0x7f23b2e4e390>
    R  R   R   c         C   s   | |  _  | |  _ | |  _ d S(   sH  Do some setup after initialisation.

        :param test: The condition that the loop tests.
        :type test: NodeNG or None

        :param body: The contents of the loop.
        :type body: list(NodeNG) or None

        :param orelse: The contents of the ``else`` block.
        :type orelse: list(NodeNG) or None
        N(   R  R   R   (   RT   R  R   R   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR     s    		c         C   s
   |  j  j S(   sP   The line on which the beginning of this block ends.

        :type: int
        (   R  R   (   RT   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyRV    s    c         C   s   |  j  | |  j  S(   s8  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)
        (   Re  R   (   RT   RR   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR     s    
(   R  R   R   N(   Rk   R   R   Rn   R   R  R   R   R   R   R   RV  R   (    (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR  i  s   	t   Withc           B   sJ   e  Z d  Z d Z d Z d Z d d d  Z e j	 d    Z
 d   Z RS(   s   Class representing an :class:`ast.With` node.

    >>> node = astroid.extract_node('''
    with open(file_path) as file_:
        print(file_.read())
    ''')
    >>> node
    <With l.2 at 0x7f23b2e4e710>
    RK  R   c         C   s   | |  _  | |  _ d S(   s9  Do some setup after initialisation.

        :param items: The pairs of context managers and the names
            they are assigned to.
        :type items: list(tuple(NodeNG, AssignName or None)) or None

        :param body: The contents of the ``with`` block.
        :type body: list(NodeNG) or None
        N(   RK  R   (   RT   RK  R   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR     s    
	c         C   s   |  j  d d j S(   sP   The line on which the beginning of this block ends.

        :type: int
        ii    (   RK  R   (   RT   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyRV    s    c         c   sJ   x* |  j  D] \ } } | V| r
 | Vq
 q
 Wx |  j D] } | Vq7 Wd S(   so   Get the child nodes below this node.

        :returns: The children.
        :rtype: iterable(NodeNG)
        N(   RK  R   (   RT   R  t   varR   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR     s    (   RK  R   N(   Rk   R   R   Rn   R   RK  R   R   R   R   RV  R   (    (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR    s   	t	   AsyncWithc           B   s   e  Z d  Z RS(   s7   Asynchronous ``with`` built with the ``async`` keyword.(   Rk   R   R   (    (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR    s   t   Yieldc           B   s&   e  Z d  Z d Z d Z d d  Z RS(   s   Class representing an :class:`ast.Yield` node.

    >>> node = astroid.extract_node('yield True')
    >>> node
    <Yield l.1 at 0x7f23b2e4e5f8>
    R4   c         C   s   | |  _  d S(   s{   Do some setup after initialisation.

        :param value: The value to yield.
        :type value: NodeNG or None
        N(   R4   (   RT   R4   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR     s    (   R4   N(   Rk   R   R   Rn   R   R4   R   (    (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR    s   t	   YieldFromc           B   s   e  Z d  Z RS(   s2   Class representing an :class:`ast.YieldFrom` node.(   Rk   R   R   (    (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR    s   RO  c           B   s   e  Z d  Z RS(   s>   Represents the unpacking of dicts into dicts using :pep:`448`.(   Rk   R   R   (    (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyRO    s   t   FormattedValuec           B   s5   e  Z d  Z d Z d Z d Z d Z d d d  Z RS(   s9  Class representing an :class:`ast.FormattedValue` node.

    Represents a :pep:`498` format string.

    >>> 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>]
    R4   t   format_specc         C   s   | |  _  | |  _ | |  _ d S(   st  Do some setup after initialisation.

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

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

        :param format_spec: The formatting to be applied to the value.
        :type format_spec: JoinedStr or None
        N(   R4   t
   conversionR  (   RT   R4   R  R  (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR   '  s    		(   R4   R  N(	   Rk   R   R   Rn   R   R4   R  R  R   (    (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR    s   
	t	   JoinedStrc           B   s&   e  Z d  Z d Z d Z d d  Z RS(   s   Represents a list of string expressions to be joined.

    >>> node = astroid.extract_node('f"Format {type_}"')
    >>> node
    <JoinedStr l.1 at 0x7f23b2e4ed30>
    R  c         C   s   | |  _  d S(   s   Do some setup after initialisation.

        :param value: The string expressions to be joined.

        :type: list(FormattedValue or Const) or None
        N(   R  (   RT   R  (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR   F  s    (   R  N(   Rk   R   R   Rn   R   R  R   (    (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR  8  s   t   Unknownc           B   s   e  Z d  Z d d  Z RS(   s   This 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.
    c         k   s   t  j Vd S(   s4   Inference on an Unknown node immediately terminates.N(   R   R   (   RT   R   R^   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR   V  s    N(   Rk   R   R   R   R   (    (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR  P  s   c          C   s]   t  t t t t f }  t j r1 |  t t f 7}  n  |  t	 f 7}  x |  D] } t
 t | <qE Wd S(   s?   update constant classes, so the keys of CONST_CLS can be reusedN(   R   R5   t   floatt   complext   strR
  Ru  t   unicodet   longR@  R3   t	   CONST_CLS(   t   klassest   kls(    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyt   _update_const_classesf  s    	c         C   s   |    } | j  |  | S(   N(   R   (   R   R4   RL   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyt   _two_step_initializationr  s    	c         C   s1   t  | t  r$ t | j    } n  t |  |  S(   N(   R
   R   R   RK  R  (   R   R4   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyt   _dict_initializationx  s    c         C   s
   |  |  S(   N(    (   R   R4   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyt   <lambda>  s    c         C   s   t  |  t  s t  t  |  t t t t f  r: g  } n |  } y( t |  j } t	 | } | | |  SWn* t
 t f k
 r t   } |  | _ | SXd S(   s)   return an astroid node for a python valueN(   R
   RQ   R   R   R   R   R   R  RG   t   _CONST_CLS_CONSTRUCTORSt   KeyErrort   AttributeErrorRS  RT  (   R4   R   t   initializer_clst   initializerR	   (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyR     s    	
		t	   Backquotet   Discardt   AssNamet   AssAttrt   Getattrt   CallFunct   From(   R   R   Ro   R   t	   functoolsR    R   t   ImportErrorR
  t   astroidR   R   R   R   R   R   R   R   R   R  R|  Rk   RN  t   AstroidManagerRz  t   raise_if_nothing_inferredR   R   R2   RT  R8   R:   RD   RP   RQ   R   t   add_metaclasst   ABCMetat   ParentAssignTypeMixint   InstanceR   R   R   R   R   t   AssignTypeMixinR   R$   R  R   R  R  R  R  R!  R(  R)  R-  R.  R/  R5  R9  R3   RF  RG  RH  RI  RJ  RQ  RR  RS  RU  RW  RY  t   BlockRangeMixInR[  R\  R]  t   ImportFromMixinR^  Rc  Rd  R   Rf  Rg  Rh  Ri  R   Rk  Rl  Rm  Rp  Rv  Rw  RF   R1  R  R!   R  R   R  R  R  R  R  R  RO  R  R  R  R   R   R   R   R6   t   NotImplementedR  R  R  R  R  R   t   proxy_aliasR  R  R  R  R  R  R  (    (    (    s3   lib/python2.7/site-packages/astroid/node_classes.pyt   <module>   s   A	  !K(%(3"#7QN1	==ku	)1O*"C!<*$B($12)	7KV0:E83C@"93					