# 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 .. import pytree
from ..pgen2 import token
from .. import fixer_base
from ..fixer_util import Assign, Name, Newline, Number, Subscript, syms
              lambdef< 'lambda' args=vfpdef< '(' inner=any ')' >
                       ':' body=any
              >
              """

    def transform(self, node, results):
        if "lambda" in results:
            return self.transform_lambda(node, results)

        new_lines = []
        suite = results["suite"]
        args = results["args"]
        # This crap is so "def foo(...): x = 5; y = 7" is handled correctly.
        # TODO(cwinter): suite-cleanup
        if suite[0].children[1].type == token.INDENT:
            start = 2
            indent = suite[0].children[1].value
            end = Newline()
        else:
            start = 0
            indent = u"; "
            end = pytree.Leaf(token.INDENT, u"")

        # We need access to self for new_name(), and making this a method
        #  doesn't feel right. Closing over self and new_lines makes the
        #  code below cleaner.
        def handle_tuple(tuple_arg, add_prefix=False):
            n = Name(self.new_name())
            arg = tuple_arg.clone()
            arg.prefix = u""

# 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_tuple_params.py
from .. import pytree
from ..pgen2 import token
from .. import fixer_base
from ..fixer_util import Assign, Name, Newline, Number, Subscript, syms

              lambdef< 'lambda' args=vfpdef< '(' inner=any ')' >
                       ':' body=any
              >
              """

    def transform(self, node, results):
        if "lambda" in results:
            return self.transform_lambda(node, results)

        new_lines = []
        suite = results["suite"]
        args = results["args"]
        # This crap is so "def foo(...): x = 5; y = 7" is handled correctly.
        # TODO(cwinter): suite-cleanup
        if suite[0].children[1].type == token.INDENT:
            start = 2
            indent = suite[0].children[1].value
            end = Newline()
        else:
            start = 0
            indent = u"; "
            end = pytree.Leaf(token.INDENT, u"")

        # We need access to self for new_name(), and making this a method
        #  doesn't feel right. Closing over self and new_lines makes the
        #  code below cleaner.
        def handle_tuple(tuple_arg, add_prefix=False):
            n = Name(self.new_name())
            arg = tuple_arg.clone()
            arg.prefix = u""

            stmt = Assign(arg, n.clone())