# Path: py3kwarn2to3/refactor.py
# def refactor(self, items, write=False, doctests_only=False):
#     """Refactor a list of files and directories."""
# 
#     for dir_or_file in items:
#         if os.path.isdir(dir_or_file):
#             self.refactor_dir(dir_or_file, write, doctests_only)
#         else:
#             self.refactor_file(dir_or_file, write, doctests_only)
# 
# Path: py3kwarn2to3/pytree.py
# HUGE = 0x7FFFFFFF  # maximum repeat count, default max
# def type_repr(type_num):
#     def __new__(cls, *args, **kwds):
#     def __eq__(self, other):
#     def __ne__(self, other):
#     def _eq(self, other):
#     def clone(self):
#     def post_order(self):
#     def pre_order(self):
#     def set_prefix(self, prefix):
#     def get_prefix(self):
#     def replace(self, new):
#     def get_lineno(self):
#     def changed(self):
#     def remove(self):
#     def next_sibling(self):
#     def prev_sibling(self):
#     def leaves(self):
#     def depth(self):
#     def get_suffix(self):
#         def __str__(self):
#     def __init__(self,type, children,
#                  context=None,
#                  prefix=None,
#                  fixers_applied=None):
#     def __repr__(self):
#     def __unicode__(self):
#     def _eq(self, other):
#     def clone(self):
#     def post_order(self):
#     def pre_order(self):
#     def _prefix_getter(self):
#     def _prefix_setter(self, prefix):
#     def set_child(self, i, child):
#     def insert_child(self, i, child):
#     def append_child(self, child):
#     def __init__(self, type, value,
#                  context=None,
#                  prefix=None,
#                  fixers_applied=[]):
#     def __repr__(self):
#     def __unicode__(self):
#     def _eq(self, other):
#     def clone(self):
#     def leaves(self):
#     def post_order(self):
#     def pre_order(self):
#     def _prefix_getter(self):
#     def _prefix_setter(self, prefix):
# def convert(gr, raw_node):
#     def __new__(cls, *args, **kwds):
#     def __repr__(self):
#     def optimize(self):
#     def match(self, node, results=None):
#     def match_seq(self, nodes, results=None):
#     def generate_matches(self, nodes):
#     def __init__(self, type=None, content=None, name=None):
#     def match(self, node, results=None):
#     def _submatch(self, node, results=None):
#     def __init__(self, type=None, content=None, name=None):
#     def _submatch(self, node, results=None):
#     def __init__(self, content=None, min=0, max=HUGE, name=None):
#     def optimize(self):
#     def match(self, node, results=None):
#     def match_seq(self, nodes, results=None):
#     def generate_matches(self, nodes):
#     def _iterative_matches(self, nodes):
#     def _bare_name_matches(self, nodes):
#     def _recursive_matches(self, nodes, count):
#     def __init__(self, content=None):
#     def match(self, node):
#     def match_seq(self, nodes):
#     def generate_matches(self, nodes):
# def generate_matches(patterns, nodes):
# class Base(object):
# class Node(Base):
# class Leaf(Base):
# class BasePattern(object):
# class LeafPattern(BasePattern):
# class NodePattern(BasePattern):
# class WildcardPattern(BasePattern):
# class NegatedPattern(BasePattern):
# 
# Path: py3kwarn2to3/fixer_util.py
# def find_root(node):
#     """Find the top level namespace."""
#     # Scamper up to the top level namespace
#     while node.type != syms.file_input:
#         assert node.parent, "Tree is insane! root found before "\
#                            "file_input node was found."
#         node = node.parent
#     return node


from itertools import chain
from . import __version__
from py3kwarn2to3 import refactor, pytree
from py3kwarn2to3.fixer_util import find_root
import sys
    import optparse
            import multiprocessing
            True if the tree was modified, False otherwise.

        """
        for fixer in chain(self.pre_order, self.post_order):
            fixer.start_tree(tree, name)

        # use traditional matching for the incompatible fixers
        self.traverse_by(self.bmi_pre_order_heads, tree.pre_order())
        self.traverse_by(self.bmi_post_order_heads, tree.post_order())

        # obtain a set of candidate nodes
        match_set = self.BM.run(tree.leaves())

        while any(match_set.values()):
            for fixer in self.BM.fixers:
                if fixer in match_set and match_set[fixer]:
                    # sort by depth; apply fixers from bottom(of the AST) to
                    # top
                    match_set[fixer].sort(key=pytree.Base.depth, reverse=True)

                    if fixer.keep_line_order:
                        # some fixers(eg fix_imports) must be applied
                        # with the original file's line order
                        match_set[fixer].sort(key=pytree.Base.get_lineno)

                    for node in list(match_set[fixer]):
                        if node in match_set[fixer]:
                            match_set[fixer].remove(node)

                        try:

# Path: py3kwarn2to3/refactor.py
# def refactor(self, items, write=False, doctests_only=False):
#     """Refactor a list of files and directories."""
# 
#     for dir_or_file in items:
#         if os.path.isdir(dir_or_file):
#             self.refactor_dir(dir_or_file, write, doctests_only)
#         else:
#             self.refactor_file(dir_or_file, write, doctests_only)
# 
# Path: py3kwarn2to3/pytree.py
# HUGE = 0x7FFFFFFF  # maximum repeat count, default max
# def type_repr(type_num):
#     def __new__(cls, *args, **kwds):
#     def __eq__(self, other):
#     def __ne__(self, other):
#     def _eq(self, other):
#     def clone(self):
#     def post_order(self):
#     def pre_order(self):
#     def set_prefix(self, prefix):
#     def get_prefix(self):
#     def replace(self, new):
#     def get_lineno(self):
#     def changed(self):
#     def remove(self):
#     def next_sibling(self):
#     def prev_sibling(self):
#     def leaves(self):
#     def depth(self):
#     def get_suffix(self):
#         def __str__(self):
#     def __init__(self,type, children,
#                  context=None,
#                  prefix=None,
#                  fixers_applied=None):
#     def __repr__(self):
#     def __unicode__(self):
#     def _eq(self, other):
#     def clone(self):
#     def post_order(self):
#     def pre_order(self):
#     def _prefix_getter(self):
#     def _prefix_setter(self, prefix):
#     def set_child(self, i, child):
#     def insert_child(self, i, child):
#     def append_child(self, child):
#     def __init__(self, type, value,
#                  context=None,
#                  prefix=None,
#                  fixers_applied=[]):
#     def __repr__(self):
#     def __unicode__(self):
#     def _eq(self, other):
#     def clone(self):
#     def leaves(self):
#     def post_order(self):
#     def pre_order(self):
#     def _prefix_getter(self):
#     def _prefix_setter(self, prefix):
# def convert(gr, raw_node):
#     def __new__(cls, *args, **kwds):
#     def __repr__(self):
#     def optimize(self):
#     def match(self, node, results=None):
#     def match_seq(self, nodes, results=None):
#     def generate_matches(self, nodes):
#     def __init__(self, type=None, content=None, name=None):
#     def match(self, node, results=None):
#     def _submatch(self, node, results=None):
#     def __init__(self, type=None, content=None, name=None):
#     def _submatch(self, node, results=None):
#     def __init__(self, content=None, min=0, max=HUGE, name=None):
#     def optimize(self):
#     def match(self, node, results=None):
#     def match_seq(self, nodes, results=None):
#     def generate_matches(self, nodes):
#     def _iterative_matches(self, nodes):
#     def _bare_name_matches(self, nodes):
#     def _recursive_matches(self, nodes, count):
#     def __init__(self, content=None):
#     def match(self, node):
#     def match_seq(self, nodes):
#     def generate_matches(self, nodes):
# def generate_matches(patterns, nodes):
# class Base(object):
# class Node(Base):
# class Leaf(Base):
# class BasePattern(object):
# class LeafPattern(BasePattern):
# class NodePattern(BasePattern):
# class WildcardPattern(BasePattern):
# class NegatedPattern(BasePattern):
# 
# Path: py3kwarn2to3/fixer_util.py
# def find_root(node):
#     """Find the top level namespace."""
#     # Scamper up to the top level namespace
#     while node.type != syms.file_input:
#         assert node.parent, "Tree is insane! root found before "\
#                            "file_input node was found."
#         node = node.parent
#     return node


# Path: py3kwarn/main.py
from itertools import chain
from . import __version__
from py3kwarn2to3 import refactor, pytree
from py3kwarn2to3.fixer_util import find_root
import sys
    import optparse
            import multiprocessing

            True if the tree was modified, False otherwise.

        """
        for fixer in chain(self.pre_order, self.post_order):
            fixer.start_tree(tree, name)

        # use traditional matching for the incompatible fixers
        self.traverse_by(self.bmi_pre_order_heads, tree.pre_order())
        self.traverse_by(self.bmi_post_order_heads, tree.post_order())

        # obtain a set of candidate nodes
        match_set = self.BM.run(tree.leaves())

        while any(match_set.values()):
            for fixer in self.BM.fixers:
                if fixer in match_set and match_set[fixer]:
                    # sort by depth; apply fixers from bottom(of the AST) to
                    # top
                    match_set[fixer].sort(key=pytree.Base.depth, reverse=True)

                    if fixer.keep_line_order:
                        # some fixers(eg fix_imports) must be applied
                        # with the original file's line order
                        match_set[fixer].sort(key=pytree.Base.get_lineno)

                    for node in list(match_set[fixer]):
                        if node in match_set[fixer]:
                            match_set[fixer].remove(node)

                        try:

                            find_root(node)