
%![c           @   s  d  Z  d d l Z d d l Z d d l Z d d l Z d d l Z d d l m Z 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 d d l m Z e j j j Z d d f Z d   Z d   Z d   Z e j   Z d   Z d e j e j  f d     YZ! d e! f d     YZ" d e! f d     YZ# d e# f d     YZ$ d e# f d     YZ% d e# f d     YZ& d e j  f d      YZ' e j( rd! e' e# f d"     YZ) n d! e' f d#     YZ) d$   Z* d% e j+ e! f d&     YZ, d' e j- e, f d(     YZ. d) e. f d*     YZ/ e0 d+  Z1 e0 d,  Z2 e0 d-  Z3 d.   Z4 d/ e j+ e! e j- f d0     YZ5 e j6 d1 e5  Z7 e j6 d2 e.  Z8 e j6 d3 e$  Z9 d S(4   s   
This module contains the classes for "scoped" node, i.e. which are opening a
new local scope in the language definition : Module, ClassDef, FunctionDef (and
Lambda, GeneratorExp, DictComp and SetComp to some extent).
iN(   t   bases(   t   context(   t
   exceptions(   t
   decorators(   t   objectmodel(   t   dunder_lookup(   t   manager(   t   mixins(   t   node_classes(   t   utilt   __iter__t   __getitem__c   	   	   C   s   g  } x t  r g  |  D] } | r | ^ q }  |  s8 | SxD |  D]< } | d } x) |  D]  } | | d k rV d } PqV qV WPq? W| s t j d d d |  d | d |   n  | j |  x( |  D]  } | d | k r | d =q q Wq	 Wd S(	   s   Merges MROs in *sequences* to a single MRO using the C3 algorithm.

    Adapted from http://www.python.org/download/releases/2.3/mro/.

    i    i   t   messagesT   Cannot create a consistent method resolution order for MROs {mros} of class {cls!r}.t   mrost   clsR   N(   t   Truet   NoneR   t   InconsistentMroErrort   append(	   t	   sequencesR   R   t   resultt   st   s1t	   candidatet   s2t   seq(    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyt	   _c3_merge(   s*    	
	c      
   C   s   x |  D]| } g  | D]$ } | j  r | j | j   f ^ q } t |  t t |   k r t j d d d |  d | d |   q q Wd  S(   NR   s,   Duplicates found in MROs {mros} for {cls!r}.R   R   R   (   t   namet   linenot   qnamet   lent   setR   t   DuplicateBasesError(   R   R   R   t   sequencet   nodet   names(    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyt   _verify_duplicates_mroK   s    1	c         C   sQ   t  |  t  rM |  j d k r. t j |  |  S|  j d k rM t j |   Sn  |  S(   Nt   classmethodt   staticmethod(   t
   isinstancet   FunctionDeft   typeR    t   BoundMethodt   UnboundMethod(   t   nt   klass(    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyt   function_to_methodT   s    c         C   s`   t  j t j j  } |  d k r+ | d f Sy | j |  } Wn t k
 rU d } n X| | f S(   s   lookup a name into the builtin module
    return the list of matching statements and the astroid for the builtin
    module
    t   __dict__(    (    (   t   MANAGERt   ast_from_modulet   sixt   movest   builtinst   localst   KeyError(   R   t   builtin_astroidt   stmts(    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyt   builtin_lookup^   s    

t   LocalsDictNodeNGc           B   s   e  Z d  Z i  Z d   Z d   Z d   Z d d  Z d   Z e Z	 d   Z
 d d  Z d	   Z d
   Z d   Z d   Z d   Z d   Z RS(   s    this class provides locals handling common to Module, FunctionDef
    and ClassDef nodes, including a dict like interface for direct access
    to locals information
    c         C   s6   |  j  d k r |  j Sd |  j  j   j   |  j f S(   s   Get the 'qualified' name of the node.

        For example: module.name, module.class.name ...

        :returns: The qualified name.
        :rtype: str
        s   %s.%sN(   t   parentR   R   t   frameR   (   t   self(    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyR   }   s    	c         C   s   |  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=   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyR<      s    	c         C   s   |  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=   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyt   scope   s    i    c         C   s   y  | j  |  j | |  |  } Wn t k
 r9 d } n X| rJ |  | f S|  j r |  j j   } | j sz | j   } n  | j | |  St |  S(   s+   XXX method for interfacing the scope lookup(    (	   t   _filter_stmtsR5   R6   R;   R>   t   is_functiont   roott   scope_lookupR9   (   R=   R"   R   t   offsetR8   t   pscope(    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyt   _scope_lookup   s     

		c         C   s    |  j  j | g   j |  d S(   s  Define that the given name is declared in the given statement 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(   R5   t
   setdefaultR   (   R=   R   t   stmt(    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyt	   set_local   s    c         C   s   |  j  j |  |  | _ d S(   s&   append a child, linking it in the treeN(   t   bodyR   R;   (   R=   t   child(    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyt   _append_node   s    c         C   s9   | d k r |  j  |  n  |  j | p. | j |  d S(   s2  Append a child that should alter the locals of this scope node.

        :param child_node: The child node that will alter locals.
        :type child_node: NodeNG

        :param name: The name of the local that will be altered by
            the given child node.
        :type name: str or None
        t	   __class__N(   RK   RH   R   (   R=   t
   child_nodeR   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyt   add_local_node   s    
c         C   s   |  j  | d S(   s   The first node the defines the given local.

        :param item: The name of the locally defined object.
        :type item: str

        :raises KeyError: If the name is not defined.
        i    (   R5   (   R=   t   item(    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyR      s    c         C   s   t  |  j    S(   s   Iterate over the names of locals defined in this scoped node.

        :returns: The names of the defined locals.
        :rtype: iterable(str)
        (   t   itert   keys(   R=   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyR
      s    c         C   s   t  |  j j    S(   s   The names of locals defined in this scoped node.

        :returns: The names of the defined locals.
        :rtype: list(str)
        (   t   listR5   RQ   (   R=   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyRQ      s    c         C   s!   g  |  j    D] } |  | ^ q S(   s   The nodes that define the locals in this scoped node.

        :returns: The nodes that define locals.
        :rtype: list(NodeNG)
        (   RQ   (   R=   t   key(    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyt   values   s    c         C   s   t  t |  j   |  j     S(   s   Get the names of the locals and the node that defines the local.

        :returns: The names of locals and their asociated node.
        :rtype: list(tuple(str, NodeNG))
        (   RR   t   zipRQ   RT   (   R=   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyt   items   s    c         C   s   | |  j  k S(   s   Check if a local is defined in this scope.

        :param name: The name of the local to check for.
        :type name: str

        :returns: True if this node has a local of the given name,
            False otherwise.
        :rtype: bool
        (   R5   (   R=   R   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyt   __contains__   s    
N(   t   __name__t
   __module__t   __doc__R5   R   R<   R>   RE   RH   t   __setitem__RK   R   RN   R   R
   RQ   RT   RV   RW   (    (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyR:   n   s    							
				t   Modulec           B   sy  e  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   Z d d d d d h Z d( Z d) Z d' d' d' d' e d  Z d' d  Z d   Z d   Z d   Z d d  Z d   Z d   Z d' e d  Z d' d  Z  d   Z! d   Z" d   Z# d   Z$ e% j& r5e' j( d    Z) n e Z) d    Z* e d' d!  Z+ d"   Z, d#   Z- d$   Z. d%   Z/ RS(*   s   Class representing an :class:`ast.Module` node.

    >>> node = astroid.extract_node('import astroid')
    >>> node
    <Import l.1 at 0x7f23b2e4e5c0>
    >>> node.parent
    <Module l.0 at 0x7f23b2e4eda0>
    RI   i    RX   RZ   t   __file__t   __path__t   __package__R   t   doct   filet   patht   packaget   pure_pythont   future_importsR5   t   globalsc         C   sh   | |  _  | |  _ | |  _ | |  _ | |  _ | |  _ | |  _ i  |  _ |  _ g  |  _	 t
   |  _ d S(   su  
        :param name: The name of the module.
        :type name: str

        :param doc: The module docstring.
        :type doc: str

        :param file: The path to the file that this ast has been extracted from.
        :type file: str or None

        :param path:
        :type path: str or None

        :param package: Whether the node represents a package or a module.
        :type package: bool or None

        :param parent: The parent node in the syntax tree.
        :type parent: NodeNG or None

        :param pure_python: Whether the ast was built from source.
        :type pure_python: bool or None
        N(   R   R`   Ra   Rb   Rc   R;   Rd   R5   Rf   RI   R   Re   (   R=   R   R`   Ra   Rb   Rc   R;   Rd   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyt   __init__f  s    								c         C   s   | |  _  d S(   s   Do some setup after initialisation.

        :param body: The contents of the module.
        :type body: list(NodeNG) or None
        N(   RI   (   R=   RI   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyt   postinit  s    c         C   sH   |  j  d  k	 r t j |  j   S|  j d  k	 rD t |  j d  } | Sd  S(   Nt   rb(   t
   file_bytesR   t   iot   BytesIORa   t   open(   R=   t   stream(    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyt   _get_stream  s    c         C   s
   |  j    S(   s~   Get a stream to the underlying file or bytes.

        .. deprecated:: 1.5

        :type: file or io.BytesIO or None
        (   Ro   (   R=   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyRn     s    c         C   s   |  j  |  j f S(   s   Get a range from where this node starts to where this node ends.

        :param lineno: Unused.
        :type lineno: int

        :returns: The range of line numbers that this node belongs to.
        :rtype: tuple(int, int)
        (   t
   fromlinenot   tolineno(   R=   R   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyt   block_range  s    	c         C   si   | |  j  k rV | |  j k rV y |  |  j |  f SWqV t j k
 rR |  d f SXn  |  j | | |  S(   st  Lookup where the given variable is assigned.

        :param node: The node to look for assignments up to.
            Any assignments after the given node are ignored.
        :type node: NodeNG

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

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

        :returns: This 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))
        (    (   t   scope_attrsR5   t   getattrR   t   AttributeInferenceErrorRE   (   R=   R"   R   RC   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyRB     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.module(   t   BUILTINS(   R=   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyt   pytype  s    c         C   s   d S(   sj   A human readable type of this node.

        :returns: The type of this node.
        :rtype: str
        R\   (    (   R=   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyt   display_type  s    c         C   s(  g  } | |  j  k } | |  j k rJ | rJ | rJ |  j j |  g } n | rg | rg |  j  | } nj |  j r y |  j | d t g } Wq t j t f k
 r t	 j
 t j d |  d | d |   q Xn  g  | D] } t | t j  s | ^ q } | r| St j d |  d | d |   d  S(   Nt   relative_onlyt   targett	   attributeR   (   R5   t   special_attributest   lookupRc   t   import_moduleR   R   t   AstroidBuildingErrort   SyntaxErrorR	   t   reraiseRu   R'   R   t   DelName(   R=   R   R   t   ignore_localsR   t   name_in_localsR,   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyRt     s$    	+c      	   C   s   t  j |  } | | _ y& t j |  j | |  | d |  SWnA t j k
 r } t j	 t j
 | j d |  d | d |  n Xd S(   s   Infer the possible values of the given variable.

        :param name: The name of the variable to infer.
        :type name: str

        :returns: The inferred possible values.
        :rtype: iterable(NodeNG) or None
        R<   Rz   R{   R   N(   t
   contextmodt   copy_contextt
   lookupnameR    t   _infer_stmtsRt   R   Ru   R	   R   t   InferenceErrorR   (   R=   R   R   t   error(    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyt   igetattr  s    	c         C   s   |  j  d k	 o |  j  j d  S(   s   Check if this module has been build from a .py file.

        If so, the module contains a complete representation,
        including the code.

        :returns: True if the module has been built from a .py file.
        :rtype: bool
        s   .pyN(   Ra   R   t   endswith(   R=   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyt   fully_defined  s    	c         C   s   |  S(   s   The first parent node, including self, marked as statement node.

        :returns: The first parent statement.
        :rtype: NodeNG
        (    (   R=   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyt	   statement  s    c         C   s   d S(   s   The previous sibling statement.

        :returns: The previous sibling statement node.
        :rtype: NodeNG or None
        N(    (   R=   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyt   previous_sibling  s    c         C   s   d S(   s|   The next sibling statement node.

        :returns: The next sibling statement node.
        :rtype: NodeNG or None
        N(    (   R=   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyt   next_sibling#  s    c         C   sI   xB |  j  j d d  D]+ } t | t j  r | j d k r t Sq Wt S(   Nt   absolute_importt
   __future__(    (   R5   t   getR'   R   t
   ImportFromt   modnameR   t   False(   R=   RG   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyt   _absolute_import_activated,  s    !c         C   s   |  j  S(   s   Whether :pep:`328` absolute import behaviour has been enabled.

        :returns: True if :pep:`328` has been enabled, False otherwise.
        :rtype: bool
        (   R   (   R=   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyt   absolute_import_activated5  s    c         C   sn   | r | d k r d } n  |  j | |  } y t j |  SWn  t j k
 r` | ra   qa n Xt j |  S(   s  Get the ast for a given module as if imported from this module.

        :param modname: The name of the module to "import".
        :type modname: str

        :param relative_only: Whether to only consider relative imports.
        :type relative_only: bool

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

        :returns: The imported module ast.
        :rtype: NodeNG
        i    N(   R   t   relative_to_absolute_nameR0   t   ast_from_module_nameR   R   (   R=   R   Ry   t   levelt
   absmodname(    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyR~   =  s    	
c         C   s   |  j    r | d k r | S| r |  j r8 | d } n  | rt |  j j d  | k  rt t j d | d |  j   n  |  j j d |  d } n. |  j r |  j } n |  j j d d  d } | r | s | Sd | | f S| S(   s  Get the absolute module name for a relative import.

        The relative import can be implicit or explicit.

        :param modname: The module name to convert.
        :type modname: str

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

        :returns: The absolute module name.
        :rtype: str

        :raises TooManyLevelsError: When the relative import refers to a
            module too far above this one.
        i   t   .R   R   i    s   %s.%sN(   R   R   Rc   R   t   countR   t   TooManyLevelsErrort   rsplit(   R=   R   R   t   package_name(    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyR   Y  s"    			c   	      C   sr  g  |  j    D] } | j d  s | ^ q } y |  d } Wn t k
 rP | SXy t | j    } Wn& t j k
 r~ | St k
 r | SXg  } y t | j    } Wn t j k
 r | SXt	 | t
 j t
 j f  s | Sd   } x | j D]t } | |  r| j | j  q y t | j    } Wn t j k
 rJq n X| |  r | j | j  q q W| S(   s  The list of imported names when this module is 'wildcard imported'.

        It doesn't include the '__builtins__' name which is added by the
        current CPython implementation of wildcard imports.

        :returns: The list of imported names.
        :rtype: list(str)
        t   _t   __all__c         S   s%   t  |  t j  o$ t  |  j t j  S(   N(   R'   R   t   Constt   valueR2   t   string_types(   R"   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyt   <lambda>  s   (   RQ   t
   startswithR6   t   nextt   assigned_stmtsR   R   t   AttributeErrort   inferR'   R   t   Tuplet   Listt   eltsR   R   (	   R=   R   t   defaultt
   all_valuest   explicitt   inferredt	   str_constR"   t   inferred_node(    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyt   wildcard_import_names  s:    .	c         C   s,   g  |  j    D] } | j d  s | ^ q S(   s   The list of the names that are publicly available in this module.

        :returns: The list of publc names.
        :rtype: list(str)
        R   (   RQ   R   (   R=   R   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyt   public_names  s    c         C   s   t  S(   s   Determine the boolean value of this node.

        :returns: The boolean value of this node.
            For a :class:`Module` this is always ``True``.
        :rtype: bool
        (   R   (   R=   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyt
   bool_value  s    (   RI   N(   R   R`   Ra   Rb   Rc   Rd   Re   (   R5   Rf   (0   RX   RY   RZ   t   _astroid_fieldsRp   R   R   Ra   Rj   t   file_encodingR   Rd   Rc   Rf   Re   R   t   ModuleModelR|   Rs   t   _other_fieldst   _other_other_fieldsR   Rg   Rh   Ro   Rn   Rr   RB   Rw   Rx   R   Rt   R   R   R   R   R   R2   t   PY2t   decorators_modt   cachedpropertyR   R   R~   R   R   R   R   (    (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyR\     sR    	+													)	1	t   ComprehensionScopec           B   s    e  Z d  Z d   Z e j Z RS(   s.   Scoping for different types of comprehensions.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;   R<   (   R=   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyR<     s    	(   RX   RY   RZ   R<   R:   RE   RB   (    (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyR     s   	t   GeneratorExpc           B   sP   e  Z d  Z d Z d Z d	 Z d	 Z d	 d	 d	 d  Z d	 d	 d  Z	 d   Z
 RS(
   s   Class representing an :class:`ast.GeneratorExp` node.

    >>> node = astroid.extract_node('(thing for thing in things if thing)')
    >>> node
    <GeneratorExp l.1 at 0x7f23b2e4e400>
    t   eltt
   generatorsR5   c         C   s)   i  |  _  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(   R5   t   superR   Rg   (   R=   R   t
   col_offsetR;   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyRg     s    	c         C   s.   | |  _  | d k r! g  |  _ n	 | |  _ d S(   s  Do some setup after initialisation.

        :param elt: The element that forms the output of the expression.
        :type elt: NodeNG or None

        :param generators: The generators that are looped through.
        :type generators: list(Comprehension) or None
        N(   R   R   R   (   R=   R   R   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyRh     s    		c         C   s   t  S(   s   Determine the boolean value of this node.

        :returns: The boolean value of this node.
            For a :class:`GeneratorExp` this is always ``True``.
        :rtype: bool
        (   R   (   R=   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyR     s    (   R   R   (   R5   N(   RX   RY   RZ   R   R   R   R   R   Rg   Rh   R   (    (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyR     s   t   DictCompc           B   sY   e  Z d  Z d Z d	 Z d
 Z d
 Z d
 Z d
 d
 d
 d  Z	 d
 d
 d
 d  Z
 d   Z RS(   s   Class representing an :class:`ast.DictComp` node.

    >>> node = astroid.extract_node('{k:v for k, v in things if k > v}')
    >>> node
    <DictComp l.1 at 0x7f23b2e41d68>
    RS   R   R   R5   c         C   s)   i  |  _  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(   R5   R   R   Rg   (   R=   R   R   R;   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyRg   /  s    	c         C   s7   | |  _  | |  _ | d k r* g  |  _ n	 | |  _ d S(   sJ  Do some setup after initialisation.

        :param key: What produces the keys.
        :type key: NodeNG or None

        :param value: What produces the values.
        :type value: NodeNG or None

        :param generators: The generators that are looped through.
        :type generators: list(Comprehension) or None
        N(   RS   R   R   R   (   R=   RS   R   R   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyRh   C  s
    		c         C   s   t  j S(   s   Determine the boolean value of this node.

        :returns: The boolean value of this node.
            For a :class:`DictComp` this is always :class:`Uninferable`.
        :rtype: Uninferable
        (   R	   t   Uninferable(   R=   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyR   V  s    (   RS   R   R   (   R5   N(   RX   RY   RZ   R   R   R   RS   R   R   Rg   Rh   R   (    (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyR     s   t   SetCompc           B   sP   e  Z d  Z d Z d Z d	 Z d	 Z d	 d	 d	 d  Z d	 d	 d  Z	 d   Z
 RS(
   s   Class representing an :class:`ast.SetComp` node.

    >>> node = astroid.extract_node('{thing for thing in things if thing}')
    >>> node
    <SetComp l.1 at 0x7f23b2e41898>
    R   R   R5   c         C   s)   i  |  _  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(   R5   R   R   Rg   (   R=   R   R   R;   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyRg   t  s    	c         C   s.   | |  _  | d k r! g  |  _ n	 | |  _ d S(   s  Do some setup after initialisation.

        :param elt: The element that forms the output of the expression.
        :type elt: NodeNG or None

        :param generators: The generators that are looped through.
        :type generators: list(Comprehension) or None
        N(   R   R   R   (   R=   R   R   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyRh     s    		c         C   s   t  j S(   s   Determine the boolean value of this node.

        :returns: The boolean value of this node.
            For a :class:`SetComp` this is always :class:`Uninferable`.
        :rtype: Uninferable
        (   R	   R   (   R=   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyR     s    (   R   R   (   R5   N(   RX   RY   RZ   R   R   R   R   R   Rg   Rh   R   (    (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyR   `  s   t	   _ListCompc           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.ListComp` node.

    >>> node = astroid.extract_node('[thing for thing in things if thing]')
    >>> node
    <ListComp l.1 at 0x7f23b2e418d0>
    R   R   c         C   s   | |  _  | |  _ d S(   s  Do some setup after initialisation.

        :param elt: The element that forms the output of the expression.
        :type elt: NodeNG or None

        :param generators: The generators that are looped through.
        :type generators: list(Comprehension) or None
        N(   R   R   (   R=   R   R   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyRh     s    		c         C   s   t  j S(   s   Determine the boolean value of this node.

        :returns: The boolean value of this node.
            For a :class:`ListComp` this is always :class:`Uninferable`.
        :rtype: Uninferable
        (   R	   R   (   R=   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyR     s    (   R   R   N(	   RX   RY   RZ   R   R   R   R   Rh   R   (    (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyR     s   t   ListCompc           B   s&   e  Z d  Z d Z d d d d  Z RS(   s   Class representing an :class:`ast.ListComp` node.

        >>> node = astroid.extract_node('[thing for thing in things if thing]')
        >>> node
        <ListComp l.1 at 0x7f23b2e418d0>
        R5   c         C   s)   i  |  _  t t |   j | | |  d  S(   N(   R5   R   R   Rg   (   R=   R   R   R;   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyRg     s    	(   R5   N(   RX   RY   RZ   R   R   Rg   (    (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyR     s   c           B   s   e  Z d  Z RS(   s   Class representing an :class:`ast.ListComp` node.

        >>> node = astroid.extract_node('[thing for thing in things if thing]')
        >>> node
        <ListComp l.1 at 0x7f23b2e418d0>
        (   RX   RY   RZ   (    (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyR     s   c         C   s   t  |  t  s d S|  j s  d Sy t |  j |  j   } Wn t t j f k
 rY d SXt  | t	 j
  rx | j } n  t  | t  r | j d t  r d S| j d t  r d Sn  d S(   s_   Detect decorator call chaining and see if the end result is a
    static or a classmethod.
    s   %s.classmethodR%   s   %s.staticmethodR&   N(   R'   R(   R   R;   R   t   infer_call_resultt   StopIterationR   R   R    t   Instancet   _proxiedt   ClassDeft   is_subtype_ofRv   (   R"   R   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyt   _infer_decorator_callchain  s     	t   Lambdac           B   s   e  Z d  Z d Z d Z d Z e d    Z d d d d  Z	 d   Z
 d   Z d	   Z d
   Z d   Z d d  Z d d  Z d   Z RS(   s   Class representing an :class:`ast.Lambda` node.

    >>> node = astroid.extract_node('lambda arg: arg + 1')
    >>> node
    <Lambda.<lambda> l.1 at 0x7f23b2e41518>
    t   argsRI   R5   s   <lambda>c         C   sH   |  j  j  rD |  j  j  d j d k rD t |  j j   t  rD d Sn  d S(   s   Whether this is a method or function.

        :returns: 'method' if this is a method, 'function' otherwise.
        :rtype: str
        i    R=   t   methodt   function(   R   R   R'   R;   R>   R   (   R=   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyR)     s    %c         C   s;   i  |  _  g  |  _ 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(   R5   R   RI   R   R   Rg   (   R=   R   R   R;   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyRg     s    			c         C   s   | |  _  | |  _ d S(   s   Do some setup after initialisation.

        :param args: The arguments that the function takes.
        :type args: Arguments

        :param body: The contents of the function body.
        :type body: list(NodeNG)
        N(   R   RI   (   R=   R   RI   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyRh   8  s    		c         C   s   d |  j  k r d t Sd t S(   sy   Get the name of the type that this node represents.

        :returns: The name of the type.
        :rtype: str
        R   s   %s.instancemethods   %s.function(   R)   Rv   (   R=   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyRw   D  s    c         C   s   d |  j  k r d Sd S(   sj   A human readable type of this node.

        :returns: The type of this node.
        :rtype: str
        R   t   Methodt   Function(   R)   (   R=   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyRx   N  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.
            For a :class:`Lambda` this is always ``True``.
        :rtype: bool
        (   R   (   R=   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyt   callableX  s    c         C   so   |  j  j  r! t |  j  j   } n g  } |  j  j rI | j |  j  j  n  |  j  j rk | j |  j  j  n  | S(   sy   Get the names of each of the arguments.

        :returns: The names of the arguments.
        :rtype: list(str)
        (   R   t   _rec_get_namest   varargR   t   kwarg(   R=   R#   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyt   argnamesb  s    
c         C   s   |  j  j |  S(   sq   Infer what the function returns when called.

        :param caller: Unused
        :type caller: object
        (   RI   R   (   R=   t   callerR   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyR   v  s    
i    c         C   sU   | |  j  j k s$ | |  j  j k r< |  j j   } d } n |  } | j | | |  S(   sa  Lookup where the given names is assigned.

        :param node: The node to look for assignments up to.
            Any assignments after the given node are ignored.
        :type node: NodeNG

        :param name: The name to find assignments for.
        :type name: str

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

        :returns: This 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))
        i(   R   t   defaultst   kw_defaultsR;   R<   RE   (   R=   R"   R   RC   R<   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyRB     s
    $	c         C   s   t  S(   s   Determine the boolean value of this node.

        :returns: The boolean value of this node.
            For a :class:`Lambda` this is always ``True``.
        :rtype: bool
        (   R   (   R=   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyR     s    (   R   RI   (   R5   N(   RX   RY   RZ   R   R   R   t   propertyR)   R   Rg   Rh   Rw   Rx   R   R   R   RB   R   (    (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyR     s    		
	
	
	 R(   c           B   s4  e  Z d  Z e j r$ d Z d Z n d Z d Z e	 j
   Z e Z d Z d Z d Z d d d d d d	  Z d d d
  Z e j d    Z e j d    Z e j d    Z e j d    Z d   Z d d  Z d d  Z d   Z e j d    Z d   Z e d  Z  d   Z! d d  Z" d   Z# RS(   s   Class representing an :class:`ast.FunctionDef`.

    >>> node = astroid.extract_node('''
    ... def my_func(arg):
    ...     return arg + 1
    ... ''')
    >>> node
    <FunctionDef.my_func l.2 at 0x7f23b2e71e10>
    R   R   t   returnsRI   R   R`   R5   t   _typec         C   s`   | |  _  | |  _ i  |  _ t t |   j | | |  | r\ | j   } | j | |   n  d S(   s  
        :param name: The name of the function.
        :type name: str or None

        :param doc: The function's docstring.
        :type doc: 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`   t   instance_attrsR   R(   Rg   R<   RH   (   R=   R   R`   R   R   R;   R<   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyRg     s    			c         C   se   | |  _  | |  _ | |  _ | |  _ t j ra t |  j j   t	  ra |  j
 d |  j j    n  d S(   sz  Do some setup after initialisation.

        :param args: The arguments that the function takes.
        :type args: Arguments or list

        :param body: The contents of the function body.
        :type body: list(NodeNG)

        :param decorators: The decorators that are applied to this
            method or function.
        :type decorators: Decorators or None
        RL   N(   R   RI   R   R   R2   t   PY3R'   R;   R<   R   RH   (   R=   R   RI   R   R   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyRh     s    				!c         C   s  |  j  j   } t | t  s" g  Sg  } x | j t j  D] } t | j t j  r; t | j j	 t j
  r; x | j D] } t | t j  s qx n  | j |  j k r qx n  y | |  j } Wn t k
 r qx qx Xt | t  rx | j   | k rx | j | j  qx qx Wq; q; W| S(   s2  The extra decorators that this function can have.

        Additional decorators are considered when they are used as
        assignments, as in ``method = staticmethod(method)``.
        The property will return all the callables that are used for
        decoration.

        :type: list(NodeNG)
        (   R;   R<   R'   R   t   nodes_of_classR   t   AssignR   t   Callt   funct   Namet   targetst
   AssignNameR   R6   R(   R   (   R=   R<   R   t   assignt   assign_nodet   meth(    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyt   extra_decorators  s(    c   
      C   s  d d h } x- |  j  D]" } | j j | k r | j j Sq W|  j j   } d } t | t  r |  j d k rs d St j d k r |  j d k r d Sd } n  |  j	 s | Sx`|  j	 j
 D]R} t | t j  r | j | k r | j Sn  t | t j  rMy t | j j    } Wn t j k
 r-q n Xt |  } | d k	 rM| Sn  y x | j   D] } t |  } | d k	 r| St | t  sq]n  xW | j   D]I }	 t |	 t  sqn  |	 j d	 t  rd S|	 j d
 t  rd SqWq]WWq t j k
 r	q Xq W| S(   s   The function type for this node.

        Possible values are: method, function, staticmethod, classmethod.

        :type: str
        R%   R&   R   t   __new__i   i   t   __init_subclass__R   s   %s.classmethods   %s.staticmethod(   i   i   N(   R   R   R   R;   R<   R'   R   t   syst   version_infoR   t   nodesR   R   R   R   R   R   R   R   R   t	   ancestorsR   Rv   (
   R=   t   builtin_descriptorst	   decoratorR<   t	   type_nameR"   t   currentR   R   t   ancestor(    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyR)   4  sV    		
c         C   s?   |  j  } |  j d k	 r; | t d   |  j j D  7} n  | S(   sa   The first line that this node appears on in the source code.

        :type: int or None
        c         s   s#   |  ] } | j  | j d  Vq d S(   i   N(   Rq   R   (   t   .0R"   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pys	   <genexpr>  s   N(   R   R   R   t   sumR   (   R=   R   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyRp   u  s
    	c         C   s
   |  j  j S(   sP   The line on which the beginning of this block ends.

        :type: int
        (   R   Rq   (   R=   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyt   blockstart_tolineno  s    c         C   s   |  j  |  j f S(   s   Get a range from the given line number to where this node ends.

        :param lineno: Unused.
        :type lineno: int

        :returns: The range of line numbers that this node belongs to,
        :rtype: tuple(int, int)
        (   Rp   Rq   (   R=   R   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyRr     s    	c         C   sX   | |  j  k r |  j  | S| |  j k r< |  j j |  g St j d |  d |   d S(   s   this method doesn't look in the instance_attrs dictionary since it's
        done by an Instance proxy at inference time.
        Rz   R{   N(   R   R|   R}   R   Ru   (   R=   R   R   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyRt     s
    c      	   C   sn   y& t  j |  j | |  | d |  SWnA t j k
 ri } t j t j | j d |  d | d |  n Xd S(   sC   Inferred getattr, which returns an iterator of inferred statements.R<   Rz   R{   R   N(	   R    R   Rt   R   Ru   R	   R   R   R   (   R=   R   R   R   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyR     s    c         C   s%   |  j  d k o$ t |  j j   t  S(   s   Check if this function node represents a method.

        :returns: True if this is a method, False otherwise.
        :rtype: bool
        R   (   R)   R'   R;   R<   R   (   R=   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyt	   is_method  s    c         C   s   t    } g  } |  j d k	 r1 | |  j j 7} n  | |  j 7} xV | D]N } y. x' | j   D] } | j | j    q[ WWqE t j	 k
 r qE qE XqE W| S(   s   Get the qualified names of each of the decorators on this function.

        :returns: The names of the decorators.
        :rtype: set(str)
        N(
   R   R   R   R   R   R   t   addR   R   R   (   R=   R   t   decoratornodest   decnodet   infnode(    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyt   decoratornames  s    	c         C   s   |  j  d k S(   s   Check if the function is bound to an instance or class.

        :returns: True if the function is bound to an instance or class,
            False otherwise.
        :rtype: bool
        R%   (   R)   (   R=   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyt   is_bound  s    c         C   s   |  j  ro xc |  j  j D]R } y t | j    } Wn t j k
 rK q n X| r | j   d k r t Sq Wn  xI |  j D]> } t	 | t
 j  r | j   r t Sn  | o t	 | t
 j  SW| r t Sd S(   s  Check if the method is abstract.

        A method is considered abstract if any of the following is true:
        * The only statement is 'raise NotImplementedError'
        * The only statement is 'pass' and pass_is_abstract is True
        * The method is annotated with abc.astractproperty/abc.abstractmethod

        :returns: True if the method is abstract, False otherwise.
        :rtype: bool
        s   abc.abstractpropertys   abc.abstractmethodN(   s   abc.abstractpropertys   abc.abstractmethod(   R   R   R   R   R   R   R   R   RI   R'   R   t   Raiset   raises_not_implementedt   Pass(   R=   t   pass_is_abstractR"   R   RM   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyt   is_abstract  s     		c         C   s4   t  j t  j f } t |  j | d t t f t  S(   s   Check if this is a generator function.

        :returns: True is this is a generator function, False otherwise.
        :rtype: bool
        t
   skip_klass(   R   t   Yieldt	   YieldFromR   R   R(   R   R   (   R=   t   yield_nodes(    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyt   is_generator  s    c         c   s  |  j    r$ t j |   } | Vd S|  j d k rt |  j j  d k r|  j j d k	 rt | j d j	 |   } t
 | t  rt d d  } t | _ |  | _ g  | j d D] } t | j	 |   ^ q } g  | D] } | t j k r | ^ q | _ | | _ | Vd Sn  |  j t j d t }	 xs |	 D]k }
 |
 j d k r]t j d  Vq7y& x |
 j j	 |  D] } | VqsWWq7t j k
 rt j Vq7Xq7Wd S(   s   Infer what the function returns when called.

        :returns: What the function returns.
        :rtype: iterable(NodeNG or Uninferable) or None
        Nt   with_metaclassi   i    t   temporary_classR  (   R  R    t	   GeneratorR   R   R   R   R   R   R   R'   R   R   t   hideR;   R	   R   t
   _metaclassR   R   t   ReturnR(   R   R   R   R   (   R=   R   R   R   t	   metaclasst   ct   bt   class_basest   baseR   t
   returnnodeR   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyR     s4    		/+	c         C   s   t  S(   s   Determine the boolean value of this node.

        :returns: The boolean value of this node.
            For a :class:`FunctionDef` this is always ``True``.
        :rtype: bool
        (   R   (   R=   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyR   !  s    (   R   R   R   RI   N(   R   R   RI   (   R   R`   (   R5   R   ($   RX   RY   RZ   R2   R   R   R   R   R   R   t   FunctionModelR|   R   R@   R   R   R   Rg   Rh   R   R   R   R)   Rp   R   Rr   Rt   R   R   t   cachedR  R  R
  R  R   R   (    (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyR(     s8   				%(A	
		
			
(t   AsyncFunctionDefc           B   s   e  Z d  Z RS(   s  Class representing an :class:`ast.FunctionDef` node.

    A :class:`AsyncFunctionDef` is an asynchronous function
    created 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>
    (   RX   RY   RZ   (    (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyR  +  s   c         C   s_   | d k r g  } n  xC |  D]; } t | t j  rG t | j |  q | j | j  q W| S(   s#   return a list of all argument namesN(   R   R'   R   R   R   R   R   R   (   R   R#   t   arg(    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyR   =  s    	c         C   s  |  j  d k r t S| d k r+ t   } n  x |  j D] } y x | j   D] } | j   } | | k ro qK n | j |  t | t j	  r t
 S| t j k r qK n  | |  k r qK n  t | t  s qK n  | j d k r t St | |  rK t SqK WWq5 t j k
 rq5 q5 Xq5 Wt
 S(   s?    Return if the given class can be
    used as a metaclass.
    R)   R  N(   R   R   R   R   R    R   R   R   R'   R   R   R	   R   R   R   t   _is_metaclassR   R   (   R-   t   seenR  t   baseobjt   baseobj_name(    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyR   I  s4    c         C   s  |  j  d k	 r |  j  St |   r. d |  _  n |  j j d  rL d |  _  n | d k rd t   } n  |  j   } | | k r d |  _  d S| j |  xd |  j d t	  D]P } t
 | |  } | d k r | d k r t |   r q n  | j |  _  Pq q W|  j  d k rd |  _  n  |  j  S(   s]   return a ClassDef node type to differ metaclass and exception
    from 'regular' classes
    R  t	   Exceptiont	   exceptiont   classt   recursN(   R   R   R   R   R   R   R   R   R   R   t   _class_typeR)   (   R-   R   t
   klass_nameR  R   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyR(  k  s.    	c         C   sZ   |  j    } xG | d k	 rU t | t  rU | j d k rC d } q | j j    } q W| S(   s   Get the class that wraps the given node.

    We consider that a class wraps a node if the class
    is a parent for the said node.

    :returns: The class that wraps the given node
    :rtype: ClassDef or None
    N(   R<   R   R'   R   R;   (   R"   R-   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyt   get_wrapping_class  s    
	R   c           B   sW  e  Z d  Z d4 Z d5 Z e j   Z d5 Z	 e
 Z e
 Z e e d d Z d6 Z d7 Z d5 Z d5 d5 d5 d5 d5 d	  Z d5 d5 d5 d
  Z d5 d  Z d5 Z e e d d Z e j d    Z d   Z d   Z d   Z d   Z d5 d  Z d   Z d5 d  Z  d d  Z! e d    Z" e# d5 d  Z$ d5 d  Z% d5 d  Z& d   Z' d5 d  Z( d5 d  Z) d   Z* d   Z+ d5 e# d   Z, d!   Z- d"   Z. d5 e# d#  Z/ d5 d$  Z0 d5 d%  Z1 d&   Z2 d'   Z3 d(   Z4 d5 Z5 d)   Z6 d5 d*  Z7 d+   Z8 d,   Z9 d-   Z: d.   Z; e j< d/    Z= d5 d0  Z> d5 d1  Z? d5 d2  Z@ d3   ZA RS(8   s   Class representing an :class:`ast.ClassDef` node.

    >>> node = astroid.extract_node('''
    class Thing:
        def my_meth(self, arg):
            return arg + self.offset
    ''')
    >>> node
    <ClassDef.Thing l.2 at 0x7f23b2e9e748>
    R   R    RI   R`   s\   The class type for this node.

Possible values are: class, metaclass, exception.

:type: strR   R5   t	   _newstylec         C   s   i  |  _  i  |  _ g  |  _ g  |  _ g  |  _ | |  _ | |  _ t t |   j	 | | |  | d k	 r | j   j | |   n  d S(   s  
        :param name: The name of the class.
        :type name: str or None

        :param doc: The function's docstring.
        :type doc: 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   R5   t   keywordsR    RI   R   R`   R   R   Rg   R   R<   RH   (   R=   R   R`   R   R   R;   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyRg     s    							c         C   sX   | |  _  | |  _ | |  _ | |  _ | d k	 r< | |  _ n  | d k	 rT | |  _ n  d S(   s  Do some setup after initialisation.

        :param bases: What the class inherits from.
        :type bases: list(NodeNG)

        :param body: The contents of the class body.
        :type body: list(NodeNG)

        :param decorators: The decorators that are applied to this class.
        :type decorators: Decorators or None

        :param newstyle: Whether this is a new style class or not.
        :type newstyle: bool or None

        :param metaclass: The metaclass of this class.
        :type metaclass: NodeNG or None

        :param keywords: The keywords given to the class definition.
        :type keywords: list(Keyword) or None
        N(   R,  R    RI   R   R   R+  R  (   R=   R    RI   R   t   newstyleR  R,  (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyRh   	  s    				c         C   s   | d  k r t j   } n  |  j d  k	 r1 |  j Sx< |  j d t d |  D]" } | j |  rJ t |  _ PqJ qJ W|  j   } | d  k	 r t	 | t
  r | j |  |  _ n  |  j d  k r t |  _ n  |  j S(   NR'  R   (   R   R   t   InferenceContextR+  R   R   t   _newstyle_implR   t   declared_metaclassR'   R   (   R=   R   R  R-   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyR/  '  s    	s=   Whether this is a new style class or not

:type: bool or Nonec         C   s   |  j  r |  j  d j S|  j S(   sP   The line on which the beginning of this block ends.

        :type: int
        i(   R    Rq   Rp   (   R=   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyR   >  s    	c         C   s   |  j  |  j f S(   s   Get a range from the given line number to where this node ends.

        :param lineno: Unused.
        :type lineno: int

        :returns: The range of line numbers that this node belongs to,
        :rtype: tuple(int, int)
        (   Rp   Rq   (   R=   R   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyRr   I  s    	c         C   s   |  j  r d t Sd t S(   sy   Get the name of the type that this node represents.

        :returns: The name of the type.
        :rtype: str
        s   %s.types   %s.classobj(   R-  Rv   (   R=   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyRw   T  s    	c         C   s   d S(   sj   A human readable type of this node.

        :returns: The type of this node.
        :rtype: str
        t   Class(    (   R=   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyRx   ^  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.
            For a :class:`ClassDef` this is always ``True``.
        :rtype: bool
        (   R   (   R=   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyR   f  s    c         C   sM   |  j    | k r t Sx0 |  j d |  D] } | j    | k r) t Sq) Wt S(   s  Whether this class is a subtype of the given type.

        :param type_name: The name of the type of check against.
        :type type_name: str

        :returns: True if this class is a subtype of the given type,
            False otherwise.
        :rtype: bool
        R   (   R   R   R   R   (   R=   R   R   t   anc(    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyR   p  s    
c   
      C   st  t  | j d j |   } t | t j  rO t | j t j  rO | j } n t	 j
 St | d   } t  | j d j |   } t | t j t j f  r | j   | _ n t	 j
 Sy  t  | j d j |   } Wn t j k
 r d  } n X| rdt | t j  rdxW | j D]I \ } }	 t | t j  rt | j t j  r|	 g | j | j <qqWn  | j | _ | S(   Ni    i   i   (   R   R   R   R'   R   R   R   R2   R   R	   R   R   R   R   R   t   iteredR    R   R   t   DictRV   R5   R;   (
   R=   R   R   t	   name_nodeR   R   R  t   memberst   attrR   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyt   _infer_type_call  s*     
c         c   sZ   |  j  d t f |  rH t | j  d k rH |  j | |  } | Vn t j |   Vd S(   s+   infer what a class is returning when calleds   %s.typei   N(   R   Rv   R   R   R8  R    R   (   R=   R   R   R   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyR     s
    i    c            s   t    j t j  o. | t j t j j j	 k } t
   f d   |  j D  sV | rn |  j j   } d } n |  } | j   | |  S(   s`  Lookup where the given name is assigned.

        :param node: The node to look for assignments up to.
            Any assignments after the given node are ignored.
        :type node: NodeNG

        :param name: The name to find assignments for.
        :type name: str

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

        :returns: This 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))
        c         3   s*   |  ]  }   | k p! | j     Vq d  S(   N(   t	   parent_of(   R   R  (   R"   (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pys	   <genexpr>  s   i(   R'   R;   R   t
   DecoratorsR0   t   astroid_cacheR2   R3   R4   RX   t   anyR    R<   RE   (   R=   R"   R   RC   t   lookup_upper_frameR<   (    (   R"   s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyRB     s    	c         C   s    g  |  j  D] } | j   ^ q
 S(   s   The names of the parent classes

        Names are given in the order they appear in the class definition.

        :type: list(str)
        (   R    t	   as_string(   R=   t   bnode(    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyt	   basenames  s    c         c   s  t  |  g  } | d k r* t j   } n  t j ri |  j ri |  j   d k ri t d  d d Vd Sn  x|  j D]} | j	    y x | j
 |  D] } t | t  s t | t j  r | j } q q n  | j s| | k r q n  | j |  | Vn  | r xW | j d t d |  D]: } | |  k r7Pn  | | k rIq!n  | j |  | Vq!Wq q WWn t j k
 rws n XWd QXqs Wd S(   s   Iterate over the base classes in prefixed depth first order.

        :param recurs: Whether to recurse or return direct ancestors only.
        :type recurs: bool

        :returns: The base classes
        :rtype: iterable(NodeNG)
        s   builtins.objectt   objecti   i    NR'  R   (   R   R   R   R.  R2   R   R    R   R9   t   restore_pathR   R'   R   R   R   R  R   R   R   R   R   (   R=   R'  R   t   yieldedRG   R"  t   grandpa(    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyR     s>    		c         c   s   |  j  rk t d   |  j |  D  rk y |  j |  d } Wq} t j k
 rg |  j d |  } q} Xn |  j d |  } x" | D] } | | k r | Vq q Wd S(   s   Iterate over the parents that define the given name.

        :param name: The name to find definitions for.
        :type name: str

        :returns: The parents that define the given name.
        :rtype: iterable(NodeNG)
        c         s   s   |  ] } | j  Vq d  S(   N(   R-  (   R   R,   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pys	   <genexpr>  s    i   R   N(   R-  t   allR   t   mroR   t   MroError(   R=   R   R   R   t   astroid(    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyt   local_attr_ancestors  s    	(c         c   s8   x1 |  j  d |  D] } | | j k r | Vq q Wd S(   s  Iterate over the parents that define the given name as an attribute.

        :param name: The name to find definitions for.
        :type name: str

        :returns: The parents that define the given name as
            an instance attribute.
        :rtype: iterable(NodeNG)
        R   N(   R   R   (   R=   R   R   RH  (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyt   instance_attr_ancestors.  s    
c         C   s   | |  j  k S(   s   Whether this class directly inherits from the given node.

        :param node: The node to check for.
        :type node: NodeNG

        :returns: True if this class directly inherits from the given node.
        :rtype: bool
        (   R    (   R=   R"   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyt   has_base<  s    	c         C   s   g  } | |  j  k r% |  j  | } n1 t |  j | |  d  } | rV | j  | } n  g  | D] } t | t j  s] | ^ q] } | r | St j d |  d | d |   d S(   sh  Get the list of assign nodes associated to the given name.

        Assignments are looked for in both this class and in parents.

        :returns: The list of assignments to the given name.
        :rtype: list(NodeNG)

        :raises AttributeInferenceError: If no attribute with this name
            can be found in this class or parent classes.
        Rz   R{   R   N(    (   R5   R   RI  R'   R   t   DelAttrR   Ru   (   R=   R   R   R   t
   class_nodeR,   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyt
   local_attrG  s    +c         C   s   t  |  j j | g    } x+ |  j | |  D] } | | j | 7} q. Wg  | D] } t | t j  sP | ^ qP } | r~ | St j d |  d | d |   d S(   sk  Get the list of nodes associated to the given attribute name.

        Assignments are looked for in both this class and in parents.

        :returns: The list of assignments to the given name.
        :rtype: list(NodeNG)

        :raises AttributeInferenceError: If no attribute with this name
            can be found in this class or parent classes.
        Rz   R{   R   N(	   RR   R   R   RJ  R'   R   RL  R   Ru   (   R=   R   R   RT   RM  R,   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyt   instance_attr_  s    +c         C   s   t  j |   S(   s   Get an :class:`Instance` of the :class:`ClassDef` node.

        :returns: An :class:`Instance` of the :class:`ClassDef` node,
            or self if this is not possible.
        :rtype: Instance or ClassDef
        (   R    R   (   R=   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyt   instantiate_classv  s    c         C   s<   t  j d t |   j t |   j f t d d |  j   S(   s   A deprecated alias for :meth:`instanciate_class`.

        .. deprecated:: 1.5

        :returns: An :class:`Instance` of the :class:`ClassDef` node,
            or self if this is not possible.
        :rtype: Instance or ClassDef
        so   %s.instanciate_class() is deprecated and slated for removal in astroid 2.0, use %s.instantiate_class() instead.t
   stackleveli   (   t   warningst   warnR)   RX   t   PendingDeprecationWarningRP  (   R=   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyt   instanciate_class  s    		c         C   s   |  j  j | g   } | |  j k rc | rc | rc |  j j |  g } | d k r_ | | 7} n  | St |  } x9 |  j d t d |  D] } | | j  j | g   7} q W| r | |  j | |  7} n  | s t j	 d |  d | d |   n  | S(   sF  Get an attribute from this class, using Python's attribute semantic.

        This method doesn't look in the :attr:`instance_attrs` dictionary
        since it is done by an :class:`Instance` proxy at inference time.
        It may return an :class:`Uninferable` object if
        the attribute has not been
        found, but a ``__getattr__`` or ``__getattribute__`` method is defined.
        If ``class_context`` is given, then it is considered that the
        attribute is accessed from a class context,
        e.g. ClassDef.attribute, otherwise it might have been accessed
        from an instance as well. If ``class_context`` is used in that
        case, then a lookup in the implicit metaclass and the explicit
        metaclass will be done.

        :param name: The attribute to look for.
        :type name: str

        :param class_context: Whether the attribute can be accessed statically.
        :type class_context: bool

        :returns: The attribute.
        :rtype: list(NodeNG)

        :raises AttributeInferenceError: If the attribute cannot be inferred.
        t	   __bases__R'  R   Rz   R{   (
   R5   R   R|   R}   RR   R   R   t   _metaclass_lookup_attributeR   Ru   (   R=   R   R   t   class_contextRT   R   t	   classnode(    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyRt     s    c         C   s   t    } |  j   } |  j   } x` | | h D]R } | r. | |  k r. t | t  r. |  j | | |  } | j t  |   q. q. W| S(   sA   Search the given name in the implicit and the explicit metaclass.(   R   t   implicit_metaclassR  R'   R   t   _get_attribute_from_metaclasst   update(   R=   R   R   t   attrst   implicit_metaR  R   t   cls_attributes(    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyRW    s    	!c         c   s  y | j  | d | d t } Wn t j k
 r6 d  SXx t j | | d | D] } t | t  sp | VqP n  t j |  r x | j	 |  |  D] } | Vq WqP n  | j
 d k r t |  p |  } t j | |  VqP | j
 d k r | VqP t j | |   VqP Wd  S(   NR   RX  R<   R%   R&   (   Rt   R   R   Ru   R    R   R'   R(   t   _is_propertyR   R)   R*  R*   (   R=   R   R   R   R]  R7  R   R<   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyR[    s&    	c      	   c   s:  t  j |  } | | _ y |  j | | d | } x t j | | d |  D]w } t | t j  r t | t j	  r y | j
 j d |  Wn t j k
 r | Vq Xt j VqL t | |   VqL WWnk t j k
 r5} | j d  r|  j |  rt j Vq6t j t j | j d |  d | d |  n Xd S(	   s   Infer the possible values of the given variable.

        :param name: The name of the variable to infer.
        :type name: str

        :returns: The inferred possible values.
        :rtype: iterable(NodeNG or Uninferable)
        RX  R<   t   __get__t   __Rz   R{   R   N(   R   R   R   Rt   R    R   R'   R   R   R   R   R   Ru   R	   R   R.   R   t   has_dynamic_getattrR   R   R   (   R=   R   R   RX  R]  R   R   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyR     s$    		c         C   s}   d   } y | |  j  d |  d  SWnO t j k
 rx y$ |  j  d |  d } | |  SWqy t j k
 rt qy Xn Xt S(   sb  Check if the class has a custom __getattr__ or __getattribute__.

        If any such method is found and it is not from
        builtins, nor from an extension module, then the function
        will return True.

        :returns: True if the class has a custom
            __getattr__ or __getattribute__, False otherwise.
        :rtype: bool
        c         S   s+   |  j    } | j t k o* t | d d   S(   NRd   (   RA   R   Rv   Rt   R   (   R"   RA   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyt   _valid_getattr	  s    t   __getattr__i    t   __getattribute__(   Rt   R   Ru   R   (   R=   R   Rd  t   getattribute(    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyRc  	  s    	c         C   s   y t  j |  d  } Wn; t j k
 rS } t j t j d |  d | d |   n X| d } | rs | j   } n t j	   } t j
 d | g  | _ |  | _ t | j |  |   S(   sA  Return the inference of a subscript.

        This is basically looking up the method in the metaclass and calling it.

        :returns: The inferred value of a subscript to this class.
        :rtype: NodeNG

        :raises AstroidTypeError: If this class does not define a
            ``__getitem__`` method.
        R   R"   R   R   i    R   (   R   R}   R   Ru   R	   R   t   AstroidTypeErrort   cloneR   R.  t   CallContextt   callcontextt	   boundnodeR   R   (   R=   t   indexR   t   methodst   excR   t   new_context(    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyt   getitem%	  s    	
	c         c   st   i  } xg t  j t |  f  |  j    D]D } x; | j   D]- } | j | k rV q; n  d | | j <| Vq; Wq( Wd S(   s   Iterate over all of the method defined in this class and its parents.

        :returns: The methods defined on the class.
        :rtype: iterable(FunctionDef)
        N(   t	   itertoolst   chainRP   R   t	   mymethodsR   R   (   R=   t   doneRH  R   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyRn  G	  s    (c         c   s2   x+ |  j    D] } t | t  r | Vq q Wd S(   s   Iterate over all of the method defined in this class only.

        :returns: The methods defined on the class.
        :rtype: iterable(FunctionDef)
        N(   RT   R'   R(   (   R=   t   member(    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyRt  U	  s    c         C   s   |  j  r t d  d d Sd S(   s<  Get the implicit metaclass of the current class.

        For newstyle classes, this will return an instance of builtins.type.
        For oldstyle classes, it will simply return None, since there's
        no implicit metaclass there.

        :returns: The metaclass.
        :rtype: builtins.type or None
        R)   i   i    N(   R-  R9   R   (   R=   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyRZ  _	  s    
	c         C   s  xt |  j  D]i } yL xE | j   D]7 } t | t  r  | j r  | j |  _ t |  _ Pq  q  WWq
 t j	 k
 rr q
 Xq
 W|  j r y! t
 d   |  j j   D  SWq t j	 t f k
 r d SXn  t j r d Sd |  j k r |  j d d } nu |  j  r d Sd |  j   j k rcg  |  j   j d D] } | j |  j k  r(| ^ q(} | sVd S| d } n d Sy t
 | j    } Wn t j	 k
 rd SX| t j k rd S| S(   s  Return the explicit declared metaclass for the current class.

        An explicit declared metaclass is defined
        either by passing the ``metaclass`` keyword argument
        in the class definition line (Python 3) or (Python 2) by
        having a ``__metaclass__`` class attribute, or if there are
        no explicit bases but there is a global ``__metaclass__`` variable.

        :returns: The metaclass of this class,
            or None if one could not be found.
        :rtype: NodeNG or None
        c         s   s$   |  ] } | t  j k	 r | Vq d  S(   N(   R	   R   (   R   R"   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pys	   <genexpr>	  s    t   __metaclass__iN(   R    R   R'   R   R  R  R   t   _metaclass_hackR   R   R   R   R   R2   R   R5   RA   R   R	   R   (   R=   R  R"  t
   assignmentt   asst   assignmentsR   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyR0  n	  sD    		!		c         C   s   | d  k r t   } n  | j |   |  j   } | d  k r xE |  j   D]4 } | | k rJ | j |  } | d  k	 r~ Pq~ qJ qJ Wn  | S(   N(   R   R   R   R0  R   t   _find_metaclass(   R=   R!  R-   R;   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyR|  	  s    c         C   s
   |  j    S(   s  Get the metaclass of this class.

        If this class does not define explicitly a metaclass,
        then the first defined metaclass in ancestors will be used
        instead.

        :returns: The metaclass of this class.
        :rtype: NodeNG or None
        (   R|  (   R=   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyR  	  s    
c         C   s   |  j  S(   N(   Rx  (   R=   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyt   has_metaclass_hack	  s    c         c   s  d |  j  k r d Sx|  j d  D]} x= t D]2 } y | j |  PWq0 t j k
 ra q0 q0 Xq0 Wq# t | t j  r | j	 r# | Vq# q# n  t
 | d  s q# n  t | t j  r g  | j D] } | d ^ q } n | j   } | t j k r q# n  | st |   n  x | D] } ys xl | j   D]^ } | t j k rJq/n  t | t j  s/t | j	 t j  ryq/n  | j	 sq/n  | Vq/WWqt j k
 rqqXqWq# Wd S(   s-    Return an iterator with the inferred slots. t	   __slots__NR3  i    (   R5   R   t   ITER_METHODSRt   R   Ru   R'   R   R   R   t   hasattrR4  RV   R3  R	   R   R   R   R2   R   R   (   R=   t   slotsR   RO   RT   R   R   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyt   _islots	  sJ    	#		c         C   s   |  j  s t d   n  |  j   } y t |  } Wn; t k
 rq } | j rm | j d d k rm | j d Sd  SX| g t |  S(   Ns8   The concept of slots is undefined for old-style classes.i    t    (   R  N(   R-  t   NotImplementedErrorR  R   R   R   R   RR   (   R=   R  t   firstRo  (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyt   _slots	  s    	c            sc     f d   }   j  s' t d   n  t |    } t d   | D  sP d St | d d   S(   sY  Get all the slots for this node.

        :returns: The names of slots for this class.
            If the class doesn't define any slot, through the ``__slots__``
            variable, then this function will return a None.
            Also, it will return None in the case the slots were not inferred.
        :rtype: list(str) or None
        c          3   sp   xi   j    d  D]W }  y |  j   } Wn t k
 r= q n X| d  k	 rc x | D] } | VqQ Wq d  Vq Wd  S(   Ni(   RF  R  R  R   (   R   t	   cls_slotst   slot(   R=   (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyt   grouped_slots
  s    s8   The concept of slots is undefined for old-style classes.c         s   s   |  ] } | d  k	 Vq d  S(   N(   R   (   R   R  (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pys	   <genexpr> 
  s    RS   c         S   s   |  j  S(   N(   R   (   RO   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyR   #
  s    N(   R-  R  RR   RE  R   t   sorted(   R=   R  R  (    (   R=   s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyR  
  s    
	c         c   s  | d  k r t j   } n  t j rZ |  j rZ |  j   d k rZ t d  d d Vd  Sn  x |  j D] } y t | j	 d |   } Wn t
 j k
 r qd n Xt | t j  r | j } n  t | t  s qd n  | j s | Vqd x | j D] } | Vq Wqd Wd  S(   Ns   builtins.objectRA  i   i    R   (   R   R   R.  R2   R   R    R   R9   R   R   R   R   R'   R   R   R   R  (   R=   R   RG   R"  R  (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyt   _inferred_bases%
  s&    		c         C   s   t  |  j d |   } g  } x| | D]t } | |  k r= q% n  y# | j d |  } | j |  Wq% t k
 r t  | j d |   } | j |  q% Xq% W|  g g | | g } t | |  |  t | |  |  S(   NR   (   RR   R  t   _compute_mroR   R  R   R$   R   (   R=   R   t   inferred_basest	   bases_mroR  RF  R   t   unmerged_mro(    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyR  J
  s    c         C   s(   |  j  s t d   n  |  j d |  S(   s  Get the method resolution order, using C3 linearization.

        :returns: The list of ancestors, sorted by the mro.
        :rtype: list(NodeNG)

        :raises NotImplementedError: If this is an old style class,
            since they don't have the concept of an MRO.
        s+   Could not obtain mro for old-style classes.R   (   R-  R  R  (   R=   R   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyRF  a
  s    
	c         C   s   t  S(   s   Determine the boolean value of this node.

        :returns: The boolean value of this node.
            For a :class:`ClassDef` this is always ``True``.
        :rtype: bool
        (   R   (   R=   (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyR   q
  s    (   R   R    RI   N(   R   R`   (   R5   R+  (B   RX   RY   RZ   R   R   R   R   t
   ClassModelR|   R   R   Rx  R  R   R(  R)   R   R   R+  Rg   Rh   R/  R-  R   R   R   Rr   Rw   Rx   R   R   R8  R   RB   R@  R   R   RI  RJ  RK  RN  RO  RP  RU  Rt   RW  R[  R   Rc  Rq  Rn  Rt  RZ  R  R0  R|  R  R}  R  R  R  R  R  R  RF  R   (    (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyR     st   			>				
		
	#	1
.				0		#"		
		6			3	!%R1  R   t   GenExpr(:   RZ   R   Rk   Rr  RR  R2   RH  R    R   R   R   R   R   t   astroid.interpreterR   R   R   R   R   R	   R3   R4   RX   Rv   R  R   R$   R.   t   AstroidManagerR0   R9   t   LookupMixInt   NodeNGR:   R\   R   R   R   R   R   R   R   R   t   FilterStmtsMixinR   t	   StatementR(   R  R   R   R   R(  R*  R   t   proxy_aliasR1  R   R  (    (    (    s3   lib/python2.7/site-packages/astroid/scoped_nodes.pyt   <module>   sf   	#						 AJA)			 ""	   