# Path: py3kwarn2to3/fixer_base.py
# class BaseFix(object):
# class ConditionalFix(BaseFix):
#     PATTERN = None  # Most subclasses should override with a string literal
#             PC = PatternCompiler()
#     def __init__(self, options, log):
#     def compile_pattern(self):
#     def set_filename(self, filename):
#     def match(self, node):
#     def transform(self, node, results):
#     def new_name(self, template=u"xxx_todo_changeme"):
#     def log_message(self, message):
#     def cannot_convert(self, node, reason=None):
#     def warning(self, node, reason):
#     def start_tree(self, tree, filename):
#     def finish_tree(self, tree, filename):
#     def start_tree(self, *args):
#     def should_skip(self, node):
# 
# Path: py3kwarn2to3/fixer_util.py
# def KeywordArg(keyword, value):
# def LParen():
# def RParen():
# def Assign(target, source):
# def Name(name, prefix=None):
# def Attr(obj, attr):
# def Comma():
# def Dot():
# def ArgList(args, lparen=LParen(), rparen=RParen()):
# def Call(func_name, args=None, prefix=None):
# def Newline():
# def BlankLine():
# def Number(n, prefix=None):
# def Subscript(index_node):
# def String(string, prefix=None):
# def ListComp(xp, fp, it, test=None):
# def FromImport(package_name, name_leafs):
# def is_tuple(node):
# def is_list(node):
# def parenthesize(node):
# def attr_chain(obj, attr):
# def in_special_context(node):
# def is_probably_builtin(node):
# def find_indentation(node):
# def make_suite(node):
# def find_root(node):
# def does_tree_import(package, name, node):
# def is_import(node):
# def touch_import(package, name, node):
#     def is_import_stmt(node):
# def find_binding(name, node, package=None):
# def _find(name, node):
# def _is_import_binding(node, name, package=None):


from py3kwarn2to3 import fixer_base
from py3kwarn2to3.fixer_util import BlankLine, syms, token
                # Just leave the import as is.
                return
            else:
                assert child.type == syms.import_as_name
                name_node = child.children[0]
            member_name = name_node.value
            if member_name in (u'imap', u'izip', u'ifilter'):
                child.value = None
                child.remove()
            elif member_name in (u'ifilterfalse', u'izip_longest'):
                node.changed()
                name_node.value = (u'filterfalse' if member_name[1] == u'f'
                                   else u'zip_longest')

        # Make sure the import statement is still sane
        children = imports.children[:] or [imports]
        remove_comma = True
        for child in children:
            if remove_comma and child.type == token.COMMA:
                child.remove()
            else:
                remove_comma ^= True

        while children and children[-1].type == token.COMMA:
            children.pop().remove()

        # If there are no imports left, just get rid of the entire statement
        if (not (imports.children or getattr(imports, 'value', None)) or
            imports.parent is None):
            p = node.prefix

# Path: py3kwarn2to3/fixer_base.py
# class BaseFix(object):
# class ConditionalFix(BaseFix):
#     PATTERN = None  # Most subclasses should override with a string literal
#             PC = PatternCompiler()
#     def __init__(self, options, log):
#     def compile_pattern(self):
#     def set_filename(self, filename):
#     def match(self, node):
#     def transform(self, node, results):
#     def new_name(self, template=u"xxx_todo_changeme"):
#     def log_message(self, message):
#     def cannot_convert(self, node, reason=None):
#     def warning(self, node, reason):
#     def start_tree(self, tree, filename):
#     def finish_tree(self, tree, filename):
#     def start_tree(self, *args):
#     def should_skip(self, node):
# 
# Path: py3kwarn2to3/fixer_util.py
# def KeywordArg(keyword, value):
# def LParen():
# def RParen():
# def Assign(target, source):
# def Name(name, prefix=None):
# def Attr(obj, attr):
# def Comma():
# def Dot():
# def ArgList(args, lparen=LParen(), rparen=RParen()):
# def Call(func_name, args=None, prefix=None):
# def Newline():
# def BlankLine():
# def Number(n, prefix=None):
# def Subscript(index_node):
# def String(string, prefix=None):
# def ListComp(xp, fp, it, test=None):
# def FromImport(package_name, name_leafs):
# def is_tuple(node):
# def is_list(node):
# def parenthesize(node):
# def attr_chain(obj, attr):
# def in_special_context(node):
# def is_probably_builtin(node):
# def find_indentation(node):
# def make_suite(node):
# def find_root(node):
# def does_tree_import(package, name, node):
# def is_import(node):
# def touch_import(package, name, node):
#     def is_import_stmt(node):
# def find_binding(name, node, package=None):
# def _find(name, node):
# def _is_import_binding(node, name, package=None):


# Path: py3kwarn2to3/fixes/fix_itertools_imports.py
from py3kwarn2to3 import fixer_base
from py3kwarn2to3.fixer_util import BlankLine, syms, token

                # Just leave the import as is.
                return
            else:
                assert child.type == syms.import_as_name
                name_node = child.children[0]
            member_name = name_node.value
            if member_name in (u'imap', u'izip', u'ifilter'):
                child.value = None
                child.remove()
            elif member_name in (u'ifilterfalse', u'izip_longest'):
                node.changed()
                name_node.value = (u'filterfalse' if member_name[1] == u'f'
                                   else u'zip_longest')

        # Make sure the import statement is still sane
        children = imports.children[:] or [imports]
        remove_comma = True
        for child in children:
            if remove_comma and child.type == token.COMMA:
                child.remove()
            else:
                remove_comma ^= True

        while children and children[-1].type == token.COMMA:
            children.pop().remove()

        # If there are no imports left, just get rid of the entire statement
        if (not (imports.children or getattr(imports, 'value', None)) or
            imports.parent is None):
            p = node.prefix

            node = BlankLine()