# 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

    """Visitor which produces Name objects."""

    def visit(self):
        """Produce Name objects from a NameVisitorMixin."""
        return (
            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

# 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


    """Visitor which produces Name objects."""

    def visit(self):
        """Produce Name objects from a NameVisitorMixin."""
        return (
            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)