# Path: pycc/asttools/references.py
# def add_parent_references(node):
# def add_sibling_references(node):
# def copy_location(new_node, old_node):
# def get_top_node(node):
# 
# Path: pycc/asttools/name.py
# NAME_SOURCE = enum.Enum(('DEFINED', 'ADOPTED', 'IMPORTED', 'BUILTIN'))
# def declaration(node, start=None):
# def name_source(node, declared=None):
#     def visit_Name(self, node):
#     def visit_alias(self, node):
#     def visit_FunctionDef(self, node):
#     def visit_Global(self, node):
#     def visit_arguments(self, node):
#     def visit_arg(self, node):
# class NameVisitorMixin(object):
# 
# Path: pycc/asttools/scope.py
# SCOPE_TYPE = enum.Enum(("MODULE", "FUNCTION", "CLASS"))
# def is_scope(node):
# def scope_type(node):
# def parent_scope(node):
# def child_scopes(node):
# 
# Path: pycc/asttools/visitor.py
# class NodeVisitor(object):
# class NodeVisitorIter(NodeVisitor):
# class NodeTransformer(NodeVisitor):
#     def __init__(self, node):
#     def generic_visit(self, node):
#     def visit(self):
#     def visit(self):
#     def __init__(self, *args, **kwargs):
#     def modified(self):
#     def _replace(self, new, old):
#     def visit(self):


import ast
from ..asttools import references as reftools
from ..asttools import name as nametools
from ..asttools import scope as scopetools
from ..asttools import visitor as visitortools
            Name(n)
            for n in super(NameGenerator, self).visit()
        )


class Name(object):

    """Wrapper for an ast.Name node for ease of use."""

    __slots__ = (
        '_node',
        '_scope',
        '_declaration',
        '_declaration_scope',
        '_source',
    )

    def __init__(self, node):
        """Initialize the object with as ast.Name node."""
        if not isinstance(node, ast.Name):

            raise TypeError("Node must be an ast.Name.")

        self._node = node
        self._scope = scopetools.parent_scope(self._node)
        self._declaration = nametools.declaration(self._node)
        self._source = nametools.name_source(self._node, self._declaration)
        self._declaration_scope = None
        if self._source is not nametools.NAME_SOURCE.BUILTIN:


# Path: pycc/asttools/references.py
# def add_parent_references(node):
# def add_sibling_references(node):
# def copy_location(new_node, old_node):
# def get_top_node(node):
# 
# Path: pycc/asttools/name.py
# NAME_SOURCE = enum.Enum(('DEFINED', 'ADOPTED', 'IMPORTED', 'BUILTIN'))
# def declaration(node, start=None):
# def name_source(node, declared=None):
#     def visit_Name(self, node):
#     def visit_alias(self, node):
#     def visit_FunctionDef(self, node):
#     def visit_Global(self, node):
#     def visit_arguments(self, node):
#     def visit_arg(self, node):
# class NameVisitorMixin(object):
# 
# Path: pycc/asttools/scope.py
# SCOPE_TYPE = enum.Enum(("MODULE", "FUNCTION", "CLASS"))
# def is_scope(node):
# def scope_type(node):
# def parent_scope(node):
# def child_scopes(node):
# 
# Path: pycc/asttools/visitor.py
# class NodeVisitor(object):
# class NodeVisitorIter(NodeVisitor):
# class NodeTransformer(NodeVisitor):
#     def __init__(self, node):
#     def generic_visit(self, node):
#     def visit(self):
#     def visit(self):
#     def __init__(self, *args, **kwargs):
#     def modified(self):
#     def _replace(self, new, old):
#     def visit(self):


# Path: pycc/astwrappers/name.py
import ast
from ..asttools import references as reftools
from ..asttools import name as nametools
from ..asttools import scope as scopetools
from ..asttools import visitor as visitortools

            Name(n)
            for n in super(NameGenerator, self).visit()
        )


class Name(object):

    """Wrapper for an ast.Name node for ease of use."""

    __slots__ = (
        '_node',
        '_scope',
        '_declaration',
        '_declaration_scope',
        '_source',
    )

    def __init__(self, node):
        """Initialize the object with as ast.Name node."""
        if not isinstance(node, ast.Name):

            raise TypeError("Node must be an ast.Name.")

        self._node = node
        self._scope = scopetools.parent_scope(self._node)
        self._declaration = nametools.declaration(self._node)
        self._source = nametools.name_source(self._node, self._declaration)
        self._declaration_scope = None
        if self._source is not nametools.NAME_SOURCE.BUILTIN:


            self._declaration_scope = scopetools.parent_scope(