# Path: py3kwarn2to3/pygram.py
# _GRAMMAR_FILE = os.path.join(os.path.dirname(__file__), "Grammar.txt")
# _PATTERN_GRAMMAR_FILE = os.path.join(os.path.dirname(__file__),
#                                      "PatternGrammar.txt")
# class Symbols(object):
#     def __init__(self, grammar):
# 
# 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/tests/support.py
# def parse_string(string):
# def run_all_tests(test_mod=None, tests=None):
# def reformat(string):
# def get_refactorer(fixer_pkg="py3kwarn2to3", fixers=None, options=None):
# def all_project_files():


import os
from itertools import chain
from operator import itemgetter
from py3kwarn2to3 import pygram, fixer_util
from py3kwarn2to3.tests import support
    from ..fixes.fix_imports import MAPPING as modules
    from ..fixes.fix_imports2 import MAPPING as modules
        from ..fixes.fix_imports2 import MAPPING as mapping2
        from ..fixes.fix_imports import MAPPING as mapping1
    from ..fixes.fix_urllib import MAPPING as modules
        from py3kwarn2to3.fixes import fix_import
        from py3kwarn2to3.fixes import fix_import
        self.unchanged(s)

        s = "reduce(a, b=42)"
        self.unchanged(s)

        s = "reduce(a, b, c, d)"
        self.unchanged(s)

        s = "reduce(**c)"
        self.unchanged(s)

        s = "reduce()"
        self.unchanged(s)

class Test_print(FixerTestCase):
    fixer = "print"

    def test_prefix_preservation(self):
        b = """print 1,   1+1,   1+1+1"""
        a = """print(1,   1+1,   1+1+1)"""
        self.check(b, a)

    def test_idempotency(self):
        s = """print()"""
        self.unchanged(s)

        s = """print('')"""
        self.unchanged(s)

    def test_idempotency_print_as_function(self):

# Path: py3kwarn2to3/pygram.py
# _GRAMMAR_FILE = os.path.join(os.path.dirname(__file__), "Grammar.txt")
# _PATTERN_GRAMMAR_FILE = os.path.join(os.path.dirname(__file__),
#                                      "PatternGrammar.txt")
# class Symbols(object):
#     def __init__(self, grammar):
# 
# 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/tests/support.py
# def parse_string(string):
# def run_all_tests(test_mod=None, tests=None):
# def reformat(string):
# def get_refactorer(fixer_pkg="py3kwarn2to3", fixers=None, options=None):
# def all_project_files():


# Path: py3kwarn2to3/tests/test_fixers.py
import os
from itertools import chain
from operator import itemgetter
from py3kwarn2to3 import pygram, fixer_util
from py3kwarn2to3.tests import support
    from ..fixes.fix_imports import MAPPING as modules
    from ..fixes.fix_imports2 import MAPPING as modules
        from ..fixes.fix_imports2 import MAPPING as mapping2
        from ..fixes.fix_imports import MAPPING as mapping1
    from ..fixes.fix_urllib import MAPPING as modules
        from py3kwarn2to3.fixes import fix_import
        from py3kwarn2to3.fixes import fix_import

        self.unchanged(s)

        s = "reduce(a, b=42)"
        self.unchanged(s)

        s = "reduce(a, b, c, d)"
        self.unchanged(s)

        s = "reduce(**c)"
        self.unchanged(s)

        s = "reduce()"
        self.unchanged(s)

class Test_print(FixerTestCase):
    fixer = "print"

    def test_prefix_preservation(self):
        b = """print 1,   1+1,   1+1+1"""
        a = """print(1,   1+1,   1+1+1)"""
        self.check(b, a)

    def test_idempotency(self):
        s = """print()"""
        self.unchanged(s)

        s = """print('')"""
        self.unchanged(s)

    def test_idempotency_print_as_function(self):

        self.refactor.driver.grammar = pygram.python_grammar_no_print_statement