import rejig.pybytecode
from rejig.syntaxtree import *

def check(what_is, what_should_be):
    global failed, total
    env = {}
    if "\n" in what_is or " = " in what_is or "def " in what_is or "print(" in what_is:
        exec("def f():\n    " + "\n    ".join(what_is.split("\n")), env)
    else:
        exec("def f():\n    return " + what_is, env)
    ast = rejig.pybytecode.ast(env["f"])
    print(str(ast))
    assert ast == what_should_be, "\nshould be: " + repr(what_should_be) + "\nyet it is: " + repr(ast)

check('"hello"', Suite((Call('return', Const('hello')),)))
check('''.3''', Suite((Call('return', Const(.3)),)))
check('''-3''', Suite((Call('return', Const(-3)),)))
check('''--3''', Suite((Call('return', Const(--3)),)))
check('''+3''', Suite((Call('return', Const(+3)),)))
check('''++3''', Suite((Call('return', Const(++3)),)))
check('''+-3''', Suite((Call('return', Const(+-3)),)))
check('''3e1''', Suite((Call('return', Const(3e1)),)))
check('''-3e1''', Suite((Call('return', Const(-3e1)),)))
check('''+3e1''', Suite((Call('return', Const(+3e1)),)))
check('0x123', Suite((Call('return', Const(0x123)),)))
check('0o123', Suite((Call('return', Const(0o123)),)))
check('3+4j', Suite((Call('return', Const(3+4j)),)))

check('''[]''', Suite((Call('return', Call('list')),)))
check('''[3]''', Suite((Call('return', Call('list', Const(3))),)))
check('''[3,]''', Suite((Call('return', Call('list', Const(3))),)))
check('''[3, 4]''', Suite((Call('return', Call('list', Const(3), Const(4))),)))
check('''[3, 4,]''', Suite((Call('return', Call('list', Const(3), Const(4))),)))
check('''[3, 4, 5]''', Suite((Call('return', Call('list', Const(3), Const(4), Const(5))),)))
check('''[3, 4, 5,]''', Suite((Call('return', Call('list', Const(3), Const(4), Const(5))),)))
check('''[3, 4, 5, 6]''', Suite((Call('return', Call('list', Const(3), Const(4), Const(5), Const(6))),)))
check('''[3, 4, 5, 6,]''', Suite((Call('return', Call('list', Const(3), Const(4), Const(5), Const(6))),)))

check('''[[1], 2, 3, 4, 5]''', Suite((Call('return', Call('list', Call('list', Const(1)), Const(2), Const(3), Const(4), Const(5))),)))
check('''[[1, 2], 3, 4, 5]''', Suite((Call('return', Call('list', Call('list', Const(1), Const(2)), Const(3), Const(4), Const(5))),)))
check('''[[1, 2, 3], 4, 5]''', Suite((Call('return', Call('list', Call('list', Const(1), Const(2), Const(3)), Const(4), Const(5))),)))
check('''[[1, 2, 3, 4], 5]''', Suite((Call('return', Call('list', Call('list', Const(1), Const(2), Const(3), Const(4)), Const(5))),)))
check('''[[1, 2, 3, 4, 5]]''', Suite((Call('return', Call('list', Call('list', Const(1), Const(2), Const(3), Const(4), Const(5)))),)))
check('''[[[1], 2, 3, 4, 5]]''', Suite((Call('return', Call('list', Call('list', Call('list', Const(1)), Const(2), Const(3), Const(4), Const(5)))),)))
check('''[[[1, 2], 3, 4, 5]]''', Suite((Call('return', Call('list', Call('list', Call('list', Const(1), Const(2)), Const(3), Const(4), Const(5)))),)))
check('''[[[1, 2, 3], 4, 5]]''', Suite((Call('return', Call('list', Call('list', Call('list', Const(1), Const(2), Const(3)), Const(4), Const(5)))),)))
check('''[[[1, 2, 3, 4], 5]]''', Suite((Call('return', Call('list', Call('list', Call('list', Const(1), Const(2), Const(3), Const(4)), Const(5)))),)))
check('''[[[1, 2, 3, 4, 5]]]''', Suite((Call('return', Call('list', Call('list', Call('list', Const(1), Const(2), Const(3), Const(4), Const(5))))),)))

check('''[1, 2, 3, 4, [5]]''', Suite((Call('return', Call('list', Const(1), Const(2), Const(3), Const(4), Call('list', Const(5)))),)))
check('''[1, 2, 3, [4, 5]]''', Suite((Call('return', Call('list', Const(1), Const(2), Const(3), Call('list', Const(4), Const(5)))),)))
check('''[1, 2, [3, 4, 5]]''', Suite((Call('return', Call('list', Const(1), Const(2), Call('list', Const(3), Const(4), Const(5)))),)))
check('''[1, [2, 3, 4, 5]]''', Suite((Call('return', Call('list', Const(1), Call('list', Const(2), Const(3), Const(4), Const(5)))),)))
check('''[[1, 2, 3, 4, [5]]]''', Suite((Call('return', Call('list', Call('list', Const(1), Const(2), Const(3), Const(4), Call('list', Const(5))))),)))
check('''[[1, 2, 3, [4, 5]]]''', Suite((Call('return', Call('list', Call('list', Const(1), Const(2), Const(3), Call('list', Const(4), Const(5))))),)))
check('''[[1, 2, [3, 4, 5]]]''', Suite((Call('return', Call('list', Call('list', Const(1), Const(2), Call('list', Const(3), Const(4), Const(5))))),)))
check('''[[1, [2, 3, 4, 5]]]''', Suite((Call('return', Call('list', Call('list', Const(1), Call('list', Const(2), Const(3), Const(4), Const(5))))),)))

check('''x = (None)''', Suite((Assign((Name('x'),), Const(None)), Call('return', Const(None)),)))
check('''x = (3, None)''', Suite((Assign((Name('x'),), Call('tuple', Const(3), Const(None))), Call('return', Const(None)),)))
check('''x = (3, 4, None)''', Suite((Assign((Name('x'),), Call('tuple', Const(3), Const(4), Const(None))), Call('return', Const(None)),)))
check('''x = (3, 4, 5, None)''', Suite((Assign((Name('x'),), Call('tuple', Const(3), Const(4), Const(5), Const(None))), Call('return', Const(None)),)))
check('''x = (3, 4, 5, 6, None)''', Suite((Assign((Name('x'),), Call('tuple', Const(3), Const(4), Const(5), Const(6), Const(None))), Call('return', Const(None)),)))

check('''x = ((1, None), 2, 3, 4, 5, None)''', Suite((Assign((Name('x'),), Call('tuple', Call('tuple', Const(1), Const(None)), Const(2), Const(3), Const(4), Const(5), Const(None))), Call('return', Const(None)),)))
check('''x = ((1, 2, None), 3, 4, 5, None)''', Suite((Assign((Name('x'),), Call('tuple', Call('tuple', Const(1), Const(2), Const(None)), Const(3), Const(4), Const(5), Const(None))), Call('return', Const(None)),)))
check('''x = ((1, 2, 3, None), 4, 5, None)''', Suite((Assign((Name('x'),), Call('tuple', Call('tuple', Const(1), Const(2), Const(3), Const(None)), Const(4), Const(5), Const(None))), Call('return', Const(None)),)))
check('''x = ((1, 2, 3, 4, None), 5, None)''', Suite((Assign((Name('x'),), Call('tuple', Call('tuple', Const(1), Const(2), Const(3), Const(4), Const(None)), Const(5), Const(None))), Call('return', Const(None)),)))
check('''x = ((1, 2, 3, 4, 5, None), None)''', Suite((Assign((Name('x'),), Call('tuple', Call('tuple', Const(1), Const(2), Const(3), Const(4), Const(5), Const(None)), Const(None))), Call('return', Const(None)),)))
check('''x = (((1, None), 2, 3, 4, 5, None), None)''', Suite((Assign((Name('x'),), Call('tuple', Call('tuple', Call('tuple', Const(1), Const(None)), Const(2), Const(3), Const(4), Const(5), Const(None)), Const(None))), Call('return', Const(None)),)))
check('''x = (((1, 2, None), 3, 4, 5, None), None)''', Suite((Assign((Name('x'),), Call('tuple', Call('tuple', Call('tuple', Const(1), Const(2), Const(None)), Const(3), Const(4), Const(5), Const(None)), Const(None))), Call('return', Const(None)),)))
check('''x = (((1, 2, 3, None), 4, 5, None), None)''', Suite((Assign((Name('x'),), Call('tuple', Call('tuple', Call('tuple', Const(1), Const(2), Const(3), Const(None)), Const(4), Const(5), Const(None)), Const(None))), Call('return', Const(None)),)))
check('''x = (((1, 2, 3, 4, None), 5, None), None)''', Suite((Assign((Name('x'),), Call('tuple', Call('tuple', Call('tuple', Const(1), Const(2), Const(3), Const(4), Const(None)), Const(5), Const(None)), Const(None))), Call('return', Const(None)),)))
check('''x = (((1, 2, 3, 4, 5, None), None), None)''', Suite((Assign((Name('x'),), Call('tuple', Call('tuple', Call('tuple', Const(1), Const(2), Const(3), Const(4), Const(5), Const(None)), Const(None)), Const(None))), Call('return', Const(None)),)))

check('''x = (1, 2, 3, 4, (5, None), None)''', Suite((Assign((Name('x'),), Call('tuple', Const(1), Const(2), Const(3), Const(4), Call('tuple', Const(5), Const(None)), Const(None))), Call('return', Const(None)),)))
check('''x = (1, 2, 3, (4, 5, None), None)''', Suite((Assign((Name('x'),), Call('tuple', Const(1), Const(2), Const(3), Call('tuple', Const(4), Const(5), Const(None)), Const(None))), Call('return', Const(None)),)))
check('''x = (1, 2, (3, 4, 5, None), None)''', Suite((Assign((Name('x'),), Call('tuple', Const(1), Const(2), Call('tuple', Const(3), Const(4), Const(5), Const(None)), Const(None))), Call('return', Const(None)),)))
check('''x = (1, (2, 3, 4, 5, None), None)''', Suite((Assign((Name('x'),), Call('tuple', Const(1), Call('tuple', Const(2), Const(3), Const(4), Const(5), Const(None)), Const(None))), Call('return', Const(None)),)))
check('''x = ((1, 2, 3, 4, (5, None), None), None)''', Suite((Assign((Name('x'),), Call('tuple', Call('tuple', Const(1), Const(2), Const(3), Const(4), Call('tuple', Const(5), Const(None)), Const(None)), Const(None))), Call('return', Const(None)),)))
check('''x = ((1, 2, 3, (4, 5, None), None), None)''', Suite((Assign((Name('x'),), Call('tuple', Call('tuple', Const(1), Const(2), Const(3), Call('tuple', Const(4), Const(5), Const(None)), Const(None)), Const(None))), Call('return', Const(None)),)))
check('''x = ((1, 2, (3, 4, 5, None), None), None)''', Suite((Assign((Name('x'),), Call('tuple', Call('tuple', Const(1), Const(2), Call('tuple', Const(3), Const(4), Const(5), Const(None)), Const(None)), Const(None))), Call('return', Const(None)),)))
check('''x = ((1, (2, 3, 4, 5, None), None), None)''', Suite((Assign((Name('x'),), Call('tuple', Call('tuple', Const(1), Call('tuple', Const(2), Const(3), Const(4), Const(5), Const(None)), Const(None)), Const(None))), Call('return', Const(None)),)))

check('''3
    ''', Suite((Call('return', Const(None)),)))   # hey look: Python does dead code removal!
check('''3
    ''', Suite((Call('return', Const(None)),)))
check('''3
    ''', Suite((Call('return', Const(None)),)))
check('''3
    ''', Suite((Call('return', Const(None)),)))
check('''
3''', Suite((Call('return', Const(None)),)))
check('''
3''', Suite((Call('return', Const(None)),)))
check('''
3''', Suite((Call('return', Const(None)),)))
check('''
3''', Suite((Call('return', Const(None)),)))

check('''a''', Suite((Call('return', Name('a')),)))
check('''a.b''', Suite((Call('return', Call('.', Name('a'), 'b')),)))
check('''a.b.c''', Suite((Call('return', Call('.', Call('.', Name('a'), 'b'), 'c')),)))
check('''a.b.c.d''', Suite((Call('return', Call('.', Call('.', Call('.', Name('a'), 'b'), 'c'), 'd')),)))
check('''a.b.c.d.e''', Suite((Call('return', Call('.', Call('.', Call('.', Call('.', Name('a'), 'b'), 'c'), 'd'), 'e')),)))
check('''a[1]''', Suite((Call('return', Call('[.]', Name('a'), Const(1))),)))
check('''a[1][2]''', Suite((Call('return', Call('[.]', Call('[.]', Name('a'), Const(1)), Const(2))),)))
check('''a[1][2][3]''', Suite((Call('return', Call('[.]', Call('[.]', Call('[.]', Name('a'), Const(1)), Const(2)), Const(3))),)))
check('''a[1][2][3][4]''', Suite((Call('return', Call('[.]', Call('[.]', Call('[.]', Call('[.]', Name('a'), Const(1)), Const(2)), Const(3)), Const(4))),)))
check('''(9, None).stuff''', Suite((Call('return', Call('.', Call('tuple', Const(9), Const(None)), 'stuff')),)))
check('''((9, None), None).stuff''', Suite((Call('return', Call('.', Call('tuple', Call('tuple', Const(9), Const(None)), Const(None)), 'stuff')),)))
check('''(((9, None), None), None).stuff''', Suite((Call('return', Call('.', Call('tuple', Call('tuple', Call('tuple', Const(9), Const(None)), Const(None)), Const(None)), 'stuff')),)))

check('''a[1]''', Suite((Call('return', Call('[.]', Name('a'), Const(1))),)))
check('''a["hey"]''', Suite((Call('return', Call('[.]', Name('a'), Const('hey'))),)))
check('''a[1:2]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(2), Const(None)))),)))
check('''a[:]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(None), Const(None)))),)))
check('''a[1:]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(None), Const(None)))),)))
check('''a[:1]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(1), Const(None)))),)))
check('''a[::]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(None), Const(None)))),)))
check('''a[1::]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(None), Const(None)))),)))
check('''a[:1:]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(1), Const(None)))),)))
check('''a[::1]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(None), Const(1)))),)))
check('''a[1:2:]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(2), Const(None)))),)))
check('''a[:1:2]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(1), Const(2)))),)))
check('''a[1::2]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(None), Const(2)))),)))
check('''a[1:2:3]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(2), Const(3)))),)))
check('''a[1,]''', Suite((Call('return', Call('[.]', Name('a'), Const(1))),)))
check('''a["hey",]''', Suite((Call('return', Call('[.]', Name('a'), Const('hey'))),)))
check('''a[1:2,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(2), Const(None)))),)))
check('''a[:,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(None), Const(None)))),)))
check('''a[1:,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(None), Const(None)))),)))
check('''a[:1,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(1), Const(None)))),)))
check('''a[::,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(None), Const(None)))),)))
check('''a[1::,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(None), Const(None)))),)))
check('''a[:1:,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(1), Const(None)))),)))
check('''a[::1,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(None), Const(1)))),)))
check('''a[1:2:,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(2), Const(None)))),)))
check('''a[:1:2,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(1), Const(2)))),)))
check('''a[1::2,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(None), Const(2)))),)))
check('''a[1:2:3,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(2), Const(3)))),)))
check('''a[1,5]''', Suite((Call('return', Call('[.]', Name('a'), Const(1), Const(5))),)))
check('''a["hey",5]''', Suite((Call('return', Call('[.]', Name('a'), Const('hey'), Const(5))),)))
check('''a[1:2,5]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(2), Const(None)), Const(5))),)))
check('''a[:,5]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(None), Const(None)), Const(5))),)))
check('''a[1:,5]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(None), Const(None)), Const(5))),)))
check('''a[:1,5]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(1), Const(None)), Const(5))),)))
check('''a[::,5]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(None), Const(None)), Const(5))),)))
check('''a[1::,5]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(None), Const(None)), Const(5))),)))
check('''a[:1:,5]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(1), Const(None)), Const(5))),)))
check('''a[::1,5]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(None), Const(1)), Const(5))),)))
check('''a[1:2:,5]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(2), Const(None)), Const(5))),)))
check('''a[:1:2,5]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(1), Const(2)), Const(5))),)))
check('''a[1::2,5]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(None), Const(2)), Const(5))),)))
check('''a[1:2:3,5]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(2), Const(3)), Const(5))),)))
check('''a[1,5,]''', Suite((Call('return', Call('[.]', Name('a'), Const(1), Const(5))),)))
check('''a["hey",5,]''', Suite((Call('return', Call('[.]', Name('a'), Const('hey'), Const(5))),)))
check('''a[1:2,5,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(2), Const(None)), Const(5))),)))
check('''a[:,5,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(None), Const(None)), Const(5))),)))
check('''a[1:,5,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(None), Const(None)), Const(5))),)))
check('''a[:1,5,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(1), Const(None)), Const(5))),)))
check('''a[::,5,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(None), Const(None)), Const(5))),)))
check('''a[1::,5,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(None), Const(None)), Const(5))),)))
check('''a[:1:,5,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(1), Const(None)), Const(5))),)))
check('''a[::1,5,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(None), Const(1)), Const(5))),)))
check('''a[1:2:,5,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(2), Const(None)), Const(5))),)))
check('''a[:1:2,5,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(1), Const(2)), Const(5))),)))
check('''a[1::2,5,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(None), Const(2)), Const(5))),)))
check('''a[1:2:3,5,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(2), Const(3)), Const(5))),)))
check('''a[1,"a":"b"]''', Suite((Call('return', Call('[.]', Name('a'), Const(1), Call('slice', Const('a'), Const('b'), Const(None)))),)))
check('''a["hey","a":"b"]''', Suite((Call('return', Call('[.]', Name('a'), Const('hey'), Call('slice', Const('a'), Const('b'), Const(None)))),)))
check('''a[1:2,"a":"b"]''', Suite((Call('return', Call('[.]', Name('a'), Call("slice", Const(1), Const(2), Const(None)), Call('slice', Const('a'), Const('b'), Const(None)))),)))
check('''a[:,"a":"b"]''', Suite((Call('return', Call('[.]', Name('a'), Call("slice", Const(None), Const(None), Const(None)), Call('slice', Const('a'), Const('b'), Const(None)))),)))
check('''a[1:,"a":"b"]''', Suite((Call('return', Call('[.]', Name('a'), Call("slice", Const(1), Const(None), Const(None)), Call('slice', Const('a'), Const('b'), Const(None)))),)))
check('''a[:1,"a":"b"]''', Suite((Call('return', Call('[.]', Name('a'), Call("slice", Const(None), Const(1), Const(None)), Call('slice', Const('a'), Const('b'), Const(None)))),)))
check('''a[::,"a":"b"]''', Suite((Call('return', Call('[.]', Name('a'), Call("slice", Const(None), Const(None), Const(None)), Call('slice', Const('a'), Const('b'), Const(None)))),)))
check('''a[1::,"a":"b"]''', Suite((Call('return', Call('[.]', Name('a'), Call("slice", Const(1), Const(None), Const(None)), Call('slice', Const('a'), Const('b'), Const(None)))),)))
check('''a[:1:,"a":"b"]''', Suite((Call('return', Call('[.]', Name('a'), Call("slice", Const(None), Const(1), Const(None)), Call('slice', Const('a'), Const('b'), Const(None)))),)))
check('''a[::1,"a":"b"]''', Suite((Call('return', Call('[.]', Name('a'), Call("slice", Const(None), Const(None), Const(1)), Call('slice', Const('a'), Const('b'), Const(None)))),)))
check('''a[1:2:,"a":"b"]''', Suite((Call('return', Call('[.]', Name('a'), Call("slice", Const(1), Const(2), Const(None)), Call('slice', Const('a'), Const('b'), Const(None)))),)))
check('''a[:1:2,"a":"b"]''', Suite((Call('return', Call('[.]', Name('a'), Call("slice", Const(None), Const(1), Const(2)), Call('slice', Const('a'), Const('b'), Const(None)))),)))
check('''a[1::2,"a":"b"]''', Suite((Call('return', Call('[.]', Name('a'), Call("slice", Const(1), Const(None), Const(2)), Call('slice', Const('a'), Const('b'), Const(None)))),)))
check('''a[1:2:3,"a":"b"]''', Suite((Call('return', Call('[.]', Name('a'), Call("slice", Const(1), Const(2), Const(3)), Call('slice', Const('a'), Const('b'), Const(None)))),)))
check('''a[1,"a":"b",]''', Suite((Call('return', Call('[.]', Name('a'), Const(1), Call('slice', Const('a'), Const('b'), Const(None)))),)))
check('''a["hey","a":"b",]''', Suite((Call('return', Call('[.]', Name('a'), Const('hey'), Call('slice', Const('a'), Const('b'), Const(None)))),)))
check('''a[1:2,"a":"b",]''', Suite((Call('return', Call('[.]', Name('a'), Call("slice", Const(1), Const(2), Const(None)), Call('slice', Const('a'), Const('b'), Const(None)))),)))
check('''a[:,"a":"b",]''', Suite((Call('return', Call('[.]', Name('a'), Call("slice", Const(None), Const(None), Const(None)), Call('slice', Const('a'), Const('b'), Const(None)))),)))
check('''a[1:,"a":"b",]''', Suite((Call('return', Call('[.]', Name('a'), Call("slice", Const(1), Const(None), Const(None)), Call('slice', Const('a'), Const('b'), Const(None)))),)))
check('''a[:1,"a":"b",]''', Suite((Call('return', Call('[.]', Name('a'), Call("slice", Const(None), Const(1), Const(None)), Call('slice', Const('a'), Const('b'), Const(None)))),)))
check('''a[::,"a":"b",]''', Suite((Call('return', Call('[.]', Name('a'), Call("slice", Const(None), Const(None), Const(None)), Call('slice', Const('a'), Const('b'), Const(None)))),)))
check('''a[1::,"a":"b",]''', Suite((Call('return', Call('[.]', Name('a'), Call("slice", Const(1), Const(None), Const(None)), Call('slice', Const('a'), Const('b'), Const(None)))),)))
check('''a[:1:,"a":"b",]''', Suite((Call('return', Call('[.]', Name('a'), Call("slice", Const(None), Const(1), Const(None)), Call('slice', Const('a'), Const('b'), Const(None)))),)))
check('''a[::1,"a":"b",]''', Suite((Call('return', Call('[.]', Name('a'), Call("slice", Const(None), Const(None), Const(1)), Call('slice', Const('a'), Const('b'), Const(None)))),)))
check('''a[1:2:,"a":"b",]''', Suite((Call('return', Call('[.]', Name('a'), Call("slice", Const(1), Const(2), Const(None)), Call('slice', Const('a'), Const('b'), Const(None)))),)))
check('''a[:1:2,"a":"b",]''', Suite((Call('return', Call('[.]', Name('a'), Call("slice", Const(None), Const(1), Const(2)), Call('slice', Const('a'), Const('b'), Const(None)))),)))
check('''a[1::2,"a":"b",]''', Suite((Call('return', Call('[.]', Name('a'), Call("slice", Const(1), Const(None), Const(2)), Call('slice', Const('a'), Const('b'), Const(None)))),)))
check('''a[1:2:3,"a":"b",]''', Suite((Call('return', Call('[.]', Name('a'), Call("slice", Const(1), Const(2), Const(3)), Call('slice', Const('a'), Const('b'), Const(None)))),)))
check('''a[1,5,6]''', Suite((Call('return', Call('[.]', Name('a'), Const(1), Const(5), Const(6))),)))
check('''a["hey",5,6]''', Suite((Call('return', Call('[.]', Name('a'), Const('hey'), Const(5), Const(6))),)))
check('''a[1:2,5,6]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(2), Const(None)), Const(5), Const(6))),)))
check('''a[:,5,6]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(None), Const(None)), Const(5), Const(6))),)))
check('''a[1:,5,6]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(None), Const(None)), Const(5), Const(6))),)))
check('''a[:1,5,6]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(1), Const(None)), Const(5), Const(6))),)))
check('''a[::,5,6]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(None), Const(None)), Const(5), Const(6))),)))
check('''a[1::,5,6]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(None), Const(None)), Const(5), Const(6))),)))
check('''a[:1:,5,6]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(1), Const(None)), Const(5), Const(6))),)))
check('''a[::1,5,6]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(None), Const(1)), Const(5), Const(6))),)))
check('''a[1:2:,5,6]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(2), Const(None)), Const(5), Const(6))),)))
check('''a[:1:2,5,6]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(1), Const(2)), Const(5), Const(6))),)))
check('''a[1::2,5,6]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(None), Const(2)), Const(5), Const(6))),)))
check('''a[1:2:3,5,6]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(2), Const(3)), Const(5), Const(6))),)))
check('''a[1,5,6,]''', Suite((Call('return', Call('[.]', Name('a'), Const(1), Const(5), Const(6))),)))
check('''a["hey",5,6,]''', Suite((Call('return', Call('[.]', Name('a'), Const('hey'), Const(5), Const(6))),)))
check('''a[1:2,5,6,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(2), Const(None)), Const(5), Const(6))),)))
check('''a[:,5,6,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(None), Const(None)), Const(5), Const(6))),)))
check('''a[1:,5,6,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(None), Const(None)), Const(5), Const(6))),)))
check('''a[:1,5,6,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(1), Const(None)), Const(5), Const(6))),)))
check('''a[::,5,6,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(None), Const(None)), Const(5), Const(6))),)))
check('''a[1::,5,6,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(None), Const(None)), Const(5), Const(6))),)))
check('''a[:1:,5,6,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(1), Const(None)), Const(5), Const(6))),)))
check('''a[::1,5,6,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(None), Const(1)), Const(5), Const(6))),)))
check('''a[1:2:,5,6,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(2), Const(None)), Const(5), Const(6))),)))
check('''a[:1:2,5,6,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(1), Const(2)), Const(5), Const(6))),)))
check('''a[1::2,5,6,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(None), Const(2)), Const(5), Const(6))),)))
check('''a[1:2:3,5,6,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(2), Const(3)), Const(5), Const(6))),)))
check('''a[1:[2]:3,[],5,6,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Call('list', Const(2)), Const(3)), Call('list'), Const(5), Const(6))),)))
check('''a[1:[[2]]:3,[[]],5,6,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Call('list', Call('list', Const(2))), Const(3)), Call('list', Call('list')), Const(5), Const(6))),)))

check('''a[2].three''', Suite((Call('return', Call('.', Call('[.]', Name('a'), Const(2)), 'three')),)))
check('''a.three''', Suite((Call('return', Call('.', Name('a'), 'three')),)))
check('''a[2]''', Suite((Call('return', Call('[.]', Name('a'), Const(2))),)))
check('''a.three[2]''', Suite((Call('return', Call('[.]', Call('.', Name('a'), 'three'), Const(2))),)))

check('''x and y''', Suite((Call('return', Call('and', Name('x'), Name('y'))),)))
check('''x and y and z''', Suite((Call('return', Call('and', Name('x'), Call('and', Name('y'), Name('z')))),)))
check('''x and y and z and w''', Suite((Call('return', Call('and', Name('x'), Call('and', Name('y'), Call('and', Name('z'), Name('w'))))),)))
check('''not x''', Suite((Call('return', Call('not', Name('x'))),)))
check('''not x and y''', Suite((Call('return', Call('and', Call('not', Name('x')), Name('y'))),)))
check('''x or y''', Suite((Call('return', Call('or', Name('x'), Name('y'))),)))
check('''x or y and z''', Suite((Call('return', Call('or', Name('x'), Call('and', Name('y'), Name('z')))),)))
check('''x or y or z''', Suite((Call('return', Call('or', Name('x'), Call('or', Name('y'), Name('z')))),)))
check('''not x or y and z''', Suite((Call('return', Call('or', Call('not', Name('x')), Call('and', Name('y'), Name('z')))),)))
check('''x or not y and z''', Suite((Call('return', Call('or', Name('x'), Call('and', Call('not', Name('y')), Name('z')))),)))
check('''x or y and not z''', Suite((Call('return', Call('or', Name('x'), Call('and', Name('y'), Call('not', Name('z'))))),)))
check('''not x or not y and z''', Suite((Call('return', Call('or', Call('not', Name('x')), Call('and', Call('not', Name('y')), Name('z')))),)))
check('''not x or y and not z''', Suite((Call('return', Call('or', Call('not', Name('x')), Call('and', Name('y'), Call('not', Name('z'))))),)))
check('''x or not y and not z''', Suite((Call('return', Call('or', Name('x'), Call('and', Call('not', Name('y')), Call('not', Name('z'))))),)))
check('''not x or not y and not z''', Suite((Call('return', Call('or', Call('not', Name('x')), Call('and', Call('not', Name('y')), Call('not', Name('z'))))),)))
check('''x and y or z''', Suite((Call('return', Call('or', Call('and', Name('x'), Name('y')), Name('z'))),)))
check('''not x and y or z''', Suite((Call('return', Call('or', Call('and', Call('not', Name('x')), Name('y')), Name('z'))),)))
check('''x and not y or z''', Suite((Call('return', Call('or', Call('and', Name('x'), Call('not', Name('y'))), Name('z'))),)))
check('''x and y or not z''', Suite((Call('return', Call('or', Call('and', Name('x'), Name('y')), Call('not', Name('z')))),)))
check('''not x and not y or z''', Suite((Call('return', Call('or', Call('and', Call('not', Name('x')), Call('not', Name('y'))), Name('z'))),)))
check('''not x and y or not z''', Suite((Call('return', Call('or', Call('and', Call('not', Name('x')), Name('y')), Call('not', Name('z')))),)))
check('''x and not y or not z''', Suite((Call('return', Call('or', Call('and', Name('x'), Call('not', Name('y'))), Call('not', Name('z')))),)))

check('''x < y''', Suite((Call('return', Call('<', Name('x'), Name('y'))),)))
check('''x > y''', Suite((Call('return', Call('>', Name('x'), Name('y'))),)))
check('''x == y''', Suite((Call('return', Call('==', Name('x'), Name('y'))),)))
check('''x >= y''', Suite((Call('return', Call('>=', Name('x'), Name('y'))),)))
check('''x <= y''', Suite((Call('return', Call('<=', Name('x'), Name('y'))),)))
check('''x != y''', Suite((Call('return', Call('!=', Name('x'), Name('y'))),)))
check('''x in y''', Suite((Call('return', Call('in', Name('x'), Name('y'))),)))
check('''x not in y''', Suite((Call('return', Call('not-in', Name('x'), Name('y'))),)))
check('''1 < y < 2''', Suite((Call('return', Call('and', Call('<', Const(1), Name('y')), Call('<', Name('y'), Const(2)))),)))
check('''1 < y == 2''', Suite((Call('return', Call('and', Call('<', Const(1), Name('y')), Call('==', Name('y'), Const(2)))),)))

check('''(x, None) < y''', Suite((Call('return', Call('<', Call('tuple', Name('x'), Const(None)), Name('y'))),)))
check('''(x, None) > y''', Suite((Call('return', Call('>', Call('tuple', Name('x'), Const(None)), Name('y'))),)))
check('''(x, None) == y''', Suite((Call('return', Call('==', Call('tuple', Name('x'), Const(None)), Name('y'))),)))
check('''(x, None) >= y''', Suite((Call('return', Call('>=', Call('tuple', Name('x'), Const(None)), Name('y'))),)))
check('''(x, None) <= y''', Suite((Call('return', Call('<=', Call('tuple', Name('x'), Const(None)), Name('y'))),)))
check('''(x, None) != y''', Suite((Call('return', Call('!=', Call('tuple', Name('x'), Const(None)), Name('y'))),)))
check('''(x, None) in y''', Suite((Call('return', Call('in', Call('tuple', Name('x'), Const(None)), Name('y'))),)))
check('''(x, None) not in y''', Suite((Call('return', Call('not-in', Call('tuple', Name('x'), Const(None)), Name('y'))),)))
check('''(1, None) < y < 2''', Suite((Call('return', Call('and', Call('<', Call('tuple', Const(1), Const(None)), Name('y')), Call('<', Name('y'), Const(2)))),)))
check('''(1, None) < y == 2''', Suite((Call('return', Call('and', Call('<', Call('tuple', Const(1), Const(None)), Name('y')), Call('==', Name('y'), Const(2)))),)))

check('''x < (y, None)''', Suite((Call('return', Call('<', Name('x'), Call('tuple', Name('y'), Const(None)))),)))
check('''x > (y, None)''', Suite((Call('return', Call('>', Name('x'), Call('tuple', Name('y'), Const(None)))),)))
check('''x == (y, None)''', Suite((Call('return', Call('==', Name('x'), Call('tuple', Name('y'), Const(None)))),)))
check('''x >= (y, None)''', Suite((Call('return', Call('>=', Name('x'), Call('tuple', Name('y'), Const(None)))),)))
check('''x <= (y, None)''', Suite((Call('return', Call('<=', Name('x'), Call('tuple', Name('y'), Const(None)))),)))
check('''x != (y, None)''', Suite((Call('return', Call('!=', Name('x'), Call('tuple', Name('y'), Const(None)))),)))
check('''x in (y, None)''', Suite((Call('return', Call('in', Name('x'), Call('tuple', Name('y'), Const(None)))),)))
check('''x not in (y, None)''', Suite((Call('return', Call('not-in', Name('x'), Call('tuple', Name('y'), Const(None)))),)))
check('''1 < (y, None) < 2''', Suite((Call('return', Call('and', Call('<', Const(1), Call('tuple', Name('y'), Const(None))), Call('<', Call('tuple', Name('y'), Const(None)), Const(2)))),)))
check('''1 < (y, None) == 2''', Suite((Call('return', Call('and', Call('<', Const(1), Call('tuple', Name('y'), Const(None))), Call('==', Call('tuple', Name('y'), Const(None)), Const(2)))),)))
check('''1 < y < (2, None)''', Suite((Call('return', Call('and', Call('<', Const(1), Name('y')), Call('<', Name('y'), Call('tuple', Const(2), Const(None))))),)))
check('''1 < y == (2, None)''', Suite((Call('return', Call('and', Call('<', Const(1), Name('y')), Call('==', Name('y'), Call('tuple', Const(2), Const(None))))),)))

check('''(x, None) < (y, None)''', Suite((Call('return', Call('<', Call('tuple', Name('x'), Const(None)), Call('tuple', Name('y'), Const(None)))),)))
check('''(x, None) > (y, None)''', Suite((Call('return', Call('>', Call('tuple', Name('x'), Const(None)), Call('tuple', Name('y'), Const(None)))),)))
check('''(x, None) == (y, None)''', Suite((Call('return', Call('==', Call('tuple', Name('x'), Const(None)), Call('tuple', Name('y'), Const(None)))),)))
check('''(x, None) >= (y, None)''', Suite((Call('return', Call('>=', Call('tuple', Name('x'), Const(None)), Call('tuple', Name('y'), Const(None)))),)))
check('''(x, None) <= (y, None)''', Suite((Call('return', Call('<=', Call('tuple', Name('x'), Const(None)), Call('tuple', Name('y'), Const(None)))),)))
check('''(x, None) != (y, None)''', Suite((Call('return', Call('!=', Call('tuple', Name('x'), Const(None)), Call('tuple', Name('y'), Const(None)))),)))
check('''(x, None) in (y, None)''', Suite((Call('return', Call('in', Call('tuple', Name('x'), Const(None)), Call('tuple', Name('y'), Const(None)))),)))
check('''(x, None) not in (y, None)''', Suite((Call('return', Call('not-in', Call('tuple', Name('x'), Const(None)), Call('tuple', Name('y'), Const(None)))),)))
check('''(1, None) < (y, None) < 2''', Suite((Call('return', Call('and', Call('<', Call('tuple', Const(1), Const(None)), Call('tuple', Name('y'), Const(None))), Call('<', Call('tuple', Name('y'), Const(None)), Const(2)))),)))
check('''(1, None) < (y, None) == 2''', Suite((Call('return', Call('and', Call('<', Call('tuple', Const(1), Const(None)), Call('tuple', Name('y'), Const(None))), Call('==', Call('tuple', Name('y'), Const(None)), Const(2)))),)))
check('''(1, None) < y < (2, None)''', Suite((Call('return', Call('and', Call('<', Call('tuple', Const(1), Const(None)), Name('y')), Call('<', Name('y'), Call('tuple', Const(2), Const(None))))),)))
check('''(1, None) < y == (2, None)''', Suite((Call('return', Call('and', Call('<', Call('tuple', Const(1), Const(None)), Name('y')), Call('==', Name('y'), Call('tuple', Const(2), Const(None))))),)))

check('''x + y''', Suite((Call('return', Call('+', Name('x'), Name('y'))),)))
check('''x + y + z''', Suite((Call('return', Call('+', Call('+', Name('x'), Name('y')), Name('z'))),)))
check('''x + y + z + w''', Suite((Call('return', Call('+', Call('+', Call('+', Name('x'), Name('y')), Name('z')), Name('w'))),)))
check('''x - y''', Suite((Call('return', Call('-', Name('x'), Name('y'))),)))
check('''x - y - z''', Suite((Call('return', Call('-', Call('-', Name('x'), Name('y')), Name('z'))),)))
check('''x - y - z - w''', Suite((Call('return', Call('-', Call('-', Call('-', Name('x'), Name('y')), Name('z')), Name('w'))),)))
check('''x - y + z - w''', Suite((Call('return', Call('-', Call('+', Call('-', Name('x'), Name('y')), Name('z')), Name('w'))),)))
check('''x * y''', Suite((Call('return', Call('*', Name('x'), Name('y'))),)))
check('''x * y * z''', Suite((Call('return', Call('*', Call('*', Name('x'), Name('y')), Name('z'))),)))
check('''x * y * z * w''', Suite((Call('return', Call('*', Call('*', Call('*', Name('x'), Name('y')), Name('z')), Name('w'))),)))
check('''x * y - z * w''', Suite((Call('return', Call('-', Call('*', Name('x'), Name('y')), Call('*', Name('z'), Name('w')))),)))
check('''x / y''', Suite((Call('return', Call('/', Name('x'), Name('y'))),)))
check('''x / y / z''', Suite((Call('return', Call('/', Call('/', Name('x'), Name('y')), Name('z'))),)))
check('''x / y / z / w''', Suite((Call('return', Call('/', Call('/', Call('/', Name('x'), Name('y')), Name('z')), Name('w'))),)))
check('''x / y * z / w''', Suite((Call('return', Call('/', Call('*', Call('/', Name('x'), Name('y')), Name('z')), Name('w'))),)))
check('''x % y''', Suite((Call('return', Call('%', Name('x'), Name('y'))),)))
check('''x % y % z''', Suite((Call('return', Call('%', Call('%', Name('x'), Name('y')), Name('z'))),)))
check('''x % y % z % w''', Suite((Call('return', Call('%', Call('%', Call('%', Name('x'), Name('y')), Name('z')), Name('w'))),)))
check('''x % y / z % w''', Suite((Call('return', Call('%', Call('/', Call('%', Name('x'), Name('y')), Name('z')), Name('w'))),)))
check('''x // y''', Suite((Call('return', Call('//', Name('x'), Name('y'))),)))
check('''x // y // z''', Suite((Call('return', Call('//', Call('//', Name('x'), Name('y')), Name('z'))),)))
check('''x // y // z // w''', Suite((Call('return', Call('//', Call('//', Call('//', Name('x'), Name('y')), Name('z')), Name('w'))),)))
check('''x // y % z // w''', Suite((Call('return', Call('//', Call('%', Call('//', Name('x'), Name('y')), Name('z')), Name('w'))),)))
check('''+x''', Suite((Call('return', Call('u+', Name('x'))),)))
check('''-x''', Suite((Call('return', Call('u-', Name('x'))),)))
check('''++x''', Suite((Call('return', Call('u+', Call('u+', Name('x')))),)))
check('''+-x''', Suite((Call('return', Call('u+', Call('u-', Name('x')))),)))
check('''-+x''', Suite((Call('return', Call('u-', Call('u+', Name('x')))),)))
check('''--x''', Suite((Call('return', Call('u-', Call('u-', Name('x')))),)))
check('''+x + y''', Suite((Call('return', Call('+', Call('u+', Name('x')), Name('y'))),)))
check('''-x + y''', Suite((Call('return', Call('+', Call('u-', Name('x')), Name('y'))),)))
check('''++x + y''', Suite((Call('return', Call('+', Call('u+', Call('u+', Name('x'))), Name('y'))),)))
check('''+-x + y''', Suite((Call('return', Call('+', Call('u+', Call('u-', Name('x'))), Name('y'))),)))
check('''-+x + y''', Suite((Call('return', Call('+', Call('u-', Call('u+', Name('x'))), Name('y'))),)))
check('''--x + y''', Suite((Call('return', Call('+', Call('u-', Call('u-', Name('x'))), Name('y'))),)))
check('''x + +x''', Suite((Call('return', Call('+', Name('x'), Call('u+', Name('x')))),)))
check('''x + -x''', Suite((Call('return', Call('+', Name('x'), Call('u-', Name('x')))),)))
check('''x + ++x''', Suite((Call('return', Call('+', Name('x'), Call('u+', Call('u+', Name('x'))))),)))
check('''x + +-x''', Suite((Call('return', Call('+', Name('x'), Call('u+', Call('u-', Name('x'))))),)))
check('''x + -+x''', Suite((Call('return', Call('+', Name('x'), Call('u-', Call('u+', Name('x'))))),)))
check('''x + --x''', Suite((Call('return', Call('+', Name('x'), Call('u-', Call('u-', Name('x'))))),)))
check('''x ** y''', Suite((Call('return', Call('**', Name('x'), Name('y'))),)))
check('''x ** y ** z''', Suite((Call('return', Call('**', Name('x'), Call('**', Name('y'), Name('z')))),)))
check('''x ** y ** z ** w''', Suite((Call('return', Call('**', Name('x'), Call('**', Name('y'), Call('**', Name('z'), Name('w'))))),)))
check('''x ** y // z ** w''', Suite((Call('return', Call('//', Call('**', Name('x'), Name('y')), Call('**', Name('z'), Name('w')))),)))
check('''x.y**2''', Suite((Call('return', Call('**', Call('.', Name('x'), 'y'), Const(2))),)))

check('f(None)', Suite((Call('return', Call(Name('f'), Const(None))),)))
check('f(x, None)', Suite((Call('return', Call(Name('f'), Name('x'), Const(None))),)))
check('f(x, y, None)', Suite((Call('return', Call(Name('f'), Name('x'), Name('y'), Const(None))),)))
check('f(x, y, z, None)', Suite((Call('return', Call(Name('f'), Name('x'), Name('y'), Name('z'), Const(None))),)))
check('f(x=1)', Suite((Call('return', CallKeyword(Name('f'), (), (('x', Const(1)),))),)))
check('f(x, y=1)', Suite((Call('return', CallKeyword(Name('f'), (Name('x'),), (('y', Const(1)),))),)))
check('f(x, y, z=1)', Suite((Call('return', CallKeyword(Name('f'), (Name('x'), Name('y'),), (('z', Const(1)),))),)))

check('x = 1; x', Suite((Assign((Name('x'),), Const(1)), Name('x'), Call('return', Const(None)),)))
check('x = 1; x;', Suite((Assign((Name('x'),), Const(1)), Name('x'), Call('return', Const(None)),)))
check('x, = 1; x', Suite((Assign((Unpack((Name('x'),)),), Const(1)), Name('x'), Call('return', Const(None)),)))
check('x, y = 1; x', Suite((Assign((Unpack((Name('x'), Name('y'))),), Const(1)), Name('x'), Call('return', Const(None)),)))
check('x, y, = 1; x', Suite((Assign((Unpack((Name('x'), Name('y'))),), Const(1)), Name('x'), Call('return', Const(None)),)))
check('x, y, z = 1; x', Suite((Assign((Unpack((Name('x'), Name('y'), Name('z'))),), Const(1)), Name('x'), Call('return', Const(None)),)))
check('x, y, z, = 1; x', Suite((Assign((Unpack((Name('x'), Name('y'), Name('z'))),), Const(1)), Name('x'), Call('return', Const(None)),)))

check("False", Suite((Call('return', Const(False)),)))
check("True", Suite((Call('return', Const(True)),)))
check("not x", Suite((Call('return', Call('not', Name('x'))),)))
check("not x and not y", Suite((Call('return', Call('and', Call('not', Name('x')), Call('not', Name('y')))),)))
check("not x and not y and not z", Suite((Call('return', Call('and', Call('not', Name('x')), Call('and', Call('not', Name('y')), Call('not', Name('z'))))),)))
check("not x and not y and not z", Suite((Call('return', Call('and', Call('not', Name('x')), Call('and', Call('not', Name('y')), Call('not', Name('z'))))),)))
check("not x and not y and not z", Suite((Call('return', Call('and', Call('not', Name('x')), Call('and', Call('not', Name('y')), Call('not', Name('z'))))),)))
check("not x or not y", Suite((Call('return', Call('or', Call('not', Name('x')), Call('not', Name('y')))),)))
check("not x or not y or not z", Suite((Call('return', Call('or', Call('not', Name('x')), Call('or', Call('not', Name('y')), Call('not', Name('z'))))),)))
check("not x or not y or not z", Suite((Call('return', Call('or', Call('not', Name('x')), Call('or', Call('not', Name('y')), Call('not', Name('z'))))),)))
check("not x or not y or not z", Suite((Call('return', Call('or', Call('not', Name('x')), Call('or', Call('not', Name('y')), Call('not', Name('z'))))),)))
check("(not x or not y, None) and not z", Suite((Call('return', Call('and', Call('tuple', Call('or', Call('not', Name('x')), Call('not', Name('y'))), Const(None)), Call('not', Name('z')))),)))
check("not x and (not y or not z, None)", Suite((Call('return', Call('and', Call('not', Name('x')), Call('tuple', Call('or', Call('not', Name('y')), Call('not', Name('z'))), Const(None)))),)))

check("not x(1, None)", Suite((Call('return', Call('not', Call(Name('x'), Const(1), Const(None)))),)))
check("not x(1, None) and not y(2, None)", Suite((Call('return', Call('and', Call('not', Call(Name('x'), Const(1), Const(None))), Call('not', Call(Name('y'), Const(2), Const(None))))),)))
check("not x(1, None) and not y(2, None) and not z(3, None)", Suite((Call('return', Call('and', Call('not', Call(Name('x'), Const(1), Const(None))), Call('and', Call('not', Call(Name('y'), Const(2), Const(None))), Call('not', Call(Name('z'), Const(3), Const(None)))))),)))
check("not x(1, None) and not y(2, None) and not z(3, None)", Suite((Call('return', Call('and', Call('not', Call(Name('x'), Const(1), Const(None))), Call('and', Call('not', Call(Name('y'), Const(2), Const(None))), Call('not', Call(Name('z'), Const(3), Const(None)))))),)))
check("not x(1, None) and not y(2, None) and not z(3, None)", Suite((Call('return', Call('and', Call('not', Call(Name('x'), Const(1), Const(None))), Call('and', Call('not', Call(Name('y'), Const(2), Const(None))), Call('not', Call(Name('z'), Const(3), Const(None)))))),)))
check("not x(1, None) or not y(2, None)", Suite((Call('return', Call('or', Call('not', Call(Name('x'), Const(1), Const(None))), Call('not', Call(Name('y'), Const(2), Const(None))))),)))
check("not x(1, None) or not y(2, None) or not z(3, None)", Suite((Call('return', Call('or', Call('not', Call(Name('x'), Const(1), Const(None))), Call('or', Call('not', Call(Name('y'), Const(2), Const(None))), Call('not', Call(Name('z'), Const(3), Const(None)))))),)))
check("not x(1, None) or not y(2, None) or not z(3, None)", Suite((Call('return', Call('or', Call('not', Call(Name('x'), Const(1), Const(None))), Call('or', Call('not', Call(Name('y'), Const(2), Const(None))), Call('not', Call(Name('z'), Const(3), Const(None)))))),)))
check("not x(1, None) or not y(2, None) or not z(3, None)", Suite((Call('return', Call('or', Call('not', Call(Name('x'), Const(1), Const(None))), Call('or', Call('not', Call(Name('y'), Const(2), Const(None))), Call('not', Call(Name('z'), Const(3), Const(None)))))),)))
check("(not x(1, None) or not y(2, None), None) and not z(3, None)", Suite((Call('return', Call('and', Call('tuple', Call('or', Call('not', Call(Name('x'), Const(1), Const(None))), Call('not', Call(Name('y'), Const(2), Const(None)))), Const(None)), Call('not', Call(Name('z'), Const(3), Const(None))))),)))
check("not x(1, None) and (not y(2, None) or not z(3, None), None)", Suite((Call('return', Call('and', Call('not', Call(Name('x'), Const(1), Const(None))), Call('tuple', Call('or', Call('not', Call(Name('y'), Const(2), Const(None))), Call('not', Call(Name('z'), Const(3), Const(None)))), Const(None)))),)))

check("not x.a", Suite((Call('return', Call('not', Call('.', Name('x'), 'a'))),)))
check("not x.a and not y.b", Suite((Call('return', Call('and', Call('not', Call('.', Name('x'), 'a')), Call('not', Call('.', Name('y'), 'b')))),)))
check("not x.a and not y.b and not z.c", Suite((Call('return', Call('and', Call('not', Call('.', Name('x'), 'a')), Call('and', Call('not', Call('.', Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check("not x.a and not y.b and not z.c", Suite((Call('return', Call('and', Call('not', Call('.', Name('x'), 'a')), Call('and', Call('not', Call('.', Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check("not x.a and not y.b and not z.c", Suite((Call('return', Call('and', Call('not', Call('.', Name('x'), 'a')), Call('and', Call('not', Call('.', Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check("not x.a or not y.b", Suite((Call('return', Call('or', Call('not', Call('.', Name('x'), 'a')), Call('not', Call('.', Name('y'), 'b')))),)))
check("not x.a or not y.b or not z.c", Suite((Call('return', Call('or', Call('not', Call('.', Name('x'), 'a')), Call('or', Call('not', Call('.', Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check("not x.a or not y.b or not z.c", Suite((Call('return', Call('or', Call('not', Call('.', Name('x'), 'a')), Call('or', Call('not', Call('.', Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check("not x.a or not y.b or not z.c", Suite((Call('return', Call('or', Call('not', Call('.', Name('x'), 'a')), Call('or', Call('not', Call('.', Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check("(not x.a or not y.b, None) and not z.c", Suite((Call('return', Call('and', Call('tuple', Call('or', Call('not', Call('.', Name('x'), 'a')), Call('not', Call('.', Name('y'), 'b'))), Const(None)), Call('not', Call('.', Name('z'), 'c')))),)))
check("not x.a and (not y.b or not z.c, None)", Suite((Call('return', Call('and', Call('not', Call('.', Name('x'), 'a')), Call('tuple', Call('or', Call('not', Call('.', Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))), Const(None)))),)))

check("False", Suite((Call('return', Const(False)),)))
check("True", Suite((Call('return', Const(True)),)))
check("not x", Suite((Call('return', Call('not', Name('x'))),)))
check("not x and not y", Suite((Call('return', Call('and', Call('not', Name('x')), Call('not', Name('y')))),)))
check("not x and not y and not z", Suite((Call('return', Call('and', Call('not', Name('x')), Call('and', Call('not', Name('y')), Call('not', Name('z'))))),)))
check("not x and not y and not z", Suite((Call('return', Call('and', Call('not', Name('x')), Call('and', Call('not', Name('y')), Call('not', Name('z'))))),)))
check("not x and not y and not z", Suite((Call('return', Call('and', Call('not', Name('x')), Call('and', Call('not', Name('y')), Call('not', Name('z'))))),)))
check("not x or not y", Suite((Call('return', Call('or', Call('not', Name('x')), Call('not', Name('y')))),)))
check("not x or not y or not z", Suite((Call('return', Call('or', Call('not', Name('x')), Call('or', Call('not', Name('y')), Call('not', Name('z'))))),)))
check("not x or not y or not z", Suite((Call('return', Call('or', Call('not', Name('x')), Call('or', Call('not', Name('y')), Call('not', Name('z'))))),)))
check("not x or not y or not z", Suite((Call('return', Call('or', Call('not', Name('x')), Call('or', Call('not', Name('y')), Call('not', Name('z'))))),)))
check("(not x or not y, None) and not z", Suite((Call('return', Call('and', Call('tuple', Call('or', Call('not', Name('x')), Call('not', Name('y'))), Const(None)), Call('not', Name('z')))),)))
check("not x and (not y or not z, None)", Suite((Call('return', Call('and', Call('not', Name('x')), Call('tuple', Call('or', Call('not', Name('y')), Call('not', Name('z'))), Const(None)))),)))

check("not x(1, None)", Suite((Call('return', Call('not', Call(Name('x'), Const(1), Const(None)))),)))
check("not x(1, None) and not y(2, None)", Suite((Call('return', Call('and', Call('not', Call(Name('x'), Const(1), Const(None))), Call('not', Call(Name('y'), Const(2), Const(None))))),)))
check("not x(1, None) and not y(2, None) and not z(3, None)", Suite((Call('return', Call('and', Call('not', Call(Name('x'), Const(1), Const(None))), Call('and', Call('not', Call(Name('y'), Const(2), Const(None))), Call('not', Call(Name('z'), Const(3), Const(None)))))),)))
check("not x(1, None) and not y(2, None) and not z(3, None)", Suite((Call('return', Call('and', Call('not', Call(Name('x'), Const(1), Const(None))), Call('and', Call('not', Call(Name('y'), Const(2), Const(None))), Call('not', Call(Name('z'), Const(3), Const(None)))))),)))
check("not x(1, None) and not y(2, None) and not z(3, None)", Suite((Call('return', Call('and', Call('not', Call(Name('x'), Const(1), Const(None))), Call('and', Call('not', Call(Name('y'), Const(2), Const(None))), Call('not', Call(Name('z'), Const(3), Const(None)))))),)))
check("not x(1, None) or not y(2, None)", Suite((Call('return', Call('or', Call('not', Call(Name('x'), Const(1), Const(None))), Call('not', Call(Name('y'), Const(2), Const(None))))),)))
check("not x(1, None) or not y(2, None) or not z(3, None)", Suite((Call('return', Call('or', Call('not', Call(Name('x'), Const(1), Const(None))), Call('or', Call('not', Call(Name('y'), Const(2), Const(None))), Call('not', Call(Name('z'), Const(3), Const(None)))))),)))
check("not x(1, None) or not y(2, None) or not z(3, None)", Suite((Call('return', Call('or', Call('not', Call(Name('x'), Const(1), Const(None))), Call('or', Call('not', Call(Name('y'), Const(2), Const(None))), Call('not', Call(Name('z'), Const(3), Const(None)))))),)))
check("not x(1, None) or not y(2, None) or not z(3, None)", Suite((Call('return', Call('or', Call('not', Call(Name('x'), Const(1), Const(None))), Call('or', Call('not', Call(Name('y'), Const(2), Const(None))), Call('not', Call(Name('z'), Const(3), Const(None)))))),)))
check("(not x(1, None) or not y(2, None), None) and not z(3, None)", Suite((Call('return', Call('and', Call('tuple', Call('or', Call('not', Call(Name('x'), Const(1), Const(None))), Call('not', Call(Name('y'), Const(2), Const(None)))), Const(None)), Call('not', Call(Name('z'), Const(3), Const(None))))),)))
check("not x(1, None) and (not y(2, None) or not z(3, None), None)", Suite((Call('return', Call('and', Call('not', Call(Name('x'), Const(1), Const(None))), Call('tuple', Call('or', Call('not', Call(Name('y'), Const(2), Const(None))), Call('not', Call(Name('z'), Const(3), Const(None)))), Const(None)))),)))

check("not x.a", Suite((Call('return', Call('not', Call('.', Name('x'), 'a'))),)))
check("not x.a and not y.b", Suite((Call('return', Call('and', Call('not', Call('.', Name('x'), 'a')), Call('not', Call('.', Name('y'), 'b')))),)))
check("not x.a and not y.b and not z.c", Suite((Call('return', Call('and', Call('not', Call('.', Name('x'), 'a')), Call('and', Call('not', Call('.', Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check("not x.a and not y.b and not z.c", Suite((Call('return', Call('and', Call('not', Call('.', Name('x'), 'a')), Call('and', Call('not', Call('.', Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check("not x.a and not y.b and not z.c", Suite((Call('return', Call('and', Call('not', Call('.', Name('x'), 'a')), Call('and', Call('not', Call('.', Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check("not x.a or not y.b", Suite((Call('return', Call('or', Call('not', Call('.', Name('x'), 'a')), Call('not', Call('.', Name('y'), 'b')))),)))
check("not x.a or not y.b or not z.c", Suite((Call('return', Call('or', Call('not', Call('.', Name('x'), 'a')), Call('or', Call('not', Call('.', Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check("not x.a or not y.b or not z.c", Suite((Call('return', Call('or', Call('not', Call('.', Name('x'), 'a')), Call('or', Call('not', Call('.', Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check("not x.a or not y.b or not z.c", Suite((Call('return', Call('or', Call('not', Call('.', Name('x'), 'a')), Call('or', Call('not', Call('.', Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check("(not x.a or not y.b, None) and not z.c", Suite((Call('return', Call('and', Call('tuple', Call('or', Call('not', Call('.', Name('x'), 'a')), Call('not', Call('.', Name('y'), 'b'))), Const(None)), Call('not', Call('.', Name('z'), 'c')))),)))
check("not x.a and (not y.b or not z.c, None)", Suite((Call('return', Call('and', Call('not', Call('.', Name('x'), 'a')), Call('tuple', Call('or', Call('not', Call('.', Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))), Const(None)))),)))

check('''False''', Suite((Call('return', Const(False)),)))
check('''True''', Suite((Call('return', Const(True)),)))
check('''not x''', Suite((Call('return', Call('not', Name('x'))),)))
check('''not x and not y''', Suite((Call('return', Call('and', Call('not', Name('x')), Call('not', Name('y')))),)))
check('''not x and not y and not z''', Suite((Call('return', Call('and', Call('not', Name('x')), Call('and', Call('not', Name('y')), Call('not', Name('z'))))),)))
check('''not x and not y and not z''', Suite((Call('return', Call('and', Call('not', Name('x')), Call('and', Call('not', Name('y')), Call('not', Name('z'))))),)))
check('''not x and not y and not z''', Suite((Call('return', Call('and', Call('not', Name('x')), Call('and', Call('not', Name('y')), Call('not', Name('z'))))),)))
check('''not x or not y''', Suite((Call('return', Call('or', Call('not', Name('x')), Call('not', Name('y')))),)))
check('''not x or not y or not z''', Suite((Call('return', Call('or', Call('not', Name('x')), Call('or', Call('not', Name('y')), Call('not', Name('z'))))),)))
check('''not x or not y or not z''', Suite((Call('return', Call('or', Call('not', Name('x')), Call('or', Call('not', Name('y')), Call('not', Name('z'))))),)))
check('''not x or not y or not z''', Suite((Call('return', Call('or', Call('not', Name('x')), Call('or', Call('not', Name('y')), Call('not', Name('z'))))),)))
check('''(not x or not y, None) and not z''', Suite((Call('return', Call('and', Call('tuple', Call('or', Call('not', Name('x')), Call('not', Name('y'))), Const(None)), Call('not', Name('z')))),)))
check('''not x and (not y or not z, None)''', Suite((Call('return', Call('and', Call('not', Name('x')), Call('tuple', Call('or', Call('not', Name('y')), Call('not', Name('z'))), Const(None)))),)))

check('''not x(1, None)''', Suite((Call('return', Call('not', Call(Name('x'), Const(1), Const(None)))),)))
check('''not x(1, None) and not y(2, None)''', Suite((Call('return', Call('and', Call('not', Call(Name('x'), Const(1), Const(None))), Call('not', Call(Name('y'), Const(2), Const(None))))),)))
check('''not x(1, None) and not y(2, None) and not z(3, None)''', Suite((Call('return', Call('and', Call('not', Call(Name('x'), Const(1), Const(None))), Call('and', Call('not', Call(Name('y'), Const(2), Const(None))), Call('not', Call(Name('z'), Const(3), Const(None)))))),)))
check('''not x(1, None) and not y(2, None) and not z(3, None)''', Suite((Call('return', Call('and', Call('not', Call(Name('x'), Const(1), Const(None))), Call('and', Call('not', Call(Name('y'), Const(2), Const(None))), Call('not', Call(Name('z'), Const(3), Const(None)))))),)))
check('''not x(1, None) and not y(2, None) and not z(3, None)''', Suite((Call('return', Call('and', Call('not', Call(Name('x'), Const(1), Const(None))), Call('and', Call('not', Call(Name('y'), Const(2), Const(None))), Call('not', Call(Name('z'), Const(3), Const(None)))))),)))
check('''not x(1, None) or not y(2, None)''', Suite((Call('return', Call('or', Call('not', Call(Name('x'), Const(1), Const(None))), Call('not', Call(Name('y'), Const(2), Const(None))))),)))
check('''not x(1, None) or not y(2, None) or not z(3, None)''', Suite((Call('return', Call('or', Call('not', Call(Name('x'), Const(1), Const(None))), Call('or', Call('not', Call(Name('y'), Const(2), Const(None))), Call('not', Call(Name('z'), Const(3), Const(None)))))),)))
check('''not x(1, None) or not y(2, None) or not z(3, None)''', Suite((Call('return', Call('or', Call('not', Call(Name('x'), Const(1), Const(None))), Call('or', Call('not', Call(Name('y'), Const(2), Const(None))), Call('not', Call(Name('z'), Const(3), Const(None)))))),)))
check('''not x(1, None) or not y(2, None) or not z(3, None)''', Suite((Call('return', Call('or', Call('not', Call(Name('x'), Const(1), Const(None))), Call('or', Call('not', Call(Name('y'), Const(2), Const(None))), Call('not', Call(Name('z'), Const(3), Const(None)))))),)))
check('''(not x(1, None) or not y(2, None), None) and not z(3, None)''', Suite((Call('return', Call('and', Call('tuple', Call('or', Call('not', Call(Name('x'), Const(1), Const(None))), Call('not', Call(Name('y'), Const(2), Const(None)))), Const(None)), Call('not', Call(Name('z'), Const(3), Const(None))))),)))
check('''not x(1, None) and (not y(2, None) or not z(3, None), None)''', Suite((Call('return', Call('and', Call('not', Call(Name('x'), Const(1), Const(None))), Call('tuple', Call('or', Call('not', Call(Name('y'), Const(2), Const(None))), Call('not', Call(Name('z'), Const(3), Const(None)))), Const(None)))),)))

check('''not x.a''', Suite((Call('return', Call('not', Call('.', Name('x'), 'a'))),)))
check('''not x.a and not y.b''', Suite((Call('return', Call('and', Call('not', Call('.', Name('x'), 'a')), Call('not', Call('.', Name('y'), 'b')))),)))
check('''not x.a and not y.b and not z.c''', Suite((Call('return', Call('and', Call('not', Call('.', Name('x'), 'a')), Call('and', Call('not', Call('.', Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check('''not x.a and not y.b and not z.c''', Suite((Call('return', Call('and', Call('not', Call('.', Name('x'), 'a')), Call('and', Call('not', Call('.', Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check('''not x.a and not y.b and not z.c''', Suite((Call('return', Call('and', Call('not', Call('.', Name('x'), 'a')), Call('and', Call('not', Call('.', Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check('''not x.a or not y.b''', Suite((Call('return', Call('or', Call('not', Call('.', Name('x'), 'a')), Call('not', Call('.', Name('y'), 'b')))),)))
check('''not x.a or not y.b or not z.c''', Suite((Call('return', Call('or', Call('not', Call('.', Name('x'), 'a')), Call('or', Call('not', Call('.', Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check('''not x.a or not y.b or not z.c''', Suite((Call('return', Call('or', Call('not', Call('.', Name('x'), 'a')), Call('or', Call('not', Call('.', Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check('''not x.a or not y.b or not z.c''', Suite((Call('return', Call('or', Call('not', Call('.', Name('x'), 'a')), Call('or', Call('not', Call('.', Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check('''(not x.a or not y.b, None) and not z.c''', Suite((Call('return', Call('and', Call('tuple', Call('or', Call('not', Call('.', Name('x'), 'a')), Call('not', Call('.', Name('y'), 'b'))), Const(None)), Call('not', Call('.', Name('z'), 'c')))),)))
check('''not x.a and (not y.b or not z.c, None)''', Suite((Call('return', Call('and', Call('not', Call('.', Name('x'), 'a')), Call('tuple', Call('or', Call('not', Call('.', Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))), Const(None)))),)))

check('''x != y''', Suite((Call('return', Call('!=', Name('x'), Name('y'))),)))
check('''x == y''', Suite((Call('return', Call('==', Name('x'), Name('y'))),)))
check('''x <= y''', Suite((Call('return', Call('<=', Name('x'), Name('y'))),)))
check('''x > y''', Suite((Call('return', Call('>', Name('x'), Name('y'))),)))
check('''x >= y''', Suite((Call('return', Call('>=', Name('x'), Name('y'))),)))
check('''x < y''', Suite((Call('return', Call('<', Name('x'), Name('y'))),)))
check('''x not in y''', Suite((Call('return', Call('not-in', Name('x'), Name('y'))),)))
check('''x in y''', Suite((Call('return', Call('in', Name('x'), Name('y'))),)))

check('''x == y and y == z''', Suite((Call('return', Call('and', Call('==', Name('x'), Name('y')), Call('==', Name('y'), Name('z')))),)))
check('''x == y and y == z''', Suite((Call('return', Call('and', Call('==', Name('x'), Name('y')), Call('==', Name('y'), Name('z')))),)))
check('''x == y or y == z''', Suite((Call('return', Call('or', Call('==', Name('x'), Name('y')), Call('==', Name('y'), Name('z')))),)))
check('''x != y or y != z''', Suite((Call('return', Call('or', Call('!=', Name('x'), Name('y')), Call('!=', Name('y'), Name('z')))),)))
check('''x != y or y != z''', Suite((Call('return', Call('or', Call('!=', Name('x'), Name('y')), Call('!=', Name('y'), Name('z')))),)))
check('''x != y or y == z''', Suite((Call('return', Call('or', Call('!=', Name('x'), Name('y')), Call('==', Name('y'), Name('z')))),)))

check('''a and b and c and d and e''', Suite((Call('return', Call('and', Name('a'), Call('and', Name('b'), Call('and', Name('c'), Call('and', Name('d'), Name('e')))))),)))
check('''a and b and c and d and e''', Suite((Call('return', Call('and', Name('a'), Call('and', Name('b'), Call('and', Name('c'), Call('and', Name('d'), Name('e')))))),)))

check("def g(x): return 3.14", Suite((Assign((Name('g'),), Def(('x',), (), Suite((Call('return', Const(3.14)),)))), Call('return', Const(None)),)))
check("""def g(x):
    return 3.14""", Suite((Assign((Name('g'),), Def(('x',), (), Suite((Call('return', Const(3.14)),)))), Call('return', Const(None)),)))
check("def g(x, y): return x**2", Suite((Assign((Name('g'),), Def(('x', 'y'), (), Suite((Call('return', Call('**', Name('x'), Const(2))),)))), Call('return', Const(None)),)))
check("""def g(x, y):
    return x**2""", Suite((Assign((Name('g'),), Def(('x', 'y'), (), Suite((Call('return', Call('**', Name('x'), Const(2))),)))), Call('return', Const(None)),)))
check("lambda: 3.14", Suite((Call('return', Def((), (), Suite((Call('return', Const(3.14)),)))),)))
check("lambda x: x**2", Suite((Call('return', Def(('x',), (), Suite((Call('return', Call('**', Name('x'), Const(2))),)))),)))
check("(lambda x: x**2, None)", Suite((Call('return', Call('tuple', Def(('x',), (), Suite((Call('return', Call('**', Name('x'), Const(2))),))), Const(None))),)))

check("1 if x == 0 else 2", Suite((Call('if', Call('==', Name('x'), Const(0)), Suite((Call('return', Const(1)),)), Suite((Call('return', Const(2)),))),)))
check("y = (1 if x == 0 else 2, None)", Suite((Assign((Name('y'),), Call('tuple', Call('?', Call('==', Name('x'), Const(0)), Const(1), Const(2)), Const(None))), Call('return', Const(None)),)))
check("1 if x == 0 else None", Suite((Call('if', Call('==', Name('x'), Const(0)), Suite((Call('return', Const(1)),)), Suite((Call('return', Const(None)),))),)))
check("(1 if x == 0 else 2, None)", Suite((Call('return', Call('tuple', Call('?', Call('==', Name('x'), Const(0)), Const(1), Const(2)), Const(None))),)))
check("(1 if x == 0 else None, None)", Suite((Call('return', Call('tuple', Call('?', Call('==', Name('x'), Const(0)), Const(1), Const(None)), Const(None))),)))
check("""if x == 0:
    return 1""", Suite((Call('if', Call('==', Name('x'), Const(0)), Suite((Call('return', Const(1)),)), Suite((Call('return', Const(None)),))),)))
check("""if x == 0:
    y = 1
    return 1""", Suite((Call('if', Call('==', Name('x'), Const(0)), Suite((Assign((Name('y'),), Const(1)), Call('return', Const(1)),)), Suite((Call('return', Const(None)),))),)))
check('''if x == 0:
    return 1
else:
    return 2''', Suite((Call('if', Call('==', Name('x'), Const(0)), Suite((Call('return', Const(1)),)), Suite((Call('return', Const(2)),))),)))
check('''if x == 0:
    y = 1
    return 1
else:
    y = 2
    return 2''', Suite((Call('if', Call('==', Name('x'), Const(0)), Suite((Assign((Name('y'),), Const(1)), Call('return', Const(1)),)), Suite((Assign((Name('y'),), Const(2)), Call("return", Const(2))))),)))
check('''if x == 0:
    return 1
elif x == 1:
    return 2
else:
    return 3''', Suite((Call('if', Call('==', Name('x'), Const(0)), Suite((Call('return', Const(1)),)), Suite((Call('if', Call('==', Name('x'), Const(1)), Suite((Call('return', Const(2)),)), Suite((Call('return', Const(3)),))),))),)))

check('''if x == 0:
    y = 1
    return 1
elif x == 1:
    y = 2
    return 2
else:
    y = 3
    return 3''', Suite((Call('if', Call('==', Name('x'), Const(0)), Suite((Assign((Name('y'),), Const(1)), Call('return', Const(1)),)), Suite((Call('if', Call('==', Name('x'), Const(1)), Suite((Assign((Name('y'),), Const(2)), Call('return', Const(2)),)), Suite((Assign((Name('y'),), Const(3)), Call("return", Const(3))))),))),)))
check('''if x == 0:
    y = 1''', Suite((Call('if', Call('==', Name('x'), Const(0)), Suite((Assign((Name('y'),), Const(1)),))), Call('return', Const(None)),)))
check('''if x == 0:
    y = 1
    z = 1''', Suite((Call('if', Call('==', Name('x'), Const(0)), Suite((Assign((Name('y'),), Const(1)), Assign((Name('z'),), Const(1)),))), Call('return', Const(None)),)))
check('''if x == 0:
    y = 1
else:
    y = 2''', Suite((Call('if', Call('==', Name('x'), Const(0)), Suite((Assign((Name('y'),), Const(1)),)), Suite((Assign((Name('y'),), Const(2)),))), Call('return', Const(None)),)))
check('''if x == 0:
    y = 1
    z = 1
else:
    y = 2
    z = 2''', Suite((Call('if', Call('==', Name('x'), Const(0)), Suite((Assign((Name('y'),), Const(1)), Assign((Name('z'),), Const(1)),)), Suite((Assign((Name('y'),), Const(2)), Assign((Name('z'),), Const(2)),))), Call('return', Const(None)),)))

# check("print(None)", Suite((Call('return', Call(Name('print'), Const(None))),)))
# check("print(1, None)", Suite((Call('return', Call(Name('print'), Const(1), Const(None))),)))
# check("print(1, 2, 3, None)", Suite((Call('return', Call(Name('print'), Const(1), Const(2), Const(3), Const(None))),)))

check("[]", Suite((Call('return', Call('list')),)))
check("[1]", Suite((Call('return', Call('list', Const(1))),)))
check("[1, 2]", Suite((Call('return', Call('list', Const(1), Const(2))),)))
check("[one]", Suite((Call('return', Call('list', Name('one'))),)))
check("[one, two]", Suite((Call('return', Call('list', Name('one'), Name('two'))),)))
check("['one']", Suite((Call('return', Call('list', Const('one'))),)))
check("['one', 'two']", Suite((Call('return', Call('list', Const('one'), Const('two'))),)))
check("set([])", Suite((Call('return', Call(Name('set'), Call('list'))),)))
check("set([1])", Suite((Call('return', Call(Name('set'), Call('list', Const(1)))),)))
check("set([1, 2])", Suite((Call('return', Call(Name('set'), Call('list', Const(1), Const(2)))),)))
check("set([one])", Suite((Call('return', Call(Name('set'), Call('list', Name('one')))),)))
check("set([one, two])", Suite((Call('return', Call(Name('set'), Call('list', Name('one'), Name('two')))),)))
check("set(['one'])", Suite((Call('return', Call(Name('set'), Call('list', Const('one')))),)))
check("set(['one', 'two'])", Suite((Call('return', Call(Name('set'), Call('list', Const('one'), Const('two')))),)))
check("{}", Suite((Call('return', Call('dict')),)))
check("{1}", Suite((Call('return', Call('set', Const(1))),)))
check("{1, 2}", Suite((Call('return', Call('set', Const(1), Const(2))),)))
check("{one}", Suite((Call('return', Call('set', Name('one'))),)))
check("{one, two}", Suite((Call('return', Call('set', Name('one'), Name('two'))),)))
check("{'one'}", Suite((Call('return', Call('set', Const('one'))),)))
check("{'one', 'two'}", Suite((Call('return', Call('set', Const('one'), Const('two'))),)))
check("{'x': 1}", Suite((Call('return', Call('dict', Const('x'), Const(1))),)))
check("{'x': 1, 'y': 2}", Suite((Call('return', Call('dict', Const('x'), Const(1), Const('y'), Const(2))),)))
check("{'x': 1, 'y': 2, 'z': 3}", Suite((Call('return', Call('dict', Const('x'), Const(1), Const('y'), Const(2), Const('z'), Const(3))),)))
check("{'x': one}", Suite((Call('return', Call('dict', Const('x'), Name('one'))),)))
check("{'x': one, 'y': two}", Suite((Call('return', Call('dict', Const('x'), Name('one'), Const('y'), Name('two'))),)))
check("{'x': one, 'y': two, 'z': three}", Suite((Call('return', Call('dict', Const('x'), Name('one'), Const('y'), Name('two'), Const('z'), Name('three'))),)))
check("{1: 1}", Suite((Call('return', Call('dict', Const(1), Const(1))),)))
check("{1: 1, 2: 2}", Suite((Call('return', Call('dict', Const(1), Const(1), Const(2), Const(2))),)))
check("{1: 1, 2: 2, 3: 3}", Suite((Call('return', Call('dict', Const(1), Const(1), Const(2), Const(2), Const(3), Const(3))),)))
check("{1: one}", Suite((Call('return', Call('dict', Const(1), Name('one'))),)))
check("{1: one, 2: two}", Suite((Call('return', Call('dict', Const(1), Name('one'), Const(2), Name('two'))),)))
check("{1: one, 2: two, 3: three}", Suite((Call('return', Call('dict', Const(1), Name('one'), Const(2), Name('two'), Const(3), Name('three'))),)))
check("{one: 1}", Suite((Call('return', Call('dict', Name('one'), Const(1))),)))
check("{one: 1, two: 2}", Suite((Call('return', Call('dict', Name('one'), Const(1), Name('two'), Const(2))),)))
check("{one: 1, two: 2, three: 3}", Suite((Call('return', Call('dict', Name('one'), Const(1), Name('two'), Const(2), Name('three'), Const(3))),)))
check("{one: one}", Suite((Call('return', Call('dict', Name('one'), Name('one'))),)))
check("{one: one, two: two}", Suite((Call('return', Call('dict', Name('one'), Name('one'), Name('two'), Name('two'))),)))
check("{one: one, two: two, three: three}", Suite((Call('return', Call('dict', Name('one'), Name('one'), Name('two'), Name('two'), Name('three'), Name('three'))),)))

check("[x**2 for x in something]", Suite((Call('return', Call(Call('.', Name('something'), 'map'), Def(('x',), (), Suite((Call('return', Call('**', Name('x'), Const(2))),))))),)))
check("[x**2 for x in something if x > 0]", Suite((Call('return', Call(Call('.', Call(Call('.', Name('something'), 'filter'), Def(('x',), (), Suite((Call('return', Call('>', Name('x'), Const(0))),)))), 'map'), Def(('x',), (), Suite((Call('return', Call('**', Name('x'), Const(2))),))))),)))
check("[y**2 for x in something for y in x]", Suite((Call('return', Call(Call('.', Name('something'), 'map'), Def(('x',), (), Suite((Call('return', Call(Call('.', Name('x'), 'map'), Def(('y',), (), Suite((Call('return', Call('**', Name('y'), Const(2))),))))),))))),)))
check("[y**2 for x in something for y in x if x > 0]", Suite((Call('return', Call(Call('.', Name('something'), 'map'), Def(('x',), (), Suite((Call('return', Call(Call('.', Call(Call('.', Name('x'), 'filter'), Def(('y',), (), Suite((Call('return', Call('>', Name('x'), Const(0))),)))), 'map'), Def(('y',), (), Suite((Call('return', Call('**', Name('y'), Const(2))),))))),))))),)))
check("[y**2 for x in something for y in x if y > 0]", Suite((Call('return', Call(Call('.', Name('something'), 'map'), Def(('x',), (), Suite((Call('return', Call(Call('.', Call(Call('.', Name('x'), 'filter'), Def(('y',), (), Suite((Call('return', Call('>', Name('y'), Const(0))),)))), 'map'), Def(('y',), (), Suite((Call('return', Call('**', Name('y'), Const(2))),))))),))))),)))
check("[y**2 for x in something if x for y in x if x > 0]", Suite((Call('return', Call(Call('.', Call(Call('.', Name('something'), 'filter'), Def(('x',), (), Suite((Call('return', Name('x')),)))), 'map'), Def(('x',), (), Suite((Call('return', Call(Call('.', Call(Call('.', Name('x'), 'filter'), Def(('y',), (), Suite((Call('return', Call('>', Name('x'), Const(0))),)))), 'map'), Def(('y',), (), Suite((Call('return', Call('**', Name('y'), Const(2))),))))),))))),)))

check("f([x**2 for x in something], None)", Suite((Call('return', Call(Name('f'), Call(Call('.', Name('something'), 'map'), Def(('x',), (), Suite((Call('return', Call('**', Name('x'), Const(2))),)))), Const(None))),)))
check("f([x**2 for x in something if x > 0], None)", Suite((Call('return', Call(Name('f'), Call(Call('.', Call(Call('.', Name('something'), 'filter'), Def(('x',), (), Suite((Call('return', Call('>', Name('x'), Const(0))),)))), 'map'), Def(('x',), (), Suite((Call('return', Call('**', Name('x'), Const(2))),)))), Const(None))),)))
check("f([y**2 for x in something for y in x], None)", Suite((Call('return', Call(Name('f'), Call(Call('.', Name('something'), 'map'), Def(('x',), (), Suite((Call('return', Call(Call('.', Name('x'), 'map'), Def(('y',), (), Suite((Call('return', Call('**', Name('y'), Const(2))),))))),)))), Const(None))),)))
check("f([y**2 for x in something for y in x if x > 0], None)", Suite((Call('return', Call(Name('f'), Call(Call('.', Name('something'), 'map'), Def(('x',), (), Suite((Call('return', Call(Call('.', Call(Call('.', Name('x'), 'filter'), Def(('y',), (), Suite((Call('return', Call('>', Name('x'), Const(0))),)))), 'map'), Def(('y',), (), Suite((Call('return', Call('**', Name('y'), Const(2))),))))),)))), Const(None))),)))
check("f([y**2 for x in something for y in x if y > 0], None)", Suite((Call('return', Call(Name('f'), Call(Call('.', Name('something'), 'map'), Def(('x',), (), Suite((Call('return', Call(Call('.', Call(Call('.', Name('x'), 'filter'), Def(('y',), (), Suite((Call('return', Call('>', Name('y'), Const(0))),)))), 'map'), Def(('y',), (), Suite((Call('return', Call('**', Name('y'), Const(2))),))))),)))), Const(None))),)))
check("f([y**2 for x in something if x for y in x if x > 0], None)", Suite((Call('return', Call(Name('f'), Call(Call('.', Call(Call('.', Name('something'), 'filter'), Def(('x',), (), Suite((Call('return', Name('x')),)))), 'map'), Def(('x',), (), Suite((Call('return', Call(Call('.', Call(Call('.', Name('x'), 'filter'), Def(('y',), (), Suite((Call('return', Call('>', Name('x'), Const(0))),)))), 'map'), Def(('y',), (), Suite((Call('return', Call('**', Name('y'), Const(2))),))))),)))), Const(None))),)))

check("f((x**2 for x in something), None)", Suite((Call('return', Call(Name('f'), Call(Call('.', Name('something'), 'map'), Def(('x',), (), Suite((Call('return', Call('**', Name('x'), Const(2))),)))), Const(None))),)))
check("f((x**2 for x in something if x > 0), None)", Suite((Call('return', Call(Name('f'), Call(Call('.', Call(Call('.', Name('something'), 'filter'), Def(('x',), (), Suite((Call('return', Call('>', Name('x'), Const(0))),)))), 'map'), Def(('x',), (), Suite((Call('return', Call('**', Name('x'), Const(2))),)))), Const(None))),)))
check("f((y**2 for x in something for y in x), None)", Suite((Call('return', Call(Name('f'), Call(Call('.', Name('something'), 'map'), Def(('x',), (), Suite((Call('return', Call(Call('.', Name('x'), 'map'), Def(('y',), (), Suite((Call('return', Call('**', Name('y'), Const(2))),))))),)))), Const(None))),)))
check("f((y**2 for x in something for y in x if x > 0), None)", Suite((Call('return', Call(Name('f'), Call(Call('.', Name('something'), 'map'), Def(('x',), (), Suite((Call('return', Call(Call('.', Call(Call('.', Name('x'), 'filter'), Def(('y',), (), Suite((Call('return', Call('>', Name('x'), Const(0))),)))), 'map'), Def(('y',), (), Suite((Call('return', Call('**', Name('y'), Const(2))),))))),)))), Const(None))),)))
check("f((y**2 for x in something for y in x if y > 0), None)", Suite((Call('return', Call(Name('f'), Call(Call('.', Name('something'), 'map'), Def(('x',), (), Suite((Call('return', Call(Call('.', Call(Call('.', Name('x'), 'filter'), Def(('y',), (), Suite((Call('return', Call('>', Name('y'), Const(0))),)))), 'map'), Def(('y',), (), Suite((Call('return', Call('**', Name('y'), Const(2))),))))),)))), Const(None))),)))
check("f((y**2 for x in something if x for y in x if x > 0), None)", Suite((Call('return', Call(Name('f'), Call(Call('.', Call(Call('.', Name('something'), 'filter'), Def(('x',), (), Suite((Call('return', Name('x')),)))), 'map'), Def(('x',), (), Suite((Call('return', Call(Call('.', Call(Call('.', Name('x'), 'filter'), Def(('y',), (), Suite((Call('return', Call('>', Name('x'), Const(0))),)))), 'map'), Def(('y',), (), Suite((Call('return', Call('**', Name('y'), Const(2))),))))),)))), Const(None))),)))

check("f(one=1)", Suite((Call('return', CallKeyword(Name('f'), (), (('one', Const(1)),))),)))
check("f(one=1, two=2)", Suite((Call('return', CallKeyword(Name('f'), (), (('one', Const(1)), ('two', Const(2))))),)))
check("f(x, one=1)", Suite((Call('return', CallKeyword(Name('f'), (Name('x'),), (('one', Const(1)),))),)))
check("f(x, one=1, two=2)", Suite((Call('return', CallKeyword(Name('f'), (Name('x'),), (('one', Const(1)), ('two', Const(2))))),)))

check("x[..., :]", Suite((Call('return', Call('[.]', Name('x'), Const(Ellipsis), Call('slice', Const(None), Const(None), Const(None)))),)))

check('x = y = 1', Suite((Assign((Name('x'), Name('y')), Const(1)), Call('return', Const(None)),)))
check('x = y = z = 1', Suite((Assign((Name('x'), Name('y'), Name('z')), Const(1)), Call('return', Const(None)),)))
check('x, y = 1', Suite((Assign((Unpack((Name('x'), Name('y'))),), Const(1)), Call('return', Const(None)),)))
check('x, y = z = 1', Suite((Assign((Unpack((Name('x'), Name('y'))), Name('z')), Const(1)), Call('return', Const(None)),)))
check('x = y, z = 1', Suite((Assign((Name('x'), Unpack((Name('y'), Name('z')))), Const(1)), Call('return', Const(None)),)))

check('x.a = y = 1', Suite((Assign((Call('.', Name('x'), 'a'), Name('y'),), Const(1)), Call('return', Const(None)),)))
check('x.a = y = z = 1', Suite((Assign((Call('.', Name('x'), 'a'), Name('y'), Name('z'),), Const(1)), Call('return', Const(None)),)))
check('x.a, y = 1', Suite((Assign((Unpack((Call('.', Name('x'), 'a'), Name('y'))),), Const(1)), Call('return', Const(None)),)))
check('x.a, y = z = 1', Suite((Assign((Unpack((Call('.', Name('x'), 'a'), Name('y'))), Name('z')), Const(1)), Call('return', Const(None)),)))
check('x.a = y, z = 1', Suite((Assign((Call('.', Name('x'), 'a'), Unpack((Name('y'), Name('z')))), Const(1)), Call('return', Const(None)),)))

check('x = y.a = 1', Suite((Assign((Name('x'), Call('.', Name('y'), 'a'),), Const(1)), Call('return', Const(None)),)))
check('x = y.a = z = 1', Suite((Assign((Name('x'), Call('.', Name('y'), 'a'), Name('z')), Const(1)), Call('return', Const(None)),)))
check('x, y.a = 1', Suite((Assign((Unpack((Name('x'), Call('.', Name('y'), 'a'))),), Const(1)), Call('return', Const(None)),)))
check('x, y.a = z = 1', Suite((Assign((Unpack((Name('x'), Call('.', Name('y'), 'a'))), Name('z')), Const(1)), Call('return', Const(None)),)))
check('x = y.a, z = 1', Suite((Assign((Name('x'), Unpack((Call('.', Name('y'), 'a'), Name('z')))), Const(1)), Call('return', Const(None)),)))

check('x = y = z.a = 1', Suite((Assign((Name('x'), Name('y'), Call('.', Name('z'), 'a'),), Const(1)), Call('return', Const(None)),)))
check('x, y = z.a = 1', Suite((Assign((Unpack((Name('x'), Name('y'))), Call('.', Name('z'), 'a'),), Const(1)), Call('return', Const(None)),)))
check('x = y, z.a = 1', Suite((Assign((Name('x'), Unpack((Name('y'), Call('.', Name('z'), 'a'))),), Const(1)), Call('return', Const(None)),)))

check('x[0] = y = 1', Suite((Assign((Call('[.]', Name('x'), Const(0)), Name('y'),), Const(1)), Call('return', Const(None)),)))
check('x[0] = y = z = 1', Suite((Assign((Call('[.]', Name('x'), Const(0)), Name('y'), Name('z')), Const(1)), Call('return', Const(None)),)))
check('x[0], y = 1', Suite((Assign((Unpack((Call('[.]', Name('x'), Const(0)), Name('y'),)),), Const(1)), Call('return', Const(None)),)))
check('x[0], y = z = 1', Suite((Assign((Unpack((Call('[.]', Name('x'), Const(0)), Name('y'))), Name('z')), Const(1)), Call('return', Const(None)),)))
check('x[0] = y, z = 1', Suite((Assign((Call('[.]', Name('x'), Const(0)), Unpack((Name('y'), Name('z')))), Const(1)), Call('return', Const(None)),)))

check('x = y[0] = 1', Suite((Assign((Name('x'), Call('[.]', Name('y'), Const(0)),), Const(1)), Call('return', Const(None)),)))
check('x = y[0] = z = 1', Suite((Assign((Name('x'), Call('[.]', Name('y'), Const(0)), Name('z')), Const(1)), Call('return', Const(None)),)))
check('x, y[0] = 1', Suite((Assign((Unpack((Name('x'), Call('[.]', Name('y'), Const(0)))),), Const(1)), Call('return', Const(None)),)))
check('x, y[0] = z = 1', Suite((Assign((Unpack((Name('x'), Call('[.]', Name('y'), Const(0)))), Name('z')), Const(1)), Call('return', Const(None)),)))
check('x = y[0], z = 1', Suite((Assign((Name('x'), Unpack((Call('[.]', Name('y'), Const(0)), Name('z')))), Const(1)), Call('return', Const(None)),)))

check('x = y = z[0] = 1', Suite((Assign((Name('x'), Name('y'), Call('[.]', Name('z'), Const(0)),), Const(1)), Call('return', Const(None)),)))
check('x, y = z[0] = 1', Suite((Assign((Unpack((Name('x'), Name('y'))), Call('[.]', Name('z'), Const(0)),), Const(1)), Call('return', Const(None)),)))
check('x = y, z[0] = 1', Suite((Assign((Name('x'), Unpack((Name('y'), Call('[.]', Name('z'), Const(0)))),), Const(1)), Call('return', Const(None)),)))

check('x[:, ...] = y = 1', Suite((Assign((Call('[.]', Name('x'), Call('slice', Const(None), Const(None), Const(None)), Const(Ellipsis)), Name('y'),), Const(1)), Call('return', Const(None)),)))
check('x[:, ...] = y = z = 1', Suite((Assign((Call('[.]', Name('x'), Call('slice', Const(None), Const(None), Const(None)), Const(Ellipsis)), Name('y'), Name('z')), Const(1)), Call('return', Const(None)),)))
check('x[:, ...], y = 1', Suite((Assign((Unpack((Call('[.]', Name('x'), Call('slice', Const(None), Const(None), Const(None)), Const(Ellipsis)), Name('y'))),), Const(1)), Call('return', Const(None)),)))
check('x[:, ...], y = z = 1', Suite((Assign((Unpack((Call('[.]', Name('x'), Call('slice', Const(None), Const(None), Const(None)), Const(Ellipsis)), Name('y'))), Name('z')), Const(1)), Call('return', Const(None)),)))
check('x[:, ...] = y, z = 1', Suite((Assign((Call('[.]', Name('x'), Call('slice', Const(None), Const(None), Const(None)), Const(Ellipsis)), Unpack((Name('y'), Name('z')))), Const(1)), Call('return', Const(None)),)))

check('x = y[:, ...] = 1', Suite((Assign((Name('x'), Call('[.]', Name('y'), Call('slice', Const(None), Const(None), Const(None)), Const(Ellipsis)),), Const(1)), Call('return', Const(None)),)))
check('x = y[:, ...] = z = 1', Suite((Assign((Name('x'), Call('[.]', Name('y'), Call('slice', Const(None), Const(None), Const(None)), Const(Ellipsis)), Name('z')), Const(1)), Call('return', Const(None)),)))
check('x, y[:, ...] = 1', Suite((Assign((Unpack((Name('x'), Call('[.]', Name('y'), Call('slice', Const(None), Const(None), Const(None)), Const(Ellipsis)))),), Const(1)), Call('return', Const(None)),)))
check('x, y[:, ...] = z = 1', Suite((Assign((Unpack((Name('x'), Call('[.]', Name('y'), Call('slice', Const(None), Const(None), Const(None)), Const(Ellipsis)))), Name('z')), Const(1)), Call('return', Const(None)),)))
check('x = y[:, ...], z = 1', Suite((Assign((Name('x'), Unpack((Call('[.]', Name('y'), Call('slice', Const(None), Const(None), Const(None)), Const(Ellipsis)), Name('z')))), Const(1)), Call('return', Const(None)),)))

check('x = y = z[:, ...] = 1', Suite((Assign((Name('x'), Name('y'), Call('[.]', Name('z'), Call('slice', Const(None), Const(None), Const(None)), Const(Ellipsis)),), Const(1)), Call('return', Const(None)),)))
check('x, y = z[:, ...] = 1', Suite((Assign((Unpack((Name('x'), Name('y'))), Call('[.]', Name('z'), Call('slice', Const(None), Const(None), Const(None)), Const(Ellipsis)),), Const(1)), Call('return', Const(None)),)))
check('x = y, z[:, ...] = 1', Suite((Assign((Name('x'), Unpack((Name('y'), Call('[.]', Name('z'), Call('slice', Const(None), Const(None), Const(None)), Const(Ellipsis)))),), Const(1)), Call('return', Const(None)),)))

4d81f9fd95cb285139f7a2febae1ab8f6cf26d42
<mask token>

<mask token>


def check(what_is, what_should_be):
    global failed, total
    env = {}
    if ('\n' in what_is or ' = ' in what_is or 'def ' in what_is or 
        'print(' in what_is):
        exec('def f():\n    ' + '\n    '.join(what_is.split('\n')), env)
    else:
        exec('def f():\n    return ' + what_is, env)
    ast = rejig.pybytecode.ast(env['f'])
    print(str(ast))
    assert ast == what_should_be, '\nshould be: ' + repr(what_should_be
        ) + '\nyet it is: ' + repr(ast)


<mask token>

<mask token>


def check(what_is, what_should_be):
    global failed, total
    env = {}
    if ('\n' in what_is or ' = ' in what_is or 'def ' in what_is or 
        'print(' in what_is):
        exec('def f():\n    ' + '\n    '.join(what_is.split('\n')), env)
    else:
        exec('def f():\n    return ' + what_is, env)
    ast = rejig.pybytecode.ast(env['f'])
    print(str(ast))
    assert ast == what_should_be, '\nshould be: ' + repr(what_should_be
        ) + '\nyet it is: ' + repr(ast)


check('"hello"', Suite((Call('return', Const('hello')),)))
check('.3', Suite((Call('return', Const(0.3)),)))
check('-3', Suite((Call('return', Const(-3)),)))
check('--3', Suite((Call('return', Const(--3)),)))
check('+3', Suite((Call('return', Const(+3)),)))
check('++3', Suite((Call('return', Const(++3)),)))
check('+-3', Suite((Call('return', Const(+-3)),)))
check('3e1', Suite((Call('return', Const(30.0)),)))
check('-3e1', Suite((Call('return', Const(-30.0)),)))
check('+3e1', Suite((Call('return', Const(+30.0)),)))
check('0x123', Suite((Call('return', Const(291)),)))
check('0o123', Suite((Call('return', Const(83)),)))
check('3+4j', Suite((Call('return', Const(3 + 4.0j)),)))
check('[]', Suite((Call('return', Call('list')),)))
check('[3]', Suite((Call('return', Call('list', Const(3))),)))
check('[3,]', Suite((Call('return', Call('list', Const(3))),)))
check('[3, 4]', Suite((Call('return', Call('list', Const(3), Const(4))),)))
check('[3, 4,]', Suite((Call('return', Call('list', Const(3), Const(4))),)))
check('[3, 4, 5]', Suite((Call('return', Call('list', Const(3), Const(4),
    Const(5))),)))
check('[3, 4, 5,]', Suite((Call('return', Call('list', Const(3), Const(4),
    Const(5))),)))
check('[3, 4, 5, 6]', Suite((Call('return', Call('list', Const(3), Const(4),
    Const(5), Const(6))),)))
check('[3, 4, 5, 6,]', Suite((Call('return', Call('list', Const(3), Const(4
    ), Const(5), Const(6))),)))
check('[[1], 2, 3, 4, 5]', Suite((Call('return', Call('list', Call('list',
    Const(1)), Const(2), Const(3), Const(4), Const(5))),)))
check('[[1, 2], 3, 4, 5]', Suite((Call('return', Call('list', Call('list',
    Const(1), Const(2)), Const(3), Const(4), Const(5))),)))
check('[[1, 2, 3], 4, 5]', Suite((Call('return', Call('list', Call('list',
    Const(1), Const(2), Const(3)), Const(4), Const(5))),)))
check('[[1, 2, 3, 4], 5]', Suite((Call('return', Call('list', Call('list',
    Const(1), Const(2), Const(3), Const(4)), Const(5))),)))
check('[[1, 2, 3, 4, 5]]', Suite((Call('return', Call('list', Call('list',
    Const(1), Const(2), Const(3), Const(4), Const(5)))),)))
check('[[[1], 2, 3, 4, 5]]', Suite((Call('return', Call('list', Call('list',
    Call('list', Const(1)), Const(2), Const(3), Const(4), Const(5)))),)))
check('[[[1, 2], 3, 4, 5]]', Suite((Call('return', Call('list', Call('list',
    Call('list', Const(1), Const(2)), Const(3), Const(4), Const(5)))),)))
check('[[[1, 2, 3], 4, 5]]', Suite((Call('return', Call('list', Call('list',
    Call('list', Const(1), Const(2), Const(3)), Const(4), Const(5)))),)))
check('[[[1, 2, 3, 4], 5]]', Suite((Call('return', Call('list', Call('list',
    Call('list', Const(1), Const(2), Const(3), Const(4)), Const(5)))),)))
check('[[[1, 2, 3, 4, 5]]]', Suite((Call('return', Call('list', Call('list',
    Call('list', Const(1), Const(2), Const(3), Const(4), Const(5))))),)))
check('[1, 2, 3, 4, [5]]', Suite((Call('return', Call('list', Const(1),
    Const(2), Const(3), Const(4), Call('list', Const(5)))),)))
check('[1, 2, 3, [4, 5]]', Suite((Call('return', Call('list', Const(1),
    Const(2), Const(3), Call('list', Const(4), Const(5)))),)))
check('[1, 2, [3, 4, 5]]', Suite((Call('return', Call('list', Const(1),
    Const(2), Call('list', Const(3), Const(4), Const(5)))),)))
check('[1, [2, 3, 4, 5]]', Suite((Call('return', Call('list', Const(1),
    Call('list', Const(2), Const(3), Const(4), Const(5)))),)))
check('[[1, 2, 3, 4, [5]]]', Suite((Call('return', Call('list', Call('list',
    Const(1), Const(2), Const(3), Const(4), Call('list', Const(5))))),)))
check('[[1, 2, 3, [4, 5]]]', Suite((Call('return', Call('list', Call('list',
    Const(1), Const(2), Const(3), Call('list', Const(4), Const(5))))),)))
check('[[1, 2, [3, 4, 5]]]', Suite((Call('return', Call('list', Call('list',
    Const(1), Const(2), Call('list', Const(3), Const(4), Const(5))))),)))
check('[[1, [2, 3, 4, 5]]]', Suite((Call('return', Call('list', Call('list',
    Const(1), Call('list', Const(2), Const(3), Const(4), Const(5))))),)))
check('x = (None)', Suite((Assign((Name('x'),), Const(None)), Call('return',
    Const(None)))))
check('x = (3, None)', Suite((Assign((Name('x'),), Call('tuple', Const(3),
    Const(None))), Call('return', Const(None)))))
check('x = (3, 4, None)', Suite((Assign((Name('x'),), Call('tuple', Const(3
    ), Const(4), Const(None))), Call('return', Const(None)))))
check('x = (3, 4, 5, None)', Suite((Assign((Name('x'),), Call('tuple',
    Const(3), Const(4), Const(5), Const(None))), Call('return', Const(None)))))
check('x = (3, 4, 5, 6, None)', Suite((Assign((Name('x'),), Call('tuple',
    Const(3), Const(4), Const(5), Const(6), Const(None))), Call('return',
    Const(None)))))
check('x = ((1, None), 2, 3, 4, 5, None)', Suite((Assign((Name('x'),), Call
    ('tuple', Call('tuple', Const(1), Const(None)), Const(2), Const(3),
    Const(4), Const(5), Const(None))), Call('return', Const(None)))))
check('x = ((1, 2, None), 3, 4, 5, None)', Suite((Assign((Name('x'),), Call
    ('tuple', Call('tuple', Const(1), Const(2), Const(None)), Const(3),
    Const(4), Const(5), Const(None))), Call('return', Const(None)))))
check('x = ((1, 2, 3, None), 4, 5, None)', Suite((Assign((Name('x'),), Call
    ('tuple', Call('tuple', Const(1), Const(2), Const(3), Const(None)),
    Const(4), Const(5), Const(None))), Call('return', Const(None)))))
check('x = ((1, 2, 3, 4, None), 5, None)', Suite((Assign((Name('x'),), Call
    ('tuple', Call('tuple', Const(1), Const(2), Const(3), Const(4), Const(
    None)), Const(5), Const(None))), Call('return', Const(None)))))
check('x = ((1, 2, 3, 4, 5, None), None)', Suite((Assign((Name('x'),), Call
    ('tuple', Call('tuple', Const(1), Const(2), Const(3), Const(4), Const(5
    ), Const(None)), Const(None))), Call('return', Const(None)))))
check('x = (((1, None), 2, 3, 4, 5, None), None)', Suite((Assign((Name('x')
    ,), Call('tuple', Call('tuple', Call('tuple', Const(1), Const(None)),
    Const(2), Const(3), Const(4), Const(5), Const(None)), Const(None))),
    Call('return', Const(None)))))
check('x = (((1, 2, None), 3, 4, 5, None), None)', Suite((Assign((Name('x')
    ,), Call('tuple', Call('tuple', Call('tuple', Const(1), Const(2), Const
    (None)), Const(3), Const(4), Const(5), Const(None)), Const(None))),
    Call('return', Const(None)))))
check('x = (((1, 2, 3, None), 4, 5, None), None)', Suite((Assign((Name('x')
    ,), Call('tuple', Call('tuple', Call('tuple', Const(1), Const(2), Const
    (3), Const(None)), Const(4), Const(5), Const(None)), Const(None))),
    Call('return', Const(None)))))
check('x = (((1, 2, 3, 4, None), 5, None), None)', Suite((Assign((Name('x')
    ,), Call('tuple', Call('tuple', Call('tuple', Const(1), Const(2), Const
    (3), Const(4), Const(None)), Const(5), Const(None)), Const(None))),
    Call('return', Const(None)))))
check('x = (((1, 2, 3, 4, 5, None), None), None)', Suite((Assign((Name('x')
    ,), Call('tuple', Call('tuple', Call('tuple', Const(1), Const(2), Const
    (3), Const(4), Const(5), Const(None)), Const(None)), Const(None))),
    Call('return', Const(None)))))
check('x = (1, 2, 3, 4, (5, None), None)', Suite((Assign((Name('x'),), Call
    ('tuple', Const(1), Const(2), Const(3), Const(4), Call('tuple', Const(5
    ), Const(None)), Const(None))), Call('return', Const(None)))))
check('x = (1, 2, 3, (4, 5, None), None)', Suite((Assign((Name('x'),), Call
    ('tuple', Const(1), Const(2), Const(3), Call('tuple', Const(4), Const(5
    ), Const(None)), Const(None))), Call('return', Const(None)))))
check('x = (1, 2, (3, 4, 5, None), None)', Suite((Assign((Name('x'),), Call
    ('tuple', Const(1), Const(2), Call('tuple', Const(3), Const(4), Const(5
    ), Const(None)), Const(None))), Call('return', Const(None)))))
check('x = (1, (2, 3, 4, 5, None), None)', Suite((Assign((Name('x'),), Call
    ('tuple', Const(1), Call('tuple', Const(2), Const(3), Const(4), Const(5
    ), Const(None)), Const(None))), Call('return', Const(None)))))
check('x = ((1, 2, 3, 4, (5, None), None), None)', Suite((Assign((Name('x')
    ,), Call('tuple', Call('tuple', Const(1), Const(2), Const(3), Const(4),
    Call('tuple', Const(5), Const(None)), Const(None)), Const(None))), Call
    ('return', Const(None)))))
check('x = ((1, 2, 3, (4, 5, None), None), None)', Suite((Assign((Name('x')
    ,), Call('tuple', Call('tuple', Const(1), Const(2), Const(3), Call(
    'tuple', Const(4), Const(5), Const(None)), Const(None)), Const(None))),
    Call('return', Const(None)))))
check('x = ((1, 2, (3, 4, 5, None), None), None)', Suite((Assign((Name('x')
    ,), Call('tuple', Call('tuple', Const(1), Const(2), Call('tuple', Const
    (3), Const(4), Const(5), Const(None)), Const(None)), Const(None))),
    Call('return', Const(None)))))
check('x = ((1, (2, 3, 4, 5, None), None), None)', Suite((Assign((Name('x')
    ,), Call('tuple', Call('tuple', Const(1), Call('tuple', Const(2), Const
    (3), Const(4), Const(5), Const(None)), Const(None)), Const(None))),
    Call('return', Const(None)))))
check('3\n    ', Suite((Call('return', Const(None)),)))
check('3\n    ', Suite((Call('return', Const(None)),)))
check('3\n    ', Suite((Call('return', Const(None)),)))
check('3\n    ', Suite((Call('return', Const(None)),)))
check('\n3', Suite((Call('return', Const(None)),)))
check('\n3', Suite((Call('return', Const(None)),)))
check('\n3', Suite((Call('return', Const(None)),)))
check('\n3', Suite((Call('return', Const(None)),)))
check('a', Suite((Call('return', Name('a')),)))
check('a.b', Suite((Call('return', Call('.', Name('a'), 'b')),)))
check('a.b.c', Suite((Call('return', Call('.', Call('.', Name('a'), 'b'),
    'c')),)))
check('a.b.c.d', Suite((Call('return', Call('.', Call('.', Call('.', Name(
    'a'), 'b'), 'c'), 'd')),)))
check('a.b.c.d.e', Suite((Call('return', Call('.', Call('.', Call('.', Call
    ('.', Name('a'), 'b'), 'c'), 'd'), 'e')),)))
check('a[1]', Suite((Call('return', Call('[.]', Name('a'), Const(1))),)))
check('a[1][2]', Suite((Call('return', Call('[.]', Call('[.]', Name('a'),
    Const(1)), Const(2))),)))
check('a[1][2][3]', Suite((Call('return', Call('[.]', Call('[.]', Call(
    '[.]', Name('a'), Const(1)), Const(2)), Const(3))),)))
check('a[1][2][3][4]', Suite((Call('return', Call('[.]', Call('[.]', Call(
    '[.]', Call('[.]', Name('a'), Const(1)), Const(2)), Const(3)), Const(4)
    )),)))
check('(9, None).stuff', Suite((Call('return', Call('.', Call('tuple',
    Const(9), Const(None)), 'stuff')),)))
check('((9, None), None).stuff', Suite((Call('return', Call('.', Call(
    'tuple', Call('tuple', Const(9), Const(None)), Const(None)), 'stuff')),)))
check('(((9, None), None), None).stuff', Suite((Call('return', Call('.',
    Call('tuple', Call('tuple', Call('tuple', Const(9), Const(None)), Const
    (None)), Const(None)), 'stuff')),)))
check('a[1]', Suite((Call('return', Call('[.]', Name('a'), Const(1))),)))
check('a["hey"]', Suite((Call('return', Call('[.]', Name('a'), Const('hey')
    )),)))
check('a[1:2]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(1), Const(2), Const(None)))),)))
check('a[:]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(None), Const(None), Const(None)))),)))
check('a[1:]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(1), Const(None), Const(None)))),)))
check('a[:1]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(None), Const(1), Const(None)))),)))
check('a[::]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(None), Const(None), Const(None)))),)))
check('a[1::]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(1), Const(None), Const(None)))),)))
check('a[:1:]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(None), Const(1), Const(None)))),)))
check('a[::1]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(None), Const(None), Const(1)))),)))
check('a[1:2:]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(1), Const(2), Const(None)))),)))
check('a[:1:2]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(None), Const(1), Const(2)))),)))
check('a[1::2]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(1), Const(None), Const(2)))),)))
check('a[1:2:3]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(1), Const(2), Const(3)))),)))
check('a[1,]', Suite((Call('return', Call('[.]', Name('a'), Const(1))),)))
check('a["hey",]', Suite((Call('return', Call('[.]', Name('a'), Const('hey'
    ))),)))
check('a[1:2,]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(1), Const(2), Const(None)))),)))
check('a[:,]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(None), Const(None), Const(None)))),)))
check('a[1:,]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(1), Const(None), Const(None)))),)))
check('a[:1,]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(None), Const(1), Const(None)))),)))
check('a[::,]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(None), Const(None), Const(None)))),)))
check('a[1::,]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(1), Const(None), Const(None)))),)))
check('a[:1:,]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(None), Const(1), Const(None)))),)))
check('a[::1,]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(None), Const(None), Const(1)))),)))
check('a[1:2:,]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(1), Const(2), Const(None)))),)))
check('a[:1:2,]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(None), Const(1), Const(2)))),)))
check('a[1::2,]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(1), Const(None), Const(2)))),)))
check('a[1:2:3,]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(1), Const(2), Const(3)))),)))
check('a[1,5]', Suite((Call('return', Call('[.]', Name('a'), Const(1),
    Const(5))),)))
check('a["hey",5]', Suite((Call('return', Call('[.]', Name('a'), Const(
    'hey'), Const(5))),)))
check('a[1:2,5]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(1), Const(2), Const(None)), Const(5))),)))
check('a[:,5]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(None), Const(None), Const(None)), Const(5))),)))
check('a[1:,5]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(1), Const(None), Const(None)), Const(5))),)))
check('a[:1,5]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(None), Const(1), Const(None)), Const(5))),)))
check('a[::,5]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(None), Const(None), Const(None)), Const(5))),)))
check('a[1::,5]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(1), Const(None), Const(None)), Const(5))),)))
check('a[:1:,5]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(None), Const(1), Const(None)), Const(5))),)))
check('a[::1,5]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(None), Const(None), Const(1)), Const(5))),)))
check('a[1:2:,5]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(1), Const(2), Const(None)), Const(5))),)))
check('a[:1:2,5]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(None), Const(1), Const(2)), Const(5))),)))
check('a[1::2,5]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(1), Const(None), Const(2)), Const(5))),)))
check('a[1:2:3,5]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(1), Const(2), Const(3)), Const(5))),)))
check('a[1,5,]', Suite((Call('return', Call('[.]', Name('a'), Const(1),
    Const(5))),)))
check('a["hey",5,]', Suite((Call('return', Call('[.]', Name('a'), Const(
    'hey'), Const(5))),)))
check('a[1:2,5,]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(1), Const(2), Const(None)), Const(5))),)))
check('a[:,5,]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(None), Const(None), Const(None)), Const(5))),)))
check('a[1:,5,]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(1), Const(None), Const(None)), Const(5))),)))
check('a[:1,5,]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(None), Const(1), Const(None)), Const(5))),)))
check('a[::,5,]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(None), Const(None), Const(None)), Const(5))),)))
check('a[1::,5,]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(1), Const(None), Const(None)), Const(5))),)))
check('a[:1:,5,]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(None), Const(1), Const(None)), Const(5))),)))
check('a[::1,5,]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(None), Const(None), Const(1)), Const(5))),)))
check('a[1:2:,5,]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(1), Const(2), Const(None)), Const(5))),)))
check('a[:1:2,5,]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(None), Const(1), Const(2)), Const(5))),)))
check('a[1::2,5,]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(1), Const(None), Const(2)), Const(5))),)))
check('a[1:2:3,5,]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(1), Const(2), Const(3)), Const(5))),)))
check('a[1,"a":"b"]', Suite((Call('return', Call('[.]', Name('a'), Const(1),
    Call('slice', Const('a'), Const('b'), Const(None)))),)))
check('a["hey","a":"b"]', Suite((Call('return', Call('[.]', Name('a'),
    Const('hey'), Call('slice', Const('a'), Const('b'), Const(None)))),)))
check('a[1:2,"a":"b"]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(1), Const(2), Const(None)), Call('slice', Const('a'),
    Const('b'), Const(None)))),)))
check('a[:,"a":"b"]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(None), Const(None), Const(None)), Call('slice', Const(
    'a'), Const('b'), Const(None)))),)))
check('a[1:,"a":"b"]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(1), Const(None), Const(None)), Call('slice', Const('a'),
    Const('b'), Const(None)))),)))
check('a[:1,"a":"b"]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(None), Const(1), Const(None)), Call('slice', Const('a'),
    Const('b'), Const(None)))),)))
check('a[::,"a":"b"]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(None), Const(None), Const(None)), Call('slice', Const(
    'a'), Const('b'), Const(None)))),)))
check('a[1::,"a":"b"]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(1), Const(None), Const(None)), Call('slice', Const('a'),
    Const('b'), Const(None)))),)))
check('a[:1:,"a":"b"]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(None), Const(1), Const(None)), Call('slice', Const('a'),
    Const('b'), Const(None)))),)))
check('a[::1,"a":"b"]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(None), Const(None), Const(1)), Call('slice', Const('a'),
    Const('b'), Const(None)))),)))
check('a[1:2:,"a":"b"]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(1), Const(2), Const(None)), Call('slice', Const('a'),
    Const('b'), Const(None)))),)))
check('a[:1:2,"a":"b"]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(None), Const(1), Const(2)), Call('slice', Const('a'),
    Const('b'), Const(None)))),)))
check('a[1::2,"a":"b"]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(1), Const(None), Const(2)), Call('slice', Const('a'),
    Const('b'), Const(None)))),)))
check('a[1:2:3,"a":"b"]', Suite((Call('return', Call('[.]', Name('a'), Call
    ('slice', Const(1), Const(2), Const(3)), Call('slice', Const('a'),
    Const('b'), Const(None)))),)))
check('a[1,"a":"b",]', Suite((Call('return', Call('[.]', Name('a'), Const(1
    ), Call('slice', Const('a'), Const('b'), Const(None)))),)))
check('a["hey","a":"b",]', Suite((Call('return', Call('[.]', Name('a'),
    Const('hey'), Call('slice', Const('a'), Const('b'), Const(None)))),)))
check('a[1:2,"a":"b",]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(1), Const(2), Const(None)), Call('slice', Const('a'),
    Const('b'), Const(None)))),)))
check('a[:,"a":"b",]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(None), Const(None), Const(None)), Call('slice', Const(
    'a'), Const('b'), Const(None)))),)))
check('a[1:,"a":"b",]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(1), Const(None), Const(None)), Call('slice', Const('a'),
    Const('b'), Const(None)))),)))
check('a[:1,"a":"b",]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(None), Const(1), Const(None)), Call('slice', Const('a'),
    Const('b'), Const(None)))),)))
check('a[::,"a":"b",]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(None), Const(None), Const(None)), Call('slice', Const(
    'a'), Const('b'), Const(None)))),)))
check('a[1::,"a":"b",]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(1), Const(None), Const(None)), Call('slice', Const('a'),
    Const('b'), Const(None)))),)))
check('a[:1:,"a":"b",]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(None), Const(1), Const(None)), Call('slice', Const('a'),
    Const('b'), Const(None)))),)))
check('a[::1,"a":"b",]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(None), Const(None), Const(1)), Call('slice', Const('a'),
    Const('b'), Const(None)))),)))
check('a[1:2:,"a":"b",]', Suite((Call('return', Call('[.]', Name('a'), Call
    ('slice', Const(1), Const(2), Const(None)), Call('slice', Const('a'),
    Const('b'), Const(None)))),)))
check('a[:1:2,"a":"b",]', Suite((Call('return', Call('[.]', Name('a'), Call
    ('slice', Const(None), Const(1), Const(2)), Call('slice', Const('a'),
    Const('b'), Const(None)))),)))
check('a[1::2,"a":"b",]', Suite((Call('return', Call('[.]', Name('a'), Call
    ('slice', Const(1), Const(None), Const(2)), Call('slice', Const('a'),
    Const('b'), Const(None)))),)))
check('a[1:2:3,"a":"b",]', Suite((Call('return', Call('[.]', Name('a'),
    Call('slice', Const(1), Const(2), Const(3)), Call('slice', Const('a'),
    Const('b'), Const(None)))),)))
check('a[1,5,6]', Suite((Call('return', Call('[.]', Name('a'), Const(1),
    Const(5), Const(6))),)))
check('a["hey",5,6]', Suite((Call('return', Call('[.]', Name('a'), Const(
    'hey'), Const(5), Const(6))),)))
check('a[1:2,5,6]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(1), Const(2), Const(None)), Const(5), Const(6))),)))
check('a[:,5,6]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(None), Const(None), Const(None)), Const(5), Const(6))),)))
check('a[1:,5,6]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(1), Const(None), Const(None)), Const(5), Const(6))),)))
check('a[:1,5,6]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(None), Const(1), Const(None)), Const(5), Const(6))),)))
check('a[::,5,6]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(None), Const(None), Const(None)), Const(5), Const(6))),)))
check('a[1::,5,6]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(1), Const(None), Const(None)), Const(5), Const(6))),)))
check('a[:1:,5,6]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(None), Const(1), Const(None)), Const(5), Const(6))),)))
check('a[::1,5,6]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(None), Const(None), Const(1)), Const(5), Const(6))),)))
check('a[1:2:,5,6]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(1), Const(2), Const(None)), Const(5), Const(6))),)))
check('a[:1:2,5,6]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(None), Const(1), Const(2)), Const(5), Const(6))),)))
check('a[1::2,5,6]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(1), Const(None), Const(2)), Const(5), Const(6))),)))
check('a[1:2:3,5,6]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(1), Const(2), Const(3)), Const(5), Const(6))),)))
check('a[1,5,6,]', Suite((Call('return', Call('[.]', Name('a'), Const(1),
    Const(5), Const(6))),)))
check('a["hey",5,6,]', Suite((Call('return', Call('[.]', Name('a'), Const(
    'hey'), Const(5), Const(6))),)))
check('a[1:2,5,6,]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(1), Const(2), Const(None)), Const(5), Const(6))),)))
check('a[:,5,6,]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(None), Const(None), Const(None)), Const(5), Const(6))),)))
check('a[1:,5,6,]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(1), Const(None), Const(None)), Const(5), Const(6))),)))
check('a[:1,5,6,]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(None), Const(1), Const(None)), Const(5), Const(6))),)))
check('a[::,5,6,]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(None), Const(None), Const(None)), Const(5), Const(6))),)))
check('a[1::,5,6,]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(1), Const(None), Const(None)), Const(5), Const(6))),)))
check('a[:1:,5,6,]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(None), Const(1), Const(None)), Const(5), Const(6))),)))
check('a[::1,5,6,]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(None), Const(None), Const(1)), Const(5), Const(6))),)))
check('a[1:2:,5,6,]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(1), Const(2), Const(None)), Const(5), Const(6))),)))
check('a[:1:2,5,6,]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(None), Const(1), Const(2)), Const(5), Const(6))),)))
check('a[1::2,5,6,]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(1), Const(None), Const(2)), Const(5), Const(6))),)))
check('a[1:2:3,5,6,]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(1), Const(2), Const(3)), Const(5), Const(6))),)))
check('a[1:[2]:3,[],5,6,]', Suite((Call('return', Call('[.]', Name('a'),
    Call('slice', Const(1), Call('list', Const(2)), Const(3)), Call('list'),
    Const(5), Const(6))),)))
check('a[1:[[2]]:3,[[]],5,6,]', Suite((Call('return', Call('[.]', Name('a'),
    Call('slice', Const(1), Call('list', Call('list', Const(2))), Const(3)),
    Call('list', Call('list')), Const(5), Const(6))),)))
check('a[2].three', Suite((Call('return', Call('.', Call('[.]', Name('a'),
    Const(2)), 'three')),)))
check('a.three', Suite((Call('return', Call('.', Name('a'), 'three')),)))
check('a[2]', Suite((Call('return', Call('[.]', Name('a'), Const(2))),)))
check('a.three[2]', Suite((Call('return', Call('[.]', Call('.', Name('a'),
    'three'), Const(2))),)))
check('x and y', Suite((Call('return', Call('and', Name('x'), Name('y'))),)))
check('x and y and z', Suite((Call('return', Call('and', Name('x'), Call(
    'and', Name('y'), Name('z')))),)))
check('x and y and z and w', Suite((Call('return', Call('and', Name('x'),
    Call('and', Name('y'), Call('and', Name('z'), Name('w'))))),)))
check('not x', Suite((Call('return', Call('not', Name('x'))),)))
check('not x and y', Suite((Call('return', Call('and', Call('not', Name('x'
    )), Name('y'))),)))
check('x or y', Suite((Call('return', Call('or', Name('x'), Name('y'))),)))
check('x or y and z', Suite((Call('return', Call('or', Name('x'), Call(
    'and', Name('y'), Name('z')))),)))
check('x or y or z', Suite((Call('return', Call('or', Name('x'), Call('or',
    Name('y'), Name('z')))),)))
check('not x or y and z', Suite((Call('return', Call('or', Call('not', Name
    ('x')), Call('and', Name('y'), Name('z')))),)))
check('x or not y and z', Suite((Call('return', Call('or', Name('x'), Call(
    'and', Call('not', Name('y')), Name('z')))),)))
check('x or y and not z', Suite((Call('return', Call('or', Name('x'), Call(
    'and', Name('y'), Call('not', Name('z'))))),)))
check('not x or not y and z', Suite((Call('return', Call('or', Call('not',
    Name('x')), Call('and', Call('not', Name('y')), Name('z')))),)))
check('not x or y and not z', Suite((Call('return', Call('or', Call('not',
    Name('x')), Call('and', Name('y'), Call('not', Name('z'))))),)))
check('x or not y and not z', Suite((Call('return', Call('or', Name('x'),
    Call('and', Call('not', Name('y')), Call('not', Name('z'))))),)))
check('not x or not y and not z', Suite((Call('return', Call('or', Call(
    'not', Name('x')), Call('and', Call('not', Name('y')), Call('not', Name
    ('z'))))),)))
check('x and y or z', Suite((Call('return', Call('or', Call('and', Name('x'
    ), Name('y')), Name('z'))),)))
check('not x and y or z', Suite((Call('return', Call('or', Call('and', Call
    ('not', Name('x')), Name('y')), Name('z'))),)))
check('x and not y or z', Suite((Call('return', Call('or', Call('and', Name
    ('x'), Call('not', Name('y'))), Name('z'))),)))
check('x and y or not z', Suite((Call('return', Call('or', Call('and', Name
    ('x'), Name('y')), Call('not', Name('z')))),)))
check('not x and not y or z', Suite((Call('return', Call('or', Call('and',
    Call('not', Name('x')), Call('not', Name('y'))), Name('z'))),)))
check('not x and y or not z', Suite((Call('return', Call('or', Call('and',
    Call('not', Name('x')), Name('y')), Call('not', Name('z')))),)))
check('x and not y or not z', Suite((Call('return', Call('or', Call('and',
    Name('x'), Call('not', Name('y'))), Call('not', Name('z')))),)))
check('x < y', Suite((Call('return', Call('<', Name('x'), Name('y'))),)))
check('x > y', Suite((Call('return', Call('>', Name('x'), Name('y'))),)))
check('x == y', Suite((Call('return', Call('==', Name('x'), Name('y'))),)))
check('x >= y', Suite((Call('return', Call('>=', Name('x'), Name('y'))),)))
check('x <= y', Suite((Call('return', Call('<=', Name('x'), Name('y'))),)))
check('x != y', Suite((Call('return', Call('!=', Name('x'), Name('y'))),)))
check('x in y', Suite((Call('return', Call('in', Name('x'), Name('y'))),)))
check('x not in y', Suite((Call('return', Call('not-in', Name('x'), Name(
    'y'))),)))
check('1 < y < 2', Suite((Call('return', Call('and', Call('<', Const(1),
    Name('y')), Call('<', Name('y'), Const(2)))),)))
check('1 < y == 2', Suite((Call('return', Call('and', Call('<', Const(1),
    Name('y')), Call('==', Name('y'), Const(2)))),)))
check('(x, None) < y', Suite((Call('return', Call('<', Call('tuple', Name(
    'x'), Const(None)), Name('y'))),)))
check('(x, None) > y', Suite((Call('return', Call('>', Call('tuple', Name(
    'x'), Const(None)), Name('y'))),)))
check('(x, None) == y', Suite((Call('return', Call('==', Call('tuple', Name
    ('x'), Const(None)), Name('y'))),)))
check('(x, None) >= y', Suite((Call('return', Call('>=', Call('tuple', Name
    ('x'), Const(None)), Name('y'))),)))
check('(x, None) <= y', Suite((Call('return', Call('<=', Call('tuple', Name
    ('x'), Const(None)), Name('y'))),)))
check('(x, None) != y', Suite((Call('return', Call('!=', Call('tuple', Name
    ('x'), Const(None)), Name('y'))),)))
check('(x, None) in y', Suite((Call('return', Call('in', Call('tuple', Name
    ('x'), Const(None)), Name('y'))),)))
check('(x, None) not in y', Suite((Call('return', Call('not-in', Call(
    'tuple', Name('x'), Const(None)), Name('y'))),)))
check('(1, None) < y < 2', Suite((Call('return', Call('and', Call('<', Call
    ('tuple', Const(1), Const(None)), Name('y')), Call('<', Name('y'),
    Const(2)))),)))
check('(1, None) < y == 2', Suite((Call('return', Call('and', Call('<',
    Call('tuple', Const(1), Const(None)), Name('y')), Call('==', Name('y'),
    Const(2)))),)))
check('x < (y, None)', Suite((Call('return', Call('<', Name('x'), Call(
    'tuple', Name('y'), Const(None)))),)))
check('x > (y, None)', Suite((Call('return', Call('>', Name('x'), Call(
    'tuple', Name('y'), Const(None)))),)))
check('x == (y, None)', Suite((Call('return', Call('==', Name('x'), Call(
    'tuple', Name('y'), Const(None)))),)))
check('x >= (y, None)', Suite((Call('return', Call('>=', Name('x'), Call(
    'tuple', Name('y'), Const(None)))),)))
check('x <= (y, None)', Suite((Call('return', Call('<=', Name('x'), Call(
    'tuple', Name('y'), Const(None)))),)))
check('x != (y, None)', Suite((Call('return', Call('!=', Name('x'), Call(
    'tuple', Name('y'), Const(None)))),)))
check('x in (y, None)', Suite((Call('return', Call('in', Name('x'), Call(
    'tuple', Name('y'), Const(None)))),)))
check('x not in (y, None)', Suite((Call('return', Call('not-in', Name('x'),
    Call('tuple', Name('y'), Const(None)))),)))
check('1 < (y, None) < 2', Suite((Call('return', Call('and', Call('<',
    Const(1), Call('tuple', Name('y'), Const(None))), Call('<', Call(
    'tuple', Name('y'), Const(None)), Const(2)))),)))
check('1 < (y, None) == 2', Suite((Call('return', Call('and', Call('<',
    Const(1), Call('tuple', Name('y'), Const(None))), Call('==', Call(
    'tuple', Name('y'), Const(None)), Const(2)))),)))
check('1 < y < (2, None)', Suite((Call('return', Call('and', Call('<',
    Const(1), Name('y')), Call('<', Name('y'), Call('tuple', Const(2),
    Const(None))))),)))
check('1 < y == (2, None)', Suite((Call('return', Call('and', Call('<',
    Const(1), Name('y')), Call('==', Name('y'), Call('tuple', Const(2),
    Const(None))))),)))
check('(x, None) < (y, None)', Suite((Call('return', Call('<', Call('tuple',
    Name('x'), Const(None)), Call('tuple', Name('y'), Const(None)))),)))
check('(x, None) > (y, None)', Suite((Call('return', Call('>', Call('tuple',
    Name('x'), Const(None)), Call('tuple', Name('y'), Const(None)))),)))
check('(x, None) == (y, None)', Suite((Call('return', Call('==', Call(
    'tuple', Name('x'), Const(None)), Call('tuple', Name('y'), Const(None))
    )),)))
check('(x, None) >= (y, None)', Suite((Call('return', Call('>=', Call(
    'tuple', Name('x'), Const(None)), Call('tuple', Name('y'), Const(None))
    )),)))
check('(x, None) <= (y, None)', Suite((Call('return', Call('<=', Call(
    'tuple', Name('x'), Const(None)), Call('tuple', Name('y'), Const(None))
    )),)))
check('(x, None) != (y, None)', Suite((Call('return', Call('!=', Call(
    'tuple', Name('x'), Const(None)), Call('tuple', Name('y'), Const(None))
    )),)))
check('(x, None) in (y, None)', Suite((Call('return', Call('in', Call(
    'tuple', Name('x'), Const(None)), Call('tuple', Name('y'), Const(None))
    )),)))
check('(x, None) not in (y, None)', Suite((Call('return', Call('not-in',
    Call('tuple', Name('x'), Const(None)), Call('tuple', Name('y'), Const(
    None)))),)))
check('(1, None) < (y, None) < 2', Suite((Call('return', Call('and', Call(
    '<', Call('tuple', Const(1), Const(None)), Call('tuple', Name('y'),
    Const(None))), Call('<', Call('tuple', Name('y'), Const(None)), Const(2
    )))),)))
check('(1, None) < (y, None) == 2', Suite((Call('return', Call('and', Call(
    '<', Call('tuple', Const(1), Const(None)), Call('tuple', Name('y'),
    Const(None))), Call('==', Call('tuple', Name('y'), Const(None)), Const(
    2)))),)))
check('(1, None) < y < (2, None)', Suite((Call('return', Call('and', Call(
    '<', Call('tuple', Const(1), Const(None)), Name('y')), Call('<', Name(
    'y'), Call('tuple', Const(2), Const(None))))),)))
check('(1, None) < y == (2, None)', Suite((Call('return', Call('and', Call(
    '<', Call('tuple', Const(1), Const(None)), Name('y')), Call('==', Name(
    'y'), Call('tuple', Const(2), Const(None))))),)))
check('x + y', Suite((Call('return', Call('+', Name('x'), Name('y'))),)))
check('x + y + z', Suite((Call('return', Call('+', Call('+', Name('x'),
    Name('y')), Name('z'))),)))
check('x + y + z + w', Suite((Call('return', Call('+', Call('+', Call('+',
    Name('x'), Name('y')), Name('z')), Name('w'))),)))
check('x - y', Suite((Call('return', Call('-', Name('x'), Name('y'))),)))
check('x - y - z', Suite((Call('return', Call('-', Call('-', Name('x'),
    Name('y')), Name('z'))),)))
check('x - y - z - w', Suite((Call('return', Call('-', Call('-', Call('-',
    Name('x'), Name('y')), Name('z')), Name('w'))),)))
check('x - y + z - w', Suite((Call('return', Call('-', Call('+', Call('-',
    Name('x'), Name('y')), Name('z')), Name('w'))),)))
check('x * y', Suite((Call('return', Call('*', Name('x'), Name('y'))),)))
check('x * y * z', Suite((Call('return', Call('*', Call('*', Name('x'),
    Name('y')), Name('z'))),)))
check('x * y * z * w', Suite((Call('return', Call('*', Call('*', Call('*',
    Name('x'), Name('y')), Name('z')), Name('w'))),)))
check('x * y - z * w', Suite((Call('return', Call('-', Call('*', Name('x'),
    Name('y')), Call('*', Name('z'), Name('w')))),)))
check('x / y', Suite((Call('return', Call('/', Name('x'), Name('y'))),)))
check('x / y / z', Suite((Call('return', Call('/', Call('/', Name('x'),
    Name('y')), Name('z'))),)))
check('x / y / z / w', Suite((Call('return', Call('/', Call('/', Call('/',
    Name('x'), Name('y')), Name('z')), Name('w'))),)))
check('x / y * z / w', Suite((Call('return', Call('/', Call('*', Call('/',
    Name('x'), Name('y')), Name('z')), Name('w'))),)))
check('x % y', Suite((Call('return', Call('%', Name('x'), Name('y'))),)))
check('x % y % z', Suite((Call('return', Call('%', Call('%', Name('x'),
    Name('y')), Name('z'))),)))
check('x % y % z % w', Suite((Call('return', Call('%', Call('%', Call('%',
    Name('x'), Name('y')), Name('z')), Name('w'))),)))
check('x % y / z % w', Suite((Call('return', Call('%', Call('/', Call('%',
    Name('x'), Name('y')), Name('z')), Name('w'))),)))
check('x // y', Suite((Call('return', Call('//', Name('x'), Name('y'))),)))
check('x // y // z', Suite((Call('return', Call('//', Call('//', Name('x'),
    Name('y')), Name('z'))),)))
check('x // y // z // w', Suite((Call('return', Call('//', Call('//', Call(
    '//', Name('x'), Name('y')), Name('z')), Name('w'))),)))
check('x // y % z // w', Suite((Call('return', Call('//', Call('%', Call(
    '//', Name('x'), Name('y')), Name('z')), Name('w'))),)))
check('+x', Suite((Call('return', Call('u+', Name('x'))),)))
check('-x', Suite((Call('return', Call('u-', Name('x'))),)))
check('++x', Suite((Call('return', Call('u+', Call('u+', Name('x')))),)))
check('+-x', Suite((Call('return', Call('u+', Call('u-', Name('x')))),)))
check('-+x', Suite((Call('return', Call('u-', Call('u+', Name('x')))),)))
check('--x', Suite((Call('return', Call('u-', Call('u-', Name('x')))),)))
check('+x + y', Suite((Call('return', Call('+', Call('u+', Name('x')), Name
    ('y'))),)))
check('-x + y', Suite((Call('return', Call('+', Call('u-', Name('x')), Name
    ('y'))),)))
check('++x + y', Suite((Call('return', Call('+', Call('u+', Call('u+', Name
    ('x'))), Name('y'))),)))
check('+-x + y', Suite((Call('return', Call('+', Call('u+', Call('u-', Name
    ('x'))), Name('y'))),)))
check('-+x + y', Suite((Call('return', Call('+', Call('u-', Call('u+', Name
    ('x'))), Name('y'))),)))
check('--x + y', Suite((Call('return', Call('+', Call('u-', Call('u-', Name
    ('x'))), Name('y'))),)))
check('x + +x', Suite((Call('return', Call('+', Name('x'), Call('u+', Name(
    'x')))),)))
check('x + -x', Suite((Call('return', Call('+', Name('x'), Call('u-', Name(
    'x')))),)))
check('x + ++x', Suite((Call('return', Call('+', Name('x'), Call('u+', Call
    ('u+', Name('x'))))),)))
check('x + +-x', Suite((Call('return', Call('+', Name('x'), Call('u+', Call
    ('u-', Name('x'))))),)))
check('x + -+x', Suite((Call('return', Call('+', Name('x'), Call('u-', Call
    ('u+', Name('x'))))),)))
check('x + --x', Suite((Call('return', Call('+', Name('x'), Call('u-', Call
    ('u-', Name('x'))))),)))
check('x ** y', Suite((Call('return', Call('**', Name('x'), Name('y'))),)))
check('x ** y ** z', Suite((Call('return', Call('**', Name('x'), Call('**',
    Name('y'), Name('z')))),)))
check('x ** y ** z ** w', Suite((Call('return', Call('**', Name('x'), Call(
    '**', Name('y'), Call('**', Name('z'), Name('w'))))),)))
check('x ** y // z ** w', Suite((Call('return', Call('//', Call('**', Name(
    'x'), Name('y')), Call('**', Name('z'), Name('w')))),)))
check('x.y**2', Suite((Call('return', Call('**', Call('.', Name('x'), 'y'),
    Const(2))),)))
check('f(None)', Suite((Call('return', Call(Name('f'), Const(None))),)))
check('f(x, None)', Suite((Call('return', Call(Name('f'), Name('x'), Const(
    None))),)))
check('f(x, y, None)', Suite((Call('return', Call(Name('f'), Name('x'),
    Name('y'), Const(None))),)))
check('f(x, y, z, None)', Suite((Call('return', Call(Name('f'), Name('x'),
    Name('y'), Name('z'), Const(None))),)))
check('f(x=1)', Suite((Call('return', CallKeyword(Name('f'), (), (('x',
    Const(1)),))),)))
check('f(x, y=1)', Suite((Call('return', CallKeyword(Name('f'), (Name('x'),
    ), (('y', Const(1)),))),)))
check('f(x, y, z=1)', Suite((Call('return', CallKeyword(Name('f'), (Name(
    'x'), Name('y')), (('z', Const(1)),))),)))
check('x = 1; x', Suite((Assign((Name('x'),), Const(1)), Name('x'), Call(
    'return', Const(None)))))
check('x = 1; x;', Suite((Assign((Name('x'),), Const(1)), Name('x'), Call(
    'return', Const(None)))))
check('x, = 1; x', Suite((Assign((Unpack((Name('x'),)),), Const(1)), Name(
    'x'), Call('return', Const(None)))))
check('x, y = 1; x', Suite((Assign((Unpack((Name('x'), Name('y'))),), Const
    (1)), Name('x'), Call('return', Const(None)))))
check('x, y, = 1; x', Suite((Assign((Unpack((Name('x'), Name('y'))),),
    Const(1)), Name('x'), Call('return', Const(None)))))
check('x, y, z = 1; x', Suite((Assign((Unpack((Name('x'), Name('y'), Name(
    'z'))),), Const(1)), Name('x'), Call('return', Const(None)))))
check('x, y, z, = 1; x', Suite((Assign((Unpack((Name('x'), Name('y'), Name(
    'z'))),), Const(1)), Name('x'), Call('return', Const(None)))))
check('False', Suite((Call('return', Const(False)),)))
check('True', Suite((Call('return', Const(True)),)))
check('not x', Suite((Call('return', Call('not', Name('x'))),)))
check('not x and not y', Suite((Call('return', Call('and', Call('not', Name
    ('x')), Call('not', Name('y')))),)))
check('not x and not y and not z', Suite((Call('return', Call('and', Call(
    'not', Name('x')), Call('and', Call('not', Name('y')), Call('not', Name
    ('z'))))),)))
check('not x and not y and not z', Suite((Call('return', Call('and', Call(
    'not', Name('x')), Call('and', Call('not', Name('y')), Call('not', Name
    ('z'))))),)))
check('not x and not y and not z', Suite((Call('return', Call('and', Call(
    'not', Name('x')), Call('and', Call('not', Name('y')), Call('not', Name
    ('z'))))),)))
check('not x or not y', Suite((Call('return', Call('or', Call('not', Name(
    'x')), Call('not', Name('y')))),)))
check('not x or not y or not z', Suite((Call('return', Call('or', Call(
    'not', Name('x')), Call('or', Call('not', Name('y')), Call('not', Name(
    'z'))))),)))
check('not x or not y or not z', Suite((Call('return', Call('or', Call(
    'not', Name('x')), Call('or', Call('not', Name('y')), Call('not', Name(
    'z'))))),)))
check('not x or not y or not z', Suite((Call('return', Call('or', Call(
    'not', Name('x')), Call('or', Call('not', Name('y')), Call('not', Name(
    'z'))))),)))
check('(not x or not y, None) and not z', Suite((Call('return', Call('and',
    Call('tuple', Call('or', Call('not', Name('x')), Call('not', Name('y'))
    ), Const(None)), Call('not', Name('z')))),)))
check('not x and (not y or not z, None)', Suite((Call('return', Call('and',
    Call('not', Name('x')), Call('tuple', Call('or', Call('not', Name('y')),
    Call('not', Name('z'))), Const(None)))),)))
check('not x(1, None)', Suite((Call('return', Call('not', Call(Name('x'),
    Const(1), Const(None)))),)))
check('not x(1, None) and not y(2, None)', Suite((Call('return', Call('and',
    Call('not', Call(Name('x'), Const(1), Const(None))), Call('not', Call(
    Name('y'), Const(2), Const(None))))),)))
check('not x(1, None) and not y(2, None) and not z(3, None)', Suite((Call(
    'return', Call('and', Call('not', Call(Name('x'), Const(1), Const(None)
    )), Call('and', Call('not', Call(Name('y'), Const(2), Const(None))),
    Call('not', Call(Name('z'), Const(3), Const(None)))))),)))
check('not x(1, None) and not y(2, None) and not z(3, None)', Suite((Call(
    'return', Call('and', Call('not', Call(Name('x'), Const(1), Const(None)
    )), Call('and', Call('not', Call(Name('y'), Const(2), Const(None))),
    Call('not', Call(Name('z'), Const(3), Const(None)))))),)))
check('not x(1, None) and not y(2, None) and not z(3, None)', Suite((Call(
    'return', Call('and', Call('not', Call(Name('x'), Const(1), Const(None)
    )), Call('and', Call('not', Call(Name('y'), Const(2), Const(None))),
    Call('not', Call(Name('z'), Const(3), Const(None)))))),)))
check('not x(1, None) or not y(2, None)', Suite((Call('return', Call('or',
    Call('not', Call(Name('x'), Const(1), Const(None))), Call('not', Call(
    Name('y'), Const(2), Const(None))))),)))
check('not x(1, None) or not y(2, None) or not z(3, None)', Suite((Call(
    'return', Call('or', Call('not', Call(Name('x'), Const(1), Const(None))
    ), Call('or', Call('not', Call(Name('y'), Const(2), Const(None))), Call
    ('not', Call(Name('z'), Const(3), Const(None)))))),)))
check('not x(1, None) or not y(2, None) or not z(3, None)', Suite((Call(
    'return', Call('or', Call('not', Call(Name('x'), Const(1), Const(None))
    ), Call('or', Call('not', Call(Name('y'), Const(2), Const(None))), Call
    ('not', Call(Name('z'), Const(3), Const(None)))))),)))
check('not x(1, None) or not y(2, None) or not z(3, None)', Suite((Call(
    'return', Call('or', Call('not', Call(Name('x'), Const(1), Const(None))
    ), Call('or', Call('not', Call(Name('y'), Const(2), Const(None))), Call
    ('not', Call(Name('z'), Const(3), Const(None)))))),)))
check('(not x(1, None) or not y(2, None), None) and not z(3, None)', Suite(
    (Call('return', Call('and', Call('tuple', Call('or', Call('not', Call(
    Name('x'), Const(1), Const(None))), Call('not', Call(Name('y'), Const(2
    ), Const(None)))), Const(None)), Call('not', Call(Name('z'), Const(3),
    Const(None))))),)))
check('not x(1, None) and (not y(2, None) or not z(3, None), None)', Suite(
    (Call('return', Call('and', Call('not', Call(Name('x'), Const(1), Const
    (None))), Call('tuple', Call('or', Call('not', Call(Name('y'), Const(2),
    Const(None))), Call('not', Call(Name('z'), Const(3), Const(None)))),
    Const(None)))),)))
check('not x.a', Suite((Call('return', Call('not', Call('.', Name('x'), 'a'
    ))),)))
check('not x.a and not y.b', Suite((Call('return', Call('and', Call('not',
    Call('.', Name('x'), 'a')), Call('not', Call('.', Name('y'), 'b')))),)))
check('not x.a and not y.b and not z.c', Suite((Call('return', Call('and',
    Call('not', Call('.', Name('x'), 'a')), Call('and', Call('not', Call(
    '.', Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check('not x.a and not y.b and not z.c', Suite((Call('return', Call('and',
    Call('not', Call('.', Name('x'), 'a')), Call('and', Call('not', Call(
    '.', Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check('not x.a and not y.b and not z.c', Suite((Call('return', Call('and',
    Call('not', Call('.', Name('x'), 'a')), Call('and', Call('not', Call(
    '.', Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check('not x.a or not y.b', Suite((Call('return', Call('or', Call('not',
    Call('.', Name('x'), 'a')), Call('not', Call('.', Name('y'), 'b')))),)))
check('not x.a or not y.b or not z.c', Suite((Call('return', Call('or',
    Call('not', Call('.', Name('x'), 'a')), Call('or', Call('not', Call('.',
    Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check('not x.a or not y.b or not z.c', Suite((Call('return', Call('or',
    Call('not', Call('.', Name('x'), 'a')), Call('or', Call('not', Call('.',
    Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check('not x.a or not y.b or not z.c', Suite((Call('return', Call('or',
    Call('not', Call('.', Name('x'), 'a')), Call('or', Call('not', Call('.',
    Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check('(not x.a or not y.b, None) and not z.c', Suite((Call('return', Call(
    'and', Call('tuple', Call('or', Call('not', Call('.', Name('x'), 'a')),
    Call('not', Call('.', Name('y'), 'b'))), Const(None)), Call('not', Call
    ('.', Name('z'), 'c')))),)))
check('not x.a and (not y.b or not z.c, None)', Suite((Call('return', Call(
    'and', Call('not', Call('.', Name('x'), 'a')), Call('tuple', Call('or',
    Call('not', Call('.', Name('y'), 'b')), Call('not', Call('.', Name('z'),
    'c'))), Const(None)))),)))
check('False', Suite((Call('return', Const(False)),)))
check('True', Suite((Call('return', Const(True)),)))
check('not x', Suite((Call('return', Call('not', Name('x'))),)))
check('not x and not y', Suite((Call('return', Call('and', Call('not', Name
    ('x')), Call('not', Name('y')))),)))
check('not x and not y and not z', Suite((Call('return', Call('and', Call(
    'not', Name('x')), Call('and', Call('not', Name('y')), Call('not', Name
    ('z'))))),)))
check('not x and not y and not z', Suite((Call('return', Call('and', Call(
    'not', Name('x')), Call('and', Call('not', Name('y')), Call('not', Name
    ('z'))))),)))
check('not x and not y and not z', Suite((Call('return', Call('and', Call(
    'not', Name('x')), Call('and', Call('not', Name('y')), Call('not', Name
    ('z'))))),)))
check('not x or not y', Suite((Call('return', Call('or', Call('not', Name(
    'x')), Call('not', Name('y')))),)))
check('not x or not y or not z', Suite((Call('return', Call('or', Call(
    'not', Name('x')), Call('or', Call('not', Name('y')), Call('not', Name(
    'z'))))),)))
check('not x or not y or not z', Suite((Call('return', Call('or', Call(
    'not', Name('x')), Call('or', Call('not', Name('y')), Call('not', Name(
    'z'))))),)))
check('not x or not y or not z', Suite((Call('return', Call('or', Call(
    'not', Name('x')), Call('or', Call('not', Name('y')), Call('not', Name(
    'z'))))),)))
check('(not x or not y, None) and not z', Suite((Call('return', Call('and',
    Call('tuple', Call('or', Call('not', Name('x')), Call('not', Name('y'))
    ), Const(None)), Call('not', Name('z')))),)))
check('not x and (not y or not z, None)', Suite((Call('return', Call('and',
    Call('not', Name('x')), Call('tuple', Call('or', Call('not', Name('y')),
    Call('not', Name('z'))), Const(None)))),)))
check('not x(1, None)', Suite((Call('return', Call('not', Call(Name('x'),
    Const(1), Const(None)))),)))
check('not x(1, None) and not y(2, None)', Suite((Call('return', Call('and',
    Call('not', Call(Name('x'), Const(1), Const(None))), Call('not', Call(
    Name('y'), Const(2), Const(None))))),)))
check('not x(1, None) and not y(2, None) and not z(3, None)', Suite((Call(
    'return', Call('and', Call('not', Call(Name('x'), Const(1), Const(None)
    )), Call('and', Call('not', Call(Name('y'), Const(2), Const(None))),
    Call('not', Call(Name('z'), Const(3), Const(None)))))),)))
check('not x(1, None) and not y(2, None) and not z(3, None)', Suite((Call(
    'return', Call('and', Call('not', Call(Name('x'), Const(1), Const(None)
    )), Call('and', Call('not', Call(Name('y'), Const(2), Const(None))),
    Call('not', Call(Name('z'), Const(3), Const(None)))))),)))
check('not x(1, None) and not y(2, None) and not z(3, None)', Suite((Call(
    'return', Call('and', Call('not', Call(Name('x'), Const(1), Const(None)
    )), Call('and', Call('not', Call(Name('y'), Const(2), Const(None))),
    Call('not', Call(Name('z'), Const(3), Const(None)))))),)))
check('not x(1, None) or not y(2, None)', Suite((Call('return', Call('or',
    Call('not', Call(Name('x'), Const(1), Const(None))), Call('not', Call(
    Name('y'), Const(2), Const(None))))),)))
check('not x(1, None) or not y(2, None) or not z(3, None)', Suite((Call(
    'return', Call('or', Call('not', Call(Name('x'), Const(1), Const(None))
    ), Call('or', Call('not', Call(Name('y'), Const(2), Const(None))), Call
    ('not', Call(Name('z'), Const(3), Const(None)))))),)))
check('not x(1, None) or not y(2, None) or not z(3, None)', Suite((Call(
    'return', Call('or', Call('not', Call(Name('x'), Const(1), Const(None))
    ), Call('or', Call('not', Call(Name('y'), Const(2), Const(None))), Call
    ('not', Call(Name('z'), Const(3), Const(None)))))),)))
check('not x(1, None) or not y(2, None) or not z(3, None)', Suite((Call(
    'return', Call('or', Call('not', Call(Name('x'), Const(1), Const(None))
    ), Call('or', Call('not', Call(Name('y'), Const(2), Const(None))), Call
    ('not', Call(Name('z'), Const(3), Const(None)))))),)))
check('(not x(1, None) or not y(2, None), None) and not z(3, None)', Suite(
    (Call('return', Call('and', Call('tuple', Call('or', Call('not', Call(
    Name('x'), Const(1), Const(None))), Call('not', Call(Name('y'), Const(2
    ), Const(None)))), Const(None)), Call('not', Call(Name('z'), Const(3),
    Const(None))))),)))
check('not x(1, None) and (not y(2, None) or not z(3, None), None)', Suite(
    (Call('return', Call('and', Call('not', Call(Name('x'), Const(1), Const
    (None))), Call('tuple', Call('or', Call('not', Call(Name('y'), Const(2),
    Const(None))), Call('not', Call(Name('z'), Const(3), Const(None)))),
    Const(None)))),)))
check('not x.a', Suite((Call('return', Call('not', Call('.', Name('x'), 'a'
    ))),)))
check('not x.a and not y.b', Suite((Call('return', Call('and', Call('not',
    Call('.', Name('x'), 'a')), Call('not', Call('.', Name('y'), 'b')))),)))
check('not x.a and not y.b and not z.c', Suite((Call('return', Call('and',
    Call('not', Call('.', Name('x'), 'a')), Call('and', Call('not', Call(
    '.', Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check('not x.a and not y.b and not z.c', Suite((Call('return', Call('and',
    Call('not', Call('.', Name('x'), 'a')), Call('and', Call('not', Call(
    '.', Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check('not x.a and not y.b and not z.c', Suite((Call('return', Call('and',
    Call('not', Call('.', Name('x'), 'a')), Call('and', Call('not', Call(
    '.', Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check('not x.a or not y.b', Suite((Call('return', Call('or', Call('not',
    Call('.', Name('x'), 'a')), Call('not', Call('.', Name('y'), 'b')))),)))
check('not x.a or not y.b or not z.c', Suite((Call('return', Call('or',
    Call('not', Call('.', Name('x'), 'a')), Call('or', Call('not', Call('.',
    Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check('not x.a or not y.b or not z.c', Suite((Call('return', Call('or',
    Call('not', Call('.', Name('x'), 'a')), Call('or', Call('not', Call('.',
    Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check('not x.a or not y.b or not z.c', Suite((Call('return', Call('or',
    Call('not', Call('.', Name('x'), 'a')), Call('or', Call('not', Call('.',
    Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check('(not x.a or not y.b, None) and not z.c', Suite((Call('return', Call(
    'and', Call('tuple', Call('or', Call('not', Call('.', Name('x'), 'a')),
    Call('not', Call('.', Name('y'), 'b'))), Const(None)), Call('not', Call
    ('.', Name('z'), 'c')))),)))
check('not x.a and (not y.b or not z.c, None)', Suite((Call('return', Call(
    'and', Call('not', Call('.', Name('x'), 'a')), Call('tuple', Call('or',
    Call('not', Call('.', Name('y'), 'b')), Call('not', Call('.', Name('z'),
    'c'))), Const(None)))),)))
check('False', Suite((Call('return', Const(False)),)))
check('True', Suite((Call('return', Const(True)),)))
check('not x', Suite((Call('return', Call('not', Name('x'))),)))
check('not x and not y', Suite((Call('return', Call('and', Call('not', Name
    ('x')), Call('not', Name('y')))),)))
check('not x and not y and not z', Suite((Call('return', Call('and', Call(
    'not', Name('x')), Call('and', Call('not', Name('y')), Call('not', Name
    ('z'))))),)))
check('not x and not y and not z', Suite((Call('return', Call('and', Call(
    'not', Name('x')), Call('and', Call('not', Name('y')), Call('not', Name
    ('z'))))),)))
check('not x and not y and not z', Suite((Call('return', Call('and', Call(
    'not', Name('x')), Call('and', Call('not', Name('y')), Call('not', Name
    ('z'))))),)))
check('not x or not y', Suite((Call('return', Call('or', Call('not', Name(
    'x')), Call('not', Name('y')))),)))
check('not x or not y or not z', Suite((Call('return', Call('or', Call(
    'not', Name('x')), Call('or', Call('not', Name('y')), Call('not', Name(
    'z'))))),)))
check('not x or not y or not z', Suite((Call('return', Call('or', Call(
    'not', Name('x')), Call('or', Call('not', Name('y')), Call('not', Name(
    'z'))))),)))
check('not x or not y or not z', Suite((Call('return', Call('or', Call(
    'not', Name('x')), Call('or', Call('not', Name('y')), Call('not', Name(
    'z'))))),)))
check('(not x or not y, None) and not z', Suite((Call('return', Call('and',
    Call('tuple', Call('or', Call('not', Name('x')), Call('not', Name('y'))
    ), Const(None)), Call('not', Name('z')))),)))
check('not x and (not y or not z, None)', Suite((Call('return', Call('and',
    Call('not', Name('x')), Call('tuple', Call('or', Call('not', Name('y')),
    Call('not', Name('z'))), Const(None)))),)))
check('not x(1, None)', Suite((Call('return', Call('not', Call(Name('x'),
    Const(1), Const(None)))),)))
check('not x(1, None) and not y(2, None)', Suite((Call('return', Call('and',
    Call('not', Call(Name('x'), Const(1), Const(None))), Call('not', Call(
    Name('y'), Const(2), Const(None))))),)))
check('not x(1, None) and not y(2, None) and not z(3, None)', Suite((Call(
    'return', Call('and', Call('not', Call(Name('x'), Const(1), Const(None)
    )), Call('and', Call('not', Call(Name('y'), Const(2), Const(None))),
    Call('not', Call(Name('z'), Const(3), Const(None)))))),)))
check('not x(1, None) and not y(2, None) and not z(3, None)', Suite((Call(
    'return', Call('and', Call('not', Call(Name('x'), Const(1), Const(None)
    )), Call('and', Call('not', Call(Name('y'), Const(2), Const(None))),
    Call('not', Call(Name('z'), Const(3), Const(None)))))),)))
check('not x(1, None) and not y(2, None) and not z(3, None)', Suite((Call(
    'return', Call('and', Call('not', Call(Name('x'), Const(1), Const(None)
    )), Call('and', Call('not', Call(Name('y'), Const(2), Const(None))),
    Call('not', Call(Name('z'), Const(3), Const(None)))))),)))
check('not x(1, None) or not y(2, None)', Suite((Call('return', Call('or',
    Call('not', Call(Name('x'), Const(1), Const(None))), Call('not', Call(
    Name('y'), Const(2), Const(None))))),)))
check('not x(1, None) or not y(2, None) or not z(3, None)', Suite((Call(
    'return', Call('or', Call('not', Call(Name('x'), Const(1), Const(None))
    ), Call('or', Call('not', Call(Name('y'), Const(2), Const(None))), Call
    ('not', Call(Name('z'), Const(3), Const(None)))))),)))
check('not x(1, None) or not y(2, None) or not z(3, None)', Suite((Call(
    'return', Call('or', Call('not', Call(Name('x'), Const(1), Const(None))
    ), Call('or', Call('not', Call(Name('y'), Const(2), Const(None))), Call
    ('not', Call(Name('z'), Const(3), Const(None)))))),)))
check('not x(1, None) or not y(2, None) or not z(3, None)', Suite((Call(
    'return', Call('or', Call('not', Call(Name('x'), Const(1), Const(None))
    ), Call('or', Call('not', Call(Name('y'), Const(2), Const(None))), Call
    ('not', Call(Name('z'), Const(3), Const(None)))))),)))
check('(not x(1, None) or not y(2, None), None) and not z(3, None)', Suite(
    (Call('return', Call('and', Call('tuple', Call('or', Call('not', Call(
    Name('x'), Const(1), Const(None))), Call('not', Call(Name('y'), Const(2
    ), Const(None)))), Const(None)), Call('not', Call(Name('z'), Const(3),
    Const(None))))),)))
check('not x(1, None) and (not y(2, None) or not z(3, None), None)', Suite(
    (Call('return', Call('and', Call('not', Call(Name('x'), Const(1), Const
    (None))), Call('tuple', Call('or', Call('not', Call(Name('y'), Const(2),
    Const(None))), Call('not', Call(Name('z'), Const(3), Const(None)))),
    Const(None)))),)))
check('not x.a', Suite((Call('return', Call('not', Call('.', Name('x'), 'a'
    ))),)))
check('not x.a and not y.b', Suite((Call('return', Call('and', Call('not',
    Call('.', Name('x'), 'a')), Call('not', Call('.', Name('y'), 'b')))),)))
check('not x.a and not y.b and not z.c', Suite((Call('return', Call('and',
    Call('not', Call('.', Name('x'), 'a')), Call('and', Call('not', Call(
    '.', Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check('not x.a and not y.b and not z.c', Suite((Call('return', Call('and',
    Call('not', Call('.', Name('x'), 'a')), Call('and', Call('not', Call(
    '.', Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check('not x.a and not y.b and not z.c', Suite((Call('return', Call('and',
    Call('not', Call('.', Name('x'), 'a')), Call('and', Call('not', Call(
    '.', Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check('not x.a or not y.b', Suite((Call('return', Call('or', Call('not',
    Call('.', Name('x'), 'a')), Call('not', Call('.', Name('y'), 'b')))),)))
check('not x.a or not y.b or not z.c', Suite((Call('return', Call('or',
    Call('not', Call('.', Name('x'), 'a')), Call('or', Call('not', Call('.',
    Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check('not x.a or not y.b or not z.c', Suite((Call('return', Call('or',
    Call('not', Call('.', Name('x'), 'a')), Call('or', Call('not', Call('.',
    Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check('not x.a or not y.b or not z.c', Suite((Call('return', Call('or',
    Call('not', Call('.', Name('x'), 'a')), Call('or', Call('not', Call('.',
    Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check('(not x.a or not y.b, None) and not z.c', Suite((Call('return', Call(
    'and', Call('tuple', Call('or', Call('not', Call('.', Name('x'), 'a')),
    Call('not', Call('.', Name('y'), 'b'))), Const(None)), Call('not', Call
    ('.', Name('z'), 'c')))),)))
check('not x.a and (not y.b or not z.c, None)', Suite((Call('return', Call(
    'and', Call('not', Call('.', Name('x'), 'a')), Call('tuple', Call('or',
    Call('not', Call('.', Name('y'), 'b')), Call('not', Call('.', Name('z'),
    'c'))), Const(None)))),)))
check('x != y', Suite((Call('return', Call('!=', Name('x'), Name('y'))),)))
check('x == y', Suite((Call('return', Call('==', Name('x'), Name('y'))),)))
check('x <= y', Suite((Call('return', Call('<=', Name('x'), Name('y'))),)))
check('x > y', Suite((Call('return', Call('>', Name('x'), Name('y'))),)))
check('x >= y', Suite((Call('return', Call('>=', Name('x'), Name('y'))),)))
check('x < y', Suite((Call('return', Call('<', Name('x'), Name('y'))),)))
check('x not in y', Suite((Call('return', Call('not-in', Name('x'), Name(
    'y'))),)))
check('x in y', Suite((Call('return', Call('in', Name('x'), Name('y'))),)))
check('x == y and y == z', Suite((Call('return', Call('and', Call('==',
    Name('x'), Name('y')), Call('==', Name('y'), Name('z')))),)))
check('x == y and y == z', Suite((Call('return', Call('and', Call('==',
    Name('x'), Name('y')), Call('==', Name('y'), Name('z')))),)))
check('x == y or y == z', Suite((Call('return', Call('or', Call('==', Name(
    'x'), Name('y')), Call('==', Name('y'), Name('z')))),)))
check('x != y or y != z', Suite((Call('return', Call('or', Call('!=', Name(
    'x'), Name('y')), Call('!=', Name('y'), Name('z')))),)))
check('x != y or y != z', Suite((Call('return', Call('or', Call('!=', Name(
    'x'), Name('y')), Call('!=', Name('y'), Name('z')))),)))
check('x != y or y == z', Suite((Call('return', Call('or', Call('!=', Name(
    'x'), Name('y')), Call('==', Name('y'), Name('z')))),)))
check('a and b and c and d and e', Suite((Call('return', Call('and', Name(
    'a'), Call('and', Name('b'), Call('and', Name('c'), Call('and', Name(
    'd'), Name('e')))))),)))
check('a and b and c and d and e', Suite((Call('return', Call('and', Name(
    'a'), Call('and', Name('b'), Call('and', Name('c'), Call('and', Name(
    'd'), Name('e')))))),)))
check('def g(x): return 3.14', Suite((Assign((Name('g'),), Def(('x',), (),
    Suite((Call('return', Const(3.14)),)))), Call('return', Const(None)))))
check("""def g(x):
    return 3.14""", Suite((Assign((Name('g'),), Def(('x'
    ,), (), Suite((Call('return', Const(3.14)),)))), Call('return', Const(
    None)))))
check('def g(x, y): return x**2', Suite((Assign((Name('g'),), Def(('x', 'y'
    ), (), Suite((Call('return', Call('**', Name('x'), Const(2))),)))),
    Call('return', Const(None)))))
check("""def g(x, y):
    return x**2""", Suite((Assign((Name('g'),), Def((
    'x', 'y'), (), Suite((Call('return', Call('**', Name('x'), Const(2))),)
    ))), Call('return', Const(None)))))
check('lambda: 3.14', Suite((Call('return', Def((), (), Suite((Call(
    'return', Const(3.14)),)))),)))
check('lambda x: x**2', Suite((Call('return', Def(('x',), (), Suite((Call(
    'return', Call('**', Name('x'), Const(2))),)))),)))
check('(lambda x: x**2, None)', Suite((Call('return', Call('tuple', Def((
    'x',), (), Suite((Call('return', Call('**', Name('x'), Const(2))),))),
    Const(None))),)))
check('1 if x == 0 else 2', Suite((Call('if', Call('==', Name('x'), Const(0
    )), Suite((Call('return', Const(1)),)), Suite((Call('return', Const(2))
    ,))),)))
check('y = (1 if x == 0 else 2, None)', Suite((Assign((Name('y'),), Call(
    'tuple', Call('?', Call('==', Name('x'), Const(0)), Const(1), Const(2)),
    Const(None))), Call('return', Const(None)))))
check('1 if x == 0 else None', Suite((Call('if', Call('==', Name('x'),
    Const(0)), Suite((Call('return', Const(1)),)), Suite((Call('return',
    Const(None)),))),)))
check('(1 if x == 0 else 2, None)', Suite((Call('return', Call('tuple',
    Call('?', Call('==', Name('x'), Const(0)), Const(1), Const(2)), Const(
    None))),)))
check('(1 if x == 0 else None, None)', Suite((Call('return', Call('tuple',
    Call('?', Call('==', Name('x'), Const(0)), Const(1), Const(None)),
    Const(None))),)))
check("""if x == 0:
    return 1""", Suite((Call('if', Call('==', Name('x'),
    Const(0)), Suite((Call('return', Const(1)),)), Suite((Call('return',
    Const(None)),))),)))
check("""if x == 0:
    y = 1
    return 1""", Suite((Call('if', Call('==',
    Name('x'), Const(0)), Suite((Assign((Name('y'),), Const(1)), Call(
    'return', Const(1)))), Suite((Call('return', Const(None)),))),)))
check("""if x == 0:
    return 1
else:
    return 2""", Suite((Call('if',
    Call('==', Name('x'), Const(0)), Suite((Call('return', Const(1)),)),
    Suite((Call('return', Const(2)),))),)))
check("""if x == 0:
    y = 1
    return 1
else:
    y = 2
    return 2""",
    Suite((Call('if', Call('==', Name('x'), Const(0)), Suite((Assign((Name(
    'y'),), Const(1)), Call('return', Const(1)))), Suite((Assign((Name('y')
    ,), Const(2)), Call('return', Const(2))))),)))
check(
    """if x == 0:
    return 1
elif x == 1:
    return 2
else:
    return 3""",
    Suite((Call('if', Call('==', Name('x'), Const(0)), Suite((Call('return',
    Const(1)),)), Suite((Call('if', Call('==', Name('x'), Const(1)), Suite(
    (Call('return', Const(2)),)), Suite((Call('return', Const(3)),))),))),)))
check(
    """if x == 0:
    y = 1
    return 1
elif x == 1:
    y = 2
    return 2
else:
    y = 3
    return 3"""
    , Suite((Call('if', Call('==', Name('x'), Const(0)), Suite((Assign((
    Name('y'),), Const(1)), Call('return', Const(1)))), Suite((Call('if',
    Call('==', Name('x'), Const(1)), Suite((Assign((Name('y'),), Const(2)),
    Call('return', Const(2)))), Suite((Assign((Name('y'),), Const(3)), Call
    ('return', Const(3))))),))),)))
check("""if x == 0:
    y = 1""", Suite((Call('if', Call('==', Name('x'),
    Const(0)), Suite((Assign((Name('y'),), Const(1)),))), Call('return',
    Const(None)))))
check("""if x == 0:
    y = 1
    z = 1""", Suite((Call('if', Call('==',
    Name('x'), Const(0)), Suite((Assign((Name('y'),), Const(1)), Assign((
    Name('z'),), Const(1))))), Call('return', Const(None)))))
check("""if x == 0:
    y = 1
else:
    y = 2""", Suite((Call('if', Call(
    '==', Name('x'), Const(0)), Suite((Assign((Name('y'),), Const(1)),)),
    Suite((Assign((Name('y'),), Const(2)),))), Call('return', Const(None)))))
check("""if x == 0:
    y = 1
    z = 1
else:
    y = 2
    z = 2""", Suite
    ((Call('if', Call('==', Name('x'), Const(0)), Suite((Assign((Name('y'),
    ), Const(1)), Assign((Name('z'),), Const(1)))), Suite((Assign((Name('y'
    ),), Const(2)), Assign((Name('z'),), Const(2))))), Call('return', Const
    (None)))))
check('[]', Suite((Call('return', Call('list')),)))
check('[1]', Suite((Call('return', Call('list', Const(1))),)))
check('[1, 2]', Suite((Call('return', Call('list', Const(1), Const(2))),)))
check('[one]', Suite((Call('return', Call('list', Name('one'))),)))
check('[one, two]', Suite((Call('return', Call('list', Name('one'), Name(
    'two'))),)))
check("['one']", Suite((Call('return', Call('list', Const('one'))),)))
check("['one', 'two']", Suite((Call('return', Call('list', Const('one'),
    Const('two'))),)))
check('set([])', Suite((Call('return', Call(Name('set'), Call('list'))),)))
check('set([1])', Suite((Call('return', Call(Name('set'), Call('list',
    Const(1)))),)))
check('set([1, 2])', Suite((Call('return', Call(Name('set'), Call('list',
    Const(1), Const(2)))),)))
check('set([one])', Suite((Call('return', Call(Name('set'), Call('list',
    Name('one')))),)))
check('set([one, two])', Suite((Call('return', Call(Name('set'), Call(
    'list', Name('one'), Name('two')))),)))
check("set(['one'])", Suite((Call('return', Call(Name('set'), Call('list',
    Const('one')))),)))
check("set(['one', 'two'])", Suite((Call('return', Call(Name('set'), Call(
    'list', Const('one'), Const('two')))),)))
check('{}', Suite((Call('return', Call('dict')),)))
check('{1}', Suite((Call('return', Call('set', Const(1))),)))
check('{1, 2}', Suite((Call('return', Call('set', Const(1), Const(2))),)))
check('{one}', Suite((Call('return', Call('set', Name('one'))),)))
check('{one, two}', Suite((Call('return', Call('set', Name('one'), Name(
    'two'))),)))
check("{'one'}", Suite((Call('return', Call('set', Const('one'))),)))
check("{'one', 'two'}", Suite((Call('return', Call('set', Const('one'),
    Const('two'))),)))
check("{'x': 1}", Suite((Call('return', Call('dict', Const('x'), Const(1))),)))
check("{'x': 1, 'y': 2}", Suite((Call('return', Call('dict', Const('x'),
    Const(1), Const('y'), Const(2))),)))
check("{'x': 1, 'y': 2, 'z': 3}", Suite((Call('return', Call('dict', Const(
    'x'), Const(1), Const('y'), Const(2), Const('z'), Const(3))),)))
check("{'x': one}", Suite((Call('return', Call('dict', Const('x'), Name(
    'one'))),)))
check("{'x': one, 'y': two}", Suite((Call('return', Call('dict', Const('x'),
    Name('one'), Const('y'), Name('two'))),)))
check("{'x': one, 'y': two, 'z': three}", Suite((Call('return', Call('dict',
    Const('x'), Name('one'), Const('y'), Name('two'), Const('z'), Name(
    'three'))),)))
check('{1: 1}', Suite((Call('return', Call('dict', Const(1), Const(1))),)))
check('{1: 1, 2: 2}', Suite((Call('return', Call('dict', Const(1), Const(1),
    Const(2), Const(2))),)))
check('{1: 1, 2: 2, 3: 3}', Suite((Call('return', Call('dict', Const(1),
    Const(1), Const(2), Const(2), Const(3), Const(3))),)))
check('{1: one}', Suite((Call('return', Call('dict', Const(1), Name('one'))),))
    )
check('{1: one, 2: two}', Suite((Call('return', Call('dict', Const(1), Name
    ('one'), Const(2), Name('two'))),)))
check('{1: one, 2: two, 3: three}', Suite((Call('return', Call('dict',
    Const(1), Name('one'), Const(2), Name('two'), Const(3), Name('three'))),)))
check('{one: 1}', Suite((Call('return', Call('dict', Name('one'), Const(1))),))
    )
check('{one: 1, two: 2}', Suite((Call('return', Call('dict', Name('one'),
    Const(1), Name('two'), Const(2))),)))
check('{one: 1, two: 2, three: 3}', Suite((Call('return', Call('dict', Name
    ('one'), Const(1), Name('two'), Const(2), Name('three'), Const(3))),)))
check('{one: one}', Suite((Call('return', Call('dict', Name('one'), Name(
    'one'))),)))
check('{one: one, two: two}', Suite((Call('return', Call('dict', Name('one'
    ), Name('one'), Name('two'), Name('two'))),)))
check('{one: one, two: two, three: three}', Suite((Call('return', Call(
    'dict', Name('one'), Name('one'), Name('two'), Name('two'), Name(
    'three'), Name('three'))),)))
check('[x**2 for x in something]', Suite((Call('return', Call(Call('.',
    Name('something'), 'map'), Def(('x',), (), Suite((Call('return', Call(
    '**', Name('x'), Const(2))),))))),)))
check('[x**2 for x in something if x > 0]', Suite((Call('return', Call(Call
    ('.', Call(Call('.', Name('something'), 'filter'), Def(('x',), (),
    Suite((Call('return', Call('>', Name('x'), Const(0))),)))), 'map'), Def
    (('x',), (), Suite((Call('return', Call('**', Name('x'), Const(2))),)))
    )),)))
check('[y**2 for x in something for y in x]', Suite((Call('return', Call(
    Call('.', Name('something'), 'map'), Def(('x',), (), Suite((Call(
    'return', Call(Call('.', Name('x'), 'map'), Def(('y',), (), Suite((Call
    ('return', Call('**', Name('y'), Const(2))),))))),))))),)))
check('[y**2 for x in something for y in x if x > 0]', Suite((Call('return',
    Call(Call('.', Name('something'), 'map'), Def(('x',), (), Suite((Call(
    'return', Call(Call('.', Call(Call('.', Name('x'), 'filter'), Def(('y',
    ), (), Suite((Call('return', Call('>', Name('x'), Const(0))),)))),
    'map'), Def(('y',), (), Suite((Call('return', Call('**', Name('y'),
    Const(2))),))))),))))),)))
check('[y**2 for x in something for y in x if y > 0]', Suite((Call('return',
    Call(Call('.', Name('something'), 'map'), Def(('x',), (), Suite((Call(
    'return', Call(Call('.', Call(Call('.', Name('x'), 'filter'), Def(('y',
    ), (), Suite((Call('return', Call('>', Name('y'), Const(0))),)))),
    'map'), Def(('y',), (), Suite((Call('return', Call('**', Name('y'),
    Const(2))),))))),))))),)))
check('[y**2 for x in something if x for y in x if x > 0]', Suite((Call(
    'return', Call(Call('.', Call(Call('.', Name('something'), 'filter'),
    Def(('x',), (), Suite((Call('return', Name('x')),)))), 'map'), Def(('x'
    ,), (), Suite((Call('return', Call(Call('.', Call(Call('.', Name('x'),
    'filter'), Def(('y',), (), Suite((Call('return', Call('>', Name('x'),
    Const(0))),)))), 'map'), Def(('y',), (), Suite((Call('return', Call(
    '**', Name('y'), Const(2))),))))),))))),)))
check('f([x**2 for x in something], None)', Suite((Call('return', Call(Name
    ('f'), Call(Call('.', Name('something'), 'map'), Def(('x',), (), Suite(
    (Call('return', Call('**', Name('x'), Const(2))),)))), Const(None))),)))
check('f([x**2 for x in something if x > 0], None)', Suite((Call('return',
    Call(Name('f'), Call(Call('.', Call(Call('.', Name('something'),
    'filter'), Def(('x',), (), Suite((Call('return', Call('>', Name('x'),
    Const(0))),)))), 'map'), Def(('x',), (), Suite((Call('return', Call(
    '**', Name('x'), Const(2))),)))), Const(None))),)))
check('f([y**2 for x in something for y in x], None)', Suite((Call('return',
    Call(Name('f'), Call(Call('.', Name('something'), 'map'), Def(('x',), (
    ), Suite((Call('return', Call(Call('.', Name('x'), 'map'), Def(('y',),
    (), Suite((Call('return', Call('**', Name('y'), Const(2))),))))),)))),
    Const(None))),)))
check('f([y**2 for x in something for y in x if x > 0], None)', Suite((Call
    ('return', Call(Name('f'), Call(Call('.', Name('something'), 'map'),
    Def(('x',), (), Suite((Call('return', Call(Call('.', Call(Call('.',
    Name('x'), 'filter'), Def(('y',), (), Suite((Call('return', Call('>',
    Name('x'), Const(0))),)))), 'map'), Def(('y',), (), Suite((Call(
    'return', Call('**', Name('y'), Const(2))),))))),)))), Const(None))),)))
check('f([y**2 for x in something for y in x if y > 0], None)', Suite((Call
    ('return', Call(Name('f'), Call(Call('.', Name('something'), 'map'),
    Def(('x',), (), Suite((Call('return', Call(Call('.', Call(Call('.',
    Name('x'), 'filter'), Def(('y',), (), Suite((Call('return', Call('>',
    Name('y'), Const(0))),)))), 'map'), Def(('y',), (), Suite((Call(
    'return', Call('**', Name('y'), Const(2))),))))),)))), Const(None))),)))
check('f([y**2 for x in something if x for y in x if x > 0], None)', Suite(
    (Call('return', Call(Name('f'), Call(Call('.', Call(Call('.', Name(
    'something'), 'filter'), Def(('x',), (), Suite((Call('return', Name('x'
    )),)))), 'map'), Def(('x',), (), Suite((Call('return', Call(Call('.',
    Call(Call('.', Name('x'), 'filter'), Def(('y',), (), Suite((Call(
    'return', Call('>', Name('x'), Const(0))),)))), 'map'), Def(('y',), (),
    Suite((Call('return', Call('**', Name('y'), Const(2))),))))),)))),
    Const(None))),)))
check('f((x**2 for x in something), None)', Suite((Call('return', Call(Name
    ('f'), Call(Call('.', Name('something'), 'map'), Def(('x',), (), Suite(
    (Call('return', Call('**', Name('x'), Const(2))),)))), Const(None))),)))
check('f((x**2 for x in something if x > 0), None)', Suite((Call('return',
    Call(Name('f'), Call(Call('.', Call(Call('.', Name('something'),
    'filter'), Def(('x',), (), Suite((Call('return', Call('>', Name('x'),
    Const(0))),)))), 'map'), Def(('x',), (), Suite((Call('return', Call(
    '**', Name('x'), Const(2))),)))), Const(None))),)))
check('f((y**2 for x in something for y in x), None)', Suite((Call('return',
    Call(Name('f'), Call(Call('.', Name('something'), 'map'), Def(('x',), (
    ), Suite((Call('return', Call(Call('.', Name('x'), 'map'), Def(('y',),
    (), Suite((Call('return', Call('**', Name('y'), Const(2))),))))),)))),
    Const(None))),)))
check('f((y**2 for x in something for y in x if x > 0), None)', Suite((Call
    ('return', Call(Name('f'), Call(Call('.', Name('something'), 'map'),
    Def(('x',), (), Suite((Call('return', Call(Call('.', Call(Call('.',
    Name('x'), 'filter'), Def(('y',), (), Suite((Call('return', Call('>',
    Name('x'), Const(0))),)))), 'map'), Def(('y',), (), Suite((Call(
    'return', Call('**', Name('y'), Const(2))),))))),)))), Const(None))),)))
check('f((y**2 for x in something for y in x if y > 0), None)', Suite((Call
    ('return', Call(Name('f'), Call(Call('.', Name('something'), 'map'),
    Def(('x',), (), Suite((Call('return', Call(Call('.', Call(Call('.',
    Name('x'), 'filter'), Def(('y',), (), Suite((Call('return', Call('>',
    Name('y'), Const(0))),)))), 'map'), Def(('y',), (), Suite((Call(
    'return', Call('**', Name('y'), Const(2))),))))),)))), Const(None))),)))
check('f((y**2 for x in something if x for y in x if x > 0), None)', Suite(
    (Call('return', Call(Name('f'), Call(Call('.', Call(Call('.', Name(
    'something'), 'filter'), Def(('x',), (), Suite((Call('return', Name('x'
    )),)))), 'map'), Def(('x',), (), Suite((Call('return', Call(Call('.',
    Call(Call('.', Name('x'), 'filter'), Def(('y',), (), Suite((Call(
    'return', Call('>', Name('x'), Const(0))),)))), 'map'), Def(('y',), (),
    Suite((Call('return', Call('**', Name('y'), Const(2))),))))),)))),
    Const(None))),)))
check('f(one=1)', Suite((Call('return', CallKeyword(Name('f'), (), (('one',
    Const(1)),))),)))
check('f(one=1, two=2)', Suite((Call('return', CallKeyword(Name('f'), (), (
    ('one', Const(1)), ('two', Const(2))))),)))
check('f(x, one=1)', Suite((Call('return', CallKeyword(Name('f'), (Name('x'
    ),), (('one', Const(1)),))),)))
check('f(x, one=1, two=2)', Suite((Call('return', CallKeyword(Name('f'), (
    Name('x'),), (('one', Const(1)), ('two', Const(2))))),)))
check('x[..., :]', Suite((Call('return', Call('[.]', Name('x'), Const(
    Ellipsis), Call('slice', Const(None), Const(None), Const(None)))),)))
check('x = y = 1', Suite((Assign((Name('x'), Name('y')), Const(1)), Call(
    'return', Const(None)))))
check('x = y = z = 1', Suite((Assign((Name('x'), Name('y'), Name('z')),
    Const(1)), Call('return', Const(None)))))
check('x, y = 1', Suite((Assign((Unpack((Name('x'), Name('y'))),), Const(1)
    ), Call('return', Const(None)))))
check('x, y = z = 1', Suite((Assign((Unpack((Name('x'), Name('y'))), Name(
    'z')), Const(1)), Call('return', Const(None)))))
check('x = y, z = 1', Suite((Assign((Name('x'), Unpack((Name('y'), Name('z'
    )))), Const(1)), Call('return', Const(None)))))
check('x.a = y = 1', Suite((Assign((Call('.', Name('x'), 'a'), Name('y')),
    Const(1)), Call('return', Const(None)))))
check('x.a = y = z = 1', Suite((Assign((Call('.', Name('x'), 'a'), Name('y'
    ), Name('z')), Const(1)), Call('return', Const(None)))))
check('x.a, y = 1', Suite((Assign((Unpack((Call('.', Name('x'), 'a'), Name(
    'y'))),), Const(1)), Call('return', Const(None)))))
check('x.a, y = z = 1', Suite((Assign((Unpack((Call('.', Name('x'), 'a'),
    Name('y'))), Name('z')), Const(1)), Call('return', Const(None)))))
check('x.a = y, z = 1', Suite((Assign((Call('.', Name('x'), 'a'), Unpack((
    Name('y'), Name('z')))), Const(1)), Call('return', Const(None)))))
check('x = y.a = 1', Suite((Assign((Name('x'), Call('.', Name('y'), 'a')),
    Const(1)), Call('return', Const(None)))))
check('x = y.a = z = 1', Suite((Assign((Name('x'), Call('.', Name('y'), 'a'
    ), Name('z')), Const(1)), Call('return', Const(None)))))
check('x, y.a = 1', Suite((Assign((Unpack((Name('x'), Call('.', Name('y'),
    'a'))),), Const(1)), Call('return', Const(None)))))
check('x, y.a = z = 1', Suite((Assign((Unpack((Name('x'), Call('.', Name(
    'y'), 'a'))), Name('z')), Const(1)), Call('return', Const(None)))))
check('x = y.a, z = 1', Suite((Assign((Name('x'), Unpack((Call('.', Name(
    'y'), 'a'), Name('z')))), Const(1)), Call('return', Const(None)))))
check('x = y = z.a = 1', Suite((Assign((Name('x'), Name('y'), Call('.',
    Name('z'), 'a')), Const(1)), Call('return', Const(None)))))
check('x, y = z.a = 1', Suite((Assign((Unpack((Name('x'), Name('y'))), Call
    ('.', Name('z'), 'a')), Const(1)), Call('return', Const(None)))))
check('x = y, z.a = 1', Suite((Assign((Name('x'), Unpack((Name('y'), Call(
    '.', Name('z'), 'a')))), Const(1)), Call('return', Const(None)))))
check('x[0] = y = 1', Suite((Assign((Call('[.]', Name('x'), Const(0)), Name
    ('y')), Const(1)), Call('return', Const(None)))))
check('x[0] = y = z = 1', Suite((Assign((Call('[.]', Name('x'), Const(0)),
    Name('y'), Name('z')), Const(1)), Call('return', Const(None)))))
check('x[0], y = 1', Suite((Assign((Unpack((Call('[.]', Name('x'), Const(0)
    ), Name('y'))),), Const(1)), Call('return', Const(None)))))
check('x[0], y = z = 1', Suite((Assign((Unpack((Call('[.]', Name('x'),
    Const(0)), Name('y'))), Name('z')), Const(1)), Call('return', Const(
    None)))))
check('x[0] = y, z = 1', Suite((Assign((Call('[.]', Name('x'), Const(0)),
    Unpack((Name('y'), Name('z')))), Const(1)), Call('return', Const(None)))))
check('x = y[0] = 1', Suite((Assign((Name('x'), Call('[.]', Name('y'),
    Const(0))), Const(1)), Call('return', Const(None)))))
check('x = y[0] = z = 1', Suite((Assign((Name('x'), Call('[.]', Name('y'),
    Const(0)), Name('z')), Const(1)), Call('return', Const(None)))))
check('x, y[0] = 1', Suite((Assign((Unpack((Name('x'), Call('[.]', Name('y'
    ), Const(0)))),), Const(1)), Call('return', Const(None)))))
check('x, y[0] = z = 1', Suite((Assign((Unpack((Name('x'), Call('[.]', Name
    ('y'), Const(0)))), Name('z')), Const(1)), Call('return', Const(None)))))
check('x = y[0], z = 1', Suite((Assign((Name('x'), Unpack((Call('[.]', Name
    ('y'), Const(0)), Name('z')))), Const(1)), Call('return', Const(None)))))
check('x = y = z[0] = 1', Suite((Assign((Name('x'), Name('y'), Call('[.]',
    Name('z'), Const(0))), Const(1)), Call('return', Const(None)))))
check('x, y = z[0] = 1', Suite((Assign((Unpack((Name('x'), Name('y'))),
    Call('[.]', Name('z'), Const(0))), Const(1)), Call('return', Const(None))))
    )
check('x = y, z[0] = 1', Suite((Assign((Name('x'), Unpack((Name('y'), Call(
    '[.]', Name('z'), Const(0))))), Const(1)), Call('return', Const(None)))))
check('x[:, ...] = y = 1', Suite((Assign((Call('[.]', Name('x'), Call(
    'slice', Const(None), Const(None), Const(None)), Const(Ellipsis)), Name
    ('y')), Const(1)), Call('return', Const(None)))))
check('x[:, ...] = y = z = 1', Suite((Assign((Call('[.]', Name('x'), Call(
    'slice', Const(None), Const(None), Const(None)), Const(Ellipsis)), Name
    ('y'), Name('z')), Const(1)), Call('return', Const(None)))))
check('x[:, ...], y = 1', Suite((Assign((Unpack((Call('[.]', Name('x'),
    Call('slice', Const(None), Const(None), Const(None)), Const(Ellipsis)),
    Name('y'))),), Const(1)), Call('return', Const(None)))))
check('x[:, ...], y = z = 1', Suite((Assign((Unpack((Call('[.]', Name('x'),
    Call('slice', Const(None), Const(None), Const(None)), Const(Ellipsis)),
    Name('y'))), Name('z')), Const(1)), Call('return', Const(None)))))
check('x[:, ...] = y, z = 1', Suite((Assign((Call('[.]', Name('x'), Call(
    'slice', Const(None), Const(None), Const(None)), Const(Ellipsis)),
    Unpack((Name('y'), Name('z')))), Const(1)), Call('return', Const(None)))))
check('x = y[:, ...] = 1', Suite((Assign((Name('x'), Call('[.]', Name('y'),
    Call('slice', Const(None), Const(None), Const(None)), Const(Ellipsis))),
    Const(1)), Call('return', Const(None)))))
check('x = y[:, ...] = z = 1', Suite((Assign((Name('x'), Call('[.]', Name(
    'y'), Call('slice', Const(None), Const(None), Const(None)), Const(
    Ellipsis)), Name('z')), Const(1)), Call('return', Const(None)))))
check('x, y[:, ...] = 1', Suite((Assign((Unpack((Name('x'), Call('[.]',
    Name('y'), Call('slice', Const(None), Const(None), Const(None)), Const(
    Ellipsis)))),), Const(1)), Call('return', Const(None)))))
check('x, y[:, ...] = z = 1', Suite((Assign((Unpack((Name('x'), Call('[.]',
    Name('y'), Call('slice', Const(None), Const(None), Const(None)), Const(
    Ellipsis)))), Name('z')), Const(1)), Call('return', Const(None)))))
check('x = y[:, ...], z = 1', Suite((Assign((Name('x'), Unpack((Call('[.]',
    Name('y'), Call('slice', Const(None), Const(None), Const(None)), Const(
    Ellipsis)), Name('z')))), Const(1)), Call('return', Const(None)))))
check('x = y = z[:, ...] = 1', Suite((Assign((Name('x'), Name('y'), Call(
    '[.]', Name('z'), Call('slice', Const(None), Const(None), Const(None)),
    Const(Ellipsis))), Const(1)), Call('return', Const(None)))))
check('x, y = z[:, ...] = 1', Suite((Assign((Unpack((Name('x'), Name('y'))),
    Call('[.]', Name('z'), Call('slice', Const(None), Const(None), Const(
    None)), Const(Ellipsis))), Const(1)), Call('return', Const(None)))))
check('x = y, z[:, ...] = 1', Suite((Assign((Name('x'), Unpack((Name('y'),
    Call('[.]', Name('z'), Call('slice', Const(None), Const(None), Const(
    None)), Const(Ellipsis))))), Const(1)), Call('return', Const(None)))))

import rejig.pybytecode
from rejig.syntaxtree import *


def check(what_is, what_should_be):
    global failed, total
    env = {}
    if ('\n' in what_is or ' = ' in what_is or 'def ' in what_is or 
        'print(' in what_is):
        exec('def f():\n    ' + '\n    '.join(what_is.split('\n')), env)
    else:
        exec('def f():\n    return ' + what_is, env)
    ast = rejig.pybytecode.ast(env['f'])
    print(str(ast))
    assert ast == what_should_be, '\nshould be: ' + repr(what_should_be
        ) + '\nyet it is: ' + repr(ast)


check('"hello"', Suite((Call('return', Const('hello')),)))
check('.3', Suite((Call('return', Const(0.3)),)))
check('-3', Suite((Call('return', Const(-3)),)))
check('--3', Suite((Call('return', Const(--3)),)))
check('+3', Suite((Call('return', Const(+3)),)))
check('++3', Suite((Call('return', Const(++3)),)))
check('+-3', Suite((Call('return', Const(+-3)),)))
check('3e1', Suite((Call('return', Const(30.0)),)))
check('-3e1', Suite((Call('return', Const(-30.0)),)))
check('+3e1', Suite((Call('return', Const(+30.0)),)))
check('0x123', Suite((Call('return', Const(291)),)))
check('0o123', Suite((Call('return', Const(83)),)))
check('3+4j', Suite((Call('return', Const(3 + 4.0j)),)))
check('[]', Suite((Call('return', Call('list')),)))
check('[3]', Suite((Call('return', Call('list', Const(3))),)))
check('[3,]', Suite((Call('return', Call('list', Const(3))),)))
check('[3, 4]', Suite((Call('return', Call('list', Const(3), Const(4))),)))
check('[3, 4,]', Suite((Call('return', Call('list', Const(3), Const(4))),)))
check('[3, 4, 5]', Suite((Call('return', Call('list', Const(3), Const(4),
    Const(5))),)))
check('[3, 4, 5,]', Suite((Call('return', Call('list', Const(3), Const(4),
    Const(5))),)))
check('[3, 4, 5, 6]', Suite((Call('return', Call('list', Const(3), Const(4),
    Const(5), Const(6))),)))
check('[3, 4, 5, 6,]', Suite((Call('return', Call('list', Const(3), Const(4
    ), Const(5), Const(6))),)))
check('[[1], 2, 3, 4, 5]', Suite((Call('return', Call('list', Call('list',
    Const(1)), Const(2), Const(3), Const(4), Const(5))),)))
check('[[1, 2], 3, 4, 5]', Suite((Call('return', Call('list', Call('list',
    Const(1), Const(2)), Const(3), Const(4), Const(5))),)))
check('[[1, 2, 3], 4, 5]', Suite((Call('return', Call('list', Call('list',
    Const(1), Const(2), Const(3)), Const(4), Const(5))),)))
check('[[1, 2, 3, 4], 5]', Suite((Call('return', Call('list', Call('list',
    Const(1), Const(2), Const(3), Const(4)), Const(5))),)))
check('[[1, 2, 3, 4, 5]]', Suite((Call('return', Call('list', Call('list',
    Const(1), Const(2), Const(3), Const(4), Const(5)))),)))
check('[[[1], 2, 3, 4, 5]]', Suite((Call('return', Call('list', Call('list',
    Call('list', Const(1)), Const(2), Const(3), Const(4), Const(5)))),)))
check('[[[1, 2], 3, 4, 5]]', Suite((Call('return', Call('list', Call('list',
    Call('list', Const(1), Const(2)), Const(3), Const(4), Const(5)))),)))
check('[[[1, 2, 3], 4, 5]]', Suite((Call('return', Call('list', Call('list',
    Call('list', Const(1), Const(2), Const(3)), Const(4), Const(5)))),)))
check('[[[1, 2, 3, 4], 5]]', Suite((Call('return', Call('list', Call('list',
    Call('list', Const(1), Const(2), Const(3), Const(4)), Const(5)))),)))
check('[[[1, 2, 3, 4, 5]]]', Suite((Call('return', Call('list', Call('list',
    Call('list', Const(1), Const(2), Const(3), Const(4), Const(5))))),)))
check('[1, 2, 3, 4, [5]]', Suite((Call('return', Call('list', Const(1),
    Const(2), Const(3), Const(4), Call('list', Const(5)))),)))
check('[1, 2, 3, [4, 5]]', Suite((Call('return', Call('list', Const(1),
    Const(2), Const(3), Call('list', Const(4), Const(5)))),)))
check('[1, 2, [3, 4, 5]]', Suite((Call('return', Call('list', Const(1),
    Const(2), Call('list', Const(3), Const(4), Const(5)))),)))
check('[1, [2, 3, 4, 5]]', Suite((Call('return', Call('list', Const(1),
    Call('list', Const(2), Const(3), Const(4), Const(5)))),)))
check('[[1, 2, 3, 4, [5]]]', Suite((Call('return', Call('list', Call('list',
    Const(1), Const(2), Const(3), Const(4), Call('list', Const(5))))),)))
check('[[1, 2, 3, [4, 5]]]', Suite((Call('return', Call('list', Call('list',
    Const(1), Const(2), Const(3), Call('list', Const(4), Const(5))))),)))
check('[[1, 2, [3, 4, 5]]]', Suite((Call('return', Call('list', Call('list',
    Const(1), Const(2), Call('list', Const(3), Const(4), Const(5))))),)))
check('[[1, [2, 3, 4, 5]]]', Suite((Call('return', Call('list', Call('list',
    Const(1), Call('list', Const(2), Const(3), Const(4), Const(5))))),)))
check('x = (None)', Suite((Assign((Name('x'),), Const(None)), Call('return',
    Const(None)))))
check('x = (3, None)', Suite((Assign((Name('x'),), Call('tuple', Const(3),
    Const(None))), Call('return', Const(None)))))
check('x = (3, 4, None)', Suite((Assign((Name('x'),), Call('tuple', Const(3
    ), Const(4), Const(None))), Call('return', Const(None)))))
check('x = (3, 4, 5, None)', Suite((Assign((Name('x'),), Call('tuple',
    Const(3), Const(4), Const(5), Const(None))), Call('return', Const(None)))))
check('x = (3, 4, 5, 6, None)', Suite((Assign((Name('x'),), Call('tuple',
    Const(3), Const(4), Const(5), Const(6), Const(None))), Call('return',
    Const(None)))))
check('x = ((1, None), 2, 3, 4, 5, None)', Suite((Assign((Name('x'),), Call
    ('tuple', Call('tuple', Const(1), Const(None)), Const(2), Const(3),
    Const(4), Const(5), Const(None))), Call('return', Const(None)))))
check('x = ((1, 2, None), 3, 4, 5, None)', Suite((Assign((Name('x'),), Call
    ('tuple', Call('tuple', Const(1), Const(2), Const(None)), Const(3),
    Const(4), Const(5), Const(None))), Call('return', Const(None)))))
check('x = ((1, 2, 3, None), 4, 5, None)', Suite((Assign((Name('x'),), Call
    ('tuple', Call('tuple', Const(1), Const(2), Const(3), Const(None)),
    Const(4), Const(5), Const(None))), Call('return', Const(None)))))
check('x = ((1, 2, 3, 4, None), 5, None)', Suite((Assign((Name('x'),), Call
    ('tuple', Call('tuple', Const(1), Const(2), Const(3), Const(4), Const(
    None)), Const(5), Const(None))), Call('return', Const(None)))))
check('x = ((1, 2, 3, 4, 5, None), None)', Suite((Assign((Name('x'),), Call
    ('tuple', Call('tuple', Const(1), Const(2), Const(3), Const(4), Const(5
    ), Const(None)), Const(None))), Call('return', Const(None)))))
check('x = (((1, None), 2, 3, 4, 5, None), None)', Suite((Assign((Name('x')
    ,), Call('tuple', Call('tuple', Call('tuple', Const(1), Const(None)),
    Const(2), Const(3), Const(4), Const(5), Const(None)), Const(None))),
    Call('return', Const(None)))))
check('x = (((1, 2, None), 3, 4, 5, None), None)', Suite((Assign((Name('x')
    ,), Call('tuple', Call('tuple', Call('tuple', Const(1), Const(2), Const
    (None)), Const(3), Const(4), Const(5), Const(None)), Const(None))),
    Call('return', Const(None)))))
check('x = (((1, 2, 3, None), 4, 5, None), None)', Suite((Assign((Name('x')
    ,), Call('tuple', Call('tuple', Call('tuple', Const(1), Const(2), Const
    (3), Const(None)), Const(4), Const(5), Const(None)), Const(None))),
    Call('return', Const(None)))))
check('x = (((1, 2, 3, 4, None), 5, None), None)', Suite((Assign((Name('x')
    ,), Call('tuple', Call('tuple', Call('tuple', Const(1), Const(2), Const
    (3), Const(4), Const(None)), Const(5), Const(None)), Const(None))),
    Call('return', Const(None)))))
check('x = (((1, 2, 3, 4, 5, None), None), None)', Suite((Assign((Name('x')
    ,), Call('tuple', Call('tuple', Call('tuple', Const(1), Const(2), Const
    (3), Const(4), Const(5), Const(None)), Const(None)), Const(None))),
    Call('return', Const(None)))))
check('x = (1, 2, 3, 4, (5, None), None)', Suite((Assign((Name('x'),), Call
    ('tuple', Const(1), Const(2), Const(3), Const(4), Call('tuple', Const(5
    ), Const(None)), Const(None))), Call('return', Const(None)))))
check('x = (1, 2, 3, (4, 5, None), None)', Suite((Assign((Name('x'),), Call
    ('tuple', Const(1), Const(2), Const(3), Call('tuple', Const(4), Const(5
    ), Const(None)), Const(None))), Call('return', Const(None)))))
check('x = (1, 2, (3, 4, 5, None), None)', Suite((Assign((Name('x'),), Call
    ('tuple', Const(1), Const(2), Call('tuple', Const(3), Const(4), Const(5
    ), Const(None)), Const(None))), Call('return', Const(None)))))
check('x = (1, (2, 3, 4, 5, None), None)', Suite((Assign((Name('x'),), Call
    ('tuple', Const(1), Call('tuple', Const(2), Const(3), Const(4), Const(5
    ), Const(None)), Const(None))), Call('return', Const(None)))))
check('x = ((1, 2, 3, 4, (5, None), None), None)', Suite((Assign((Name('x')
    ,), Call('tuple', Call('tuple', Const(1), Const(2), Const(3), Const(4),
    Call('tuple', Const(5), Const(None)), Const(None)), Const(None))), Call
    ('return', Const(None)))))
check('x = ((1, 2, 3, (4, 5, None), None), None)', Suite((Assign((Name('x')
    ,), Call('tuple', Call('tuple', Const(1), Const(2), Const(3), Call(
    'tuple', Const(4), Const(5), Const(None)), Const(None)), Const(None))),
    Call('return', Const(None)))))
check('x = ((1, 2, (3, 4, 5, None), None), None)', Suite((Assign((Name('x')
    ,), Call('tuple', Call('tuple', Const(1), Const(2), Call('tuple', Const
    (3), Const(4), Const(5), Const(None)), Const(None)), Const(None))),
    Call('return', Const(None)))))
check('x = ((1, (2, 3, 4, 5, None), None), None)', Suite((Assign((Name('x')
    ,), Call('tuple', Call('tuple', Const(1), Call('tuple', Const(2), Const
    (3), Const(4), Const(5), Const(None)), Const(None)), Const(None))),
    Call('return', Const(None)))))
check('3\n    ', Suite((Call('return', Const(None)),)))
check('3\n    ', Suite((Call('return', Const(None)),)))
check('3\n    ', Suite((Call('return', Const(None)),)))
check('3\n    ', Suite((Call('return', Const(None)),)))
check('\n3', Suite((Call('return', Const(None)),)))
check('\n3', Suite((Call('return', Const(None)),)))
check('\n3', Suite((Call('return', Const(None)),)))
check('\n3', Suite((Call('return', Const(None)),)))
check('a', Suite((Call('return', Name('a')),)))
check('a.b', Suite((Call('return', Call('.', Name('a'), 'b')),)))
check('a.b.c', Suite((Call('return', Call('.', Call('.', Name('a'), 'b'),
    'c')),)))
check('a.b.c.d', Suite((Call('return', Call('.', Call('.', Call('.', Name(
    'a'), 'b'), 'c'), 'd')),)))
check('a.b.c.d.e', Suite((Call('return', Call('.', Call('.', Call('.', Call
    ('.', Name('a'), 'b'), 'c'), 'd'), 'e')),)))
check('a[1]', Suite((Call('return', Call('[.]', Name('a'), Const(1))),)))
check('a[1][2]', Suite((Call('return', Call('[.]', Call('[.]', Name('a'),
    Const(1)), Const(2))),)))
check('a[1][2][3]', Suite((Call('return', Call('[.]', Call('[.]', Call(
    '[.]', Name('a'), Const(1)), Const(2)), Const(3))),)))
check('a[1][2][3][4]', Suite((Call('return', Call('[.]', Call('[.]', Call(
    '[.]', Call('[.]', Name('a'), Const(1)), Const(2)), Const(3)), Const(4)
    )),)))
check('(9, None).stuff', Suite((Call('return', Call('.', Call('tuple',
    Const(9), Const(None)), 'stuff')),)))
check('((9, None), None).stuff', Suite((Call('return', Call('.', Call(
    'tuple', Call('tuple', Const(9), Const(None)), Const(None)), 'stuff')),)))
check('(((9, None), None), None).stuff', Suite((Call('return', Call('.',
    Call('tuple', Call('tuple', Call('tuple', Const(9), Const(None)), Const
    (None)), Const(None)), 'stuff')),)))
check('a[1]', Suite((Call('return', Call('[.]', Name('a'), Const(1))),)))
check('a["hey"]', Suite((Call('return', Call('[.]', Name('a'), Const('hey')
    )),)))
check('a[1:2]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(1), Const(2), Const(None)))),)))
check('a[:]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(None), Const(None), Const(None)))),)))
check('a[1:]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(1), Const(None), Const(None)))),)))
check('a[:1]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(None), Const(1), Const(None)))),)))
check('a[::]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(None), Const(None), Const(None)))),)))
check('a[1::]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(1), Const(None), Const(None)))),)))
check('a[:1:]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(None), Const(1), Const(None)))),)))
check('a[::1]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(None), Const(None), Const(1)))),)))
check('a[1:2:]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(1), Const(2), Const(None)))),)))
check('a[:1:2]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(None), Const(1), Const(2)))),)))
check('a[1::2]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(1), Const(None), Const(2)))),)))
check('a[1:2:3]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(1), Const(2), Const(3)))),)))
check('a[1,]', Suite((Call('return', Call('[.]', Name('a'), Const(1))),)))
check('a["hey",]', Suite((Call('return', Call('[.]', Name('a'), Const('hey'
    ))),)))
check('a[1:2,]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(1), Const(2), Const(None)))),)))
check('a[:,]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(None), Const(None), Const(None)))),)))
check('a[1:,]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(1), Const(None), Const(None)))),)))
check('a[:1,]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(None), Const(1), Const(None)))),)))
check('a[::,]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(None), Const(None), Const(None)))),)))
check('a[1::,]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(1), Const(None), Const(None)))),)))
check('a[:1:,]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(None), Const(1), Const(None)))),)))
check('a[::1,]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(None), Const(None), Const(1)))),)))
check('a[1:2:,]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(1), Const(2), Const(None)))),)))
check('a[:1:2,]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(None), Const(1), Const(2)))),)))
check('a[1::2,]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(1), Const(None), Const(2)))),)))
check('a[1:2:3,]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(1), Const(2), Const(3)))),)))
check('a[1,5]', Suite((Call('return', Call('[.]', Name('a'), Const(1),
    Const(5))),)))
check('a["hey",5]', Suite((Call('return', Call('[.]', Name('a'), Const(
    'hey'), Const(5))),)))
check('a[1:2,5]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(1), Const(2), Const(None)), Const(5))),)))
check('a[:,5]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(None), Const(None), Const(None)), Const(5))),)))
check('a[1:,5]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(1), Const(None), Const(None)), Const(5))),)))
check('a[:1,5]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(None), Const(1), Const(None)), Const(5))),)))
check('a[::,5]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(None), Const(None), Const(None)), Const(5))),)))
check('a[1::,5]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(1), Const(None), Const(None)), Const(5))),)))
check('a[:1:,5]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(None), Const(1), Const(None)), Const(5))),)))
check('a[::1,5]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(None), Const(None), Const(1)), Const(5))),)))
check('a[1:2:,5]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(1), Const(2), Const(None)), Const(5))),)))
check('a[:1:2,5]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(None), Const(1), Const(2)), Const(5))),)))
check('a[1::2,5]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(1), Const(None), Const(2)), Const(5))),)))
check('a[1:2:3,5]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(1), Const(2), Const(3)), Const(5))),)))
check('a[1,5,]', Suite((Call('return', Call('[.]', Name('a'), Const(1),
    Const(5))),)))
check('a["hey",5,]', Suite((Call('return', Call('[.]', Name('a'), Const(
    'hey'), Const(5))),)))
check('a[1:2,5,]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(1), Const(2), Const(None)), Const(5))),)))
check('a[:,5,]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(None), Const(None), Const(None)), Const(5))),)))
check('a[1:,5,]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(1), Const(None), Const(None)), Const(5))),)))
check('a[:1,5,]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(None), Const(1), Const(None)), Const(5))),)))
check('a[::,5,]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(None), Const(None), Const(None)), Const(5))),)))
check('a[1::,5,]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(1), Const(None), Const(None)), Const(5))),)))
check('a[:1:,5,]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(None), Const(1), Const(None)), Const(5))),)))
check('a[::1,5,]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(None), Const(None), Const(1)), Const(5))),)))
check('a[1:2:,5,]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(1), Const(2), Const(None)), Const(5))),)))
check('a[:1:2,5,]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(None), Const(1), Const(2)), Const(5))),)))
check('a[1::2,5,]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(1), Const(None), Const(2)), Const(5))),)))
check('a[1:2:3,5,]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(1), Const(2), Const(3)), Const(5))),)))
check('a[1,"a":"b"]', Suite((Call('return', Call('[.]', Name('a'), Const(1),
    Call('slice', Const('a'), Const('b'), Const(None)))),)))
check('a["hey","a":"b"]', Suite((Call('return', Call('[.]', Name('a'),
    Const('hey'), Call('slice', Const('a'), Const('b'), Const(None)))),)))
check('a[1:2,"a":"b"]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(1), Const(2), Const(None)), Call('slice', Const('a'),
    Const('b'), Const(None)))),)))
check('a[:,"a":"b"]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(None), Const(None), Const(None)), Call('slice', Const(
    'a'), Const('b'), Const(None)))),)))
check('a[1:,"a":"b"]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(1), Const(None), Const(None)), Call('slice', Const('a'),
    Const('b'), Const(None)))),)))
check('a[:1,"a":"b"]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(None), Const(1), Const(None)), Call('slice', Const('a'),
    Const('b'), Const(None)))),)))
check('a[::,"a":"b"]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(None), Const(None), Const(None)), Call('slice', Const(
    'a'), Const('b'), Const(None)))),)))
check('a[1::,"a":"b"]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(1), Const(None), Const(None)), Call('slice', Const('a'),
    Const('b'), Const(None)))),)))
check('a[:1:,"a":"b"]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(None), Const(1), Const(None)), Call('slice', Const('a'),
    Const('b'), Const(None)))),)))
check('a[::1,"a":"b"]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(None), Const(None), Const(1)), Call('slice', Const('a'),
    Const('b'), Const(None)))),)))
check('a[1:2:,"a":"b"]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(1), Const(2), Const(None)), Call('slice', Const('a'),
    Const('b'), Const(None)))),)))
check('a[:1:2,"a":"b"]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(None), Const(1), Const(2)), Call('slice', Const('a'),
    Const('b'), Const(None)))),)))
check('a[1::2,"a":"b"]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(1), Const(None), Const(2)), Call('slice', Const('a'),
    Const('b'), Const(None)))),)))
check('a[1:2:3,"a":"b"]', Suite((Call('return', Call('[.]', Name('a'), Call
    ('slice', Const(1), Const(2), Const(3)), Call('slice', Const('a'),
    Const('b'), Const(None)))),)))
check('a[1,"a":"b",]', Suite((Call('return', Call('[.]', Name('a'), Const(1
    ), Call('slice', Const('a'), Const('b'), Const(None)))),)))
check('a["hey","a":"b",]', Suite((Call('return', Call('[.]', Name('a'),
    Const('hey'), Call('slice', Const('a'), Const('b'), Const(None)))),)))
check('a[1:2,"a":"b",]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(1), Const(2), Const(None)), Call('slice', Const('a'),
    Const('b'), Const(None)))),)))
check('a[:,"a":"b",]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(None), Const(None), Const(None)), Call('slice', Const(
    'a'), Const('b'), Const(None)))),)))
check('a[1:,"a":"b",]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(1), Const(None), Const(None)), Call('slice', Const('a'),
    Const('b'), Const(None)))),)))
check('a[:1,"a":"b",]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(None), Const(1), Const(None)), Call('slice', Const('a'),
    Const('b'), Const(None)))),)))
check('a[::,"a":"b",]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(None), Const(None), Const(None)), Call('slice', Const(
    'a'), Const('b'), Const(None)))),)))
check('a[1::,"a":"b",]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(1), Const(None), Const(None)), Call('slice', Const('a'),
    Const('b'), Const(None)))),)))
check('a[:1:,"a":"b",]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(None), Const(1), Const(None)), Call('slice', Const('a'),
    Const('b'), Const(None)))),)))
check('a[::1,"a":"b",]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(None), Const(None), Const(1)), Call('slice', Const('a'),
    Const('b'), Const(None)))),)))
check('a[1:2:,"a":"b",]', Suite((Call('return', Call('[.]', Name('a'), Call
    ('slice', Const(1), Const(2), Const(None)), Call('slice', Const('a'),
    Const('b'), Const(None)))),)))
check('a[:1:2,"a":"b",]', Suite((Call('return', Call('[.]', Name('a'), Call
    ('slice', Const(None), Const(1), Const(2)), Call('slice', Const('a'),
    Const('b'), Const(None)))),)))
check('a[1::2,"a":"b",]', Suite((Call('return', Call('[.]', Name('a'), Call
    ('slice', Const(1), Const(None), Const(2)), Call('slice', Const('a'),
    Const('b'), Const(None)))),)))
check('a[1:2:3,"a":"b",]', Suite((Call('return', Call('[.]', Name('a'),
    Call('slice', Const(1), Const(2), Const(3)), Call('slice', Const('a'),
    Const('b'), Const(None)))),)))
check('a[1,5,6]', Suite((Call('return', Call('[.]', Name('a'), Const(1),
    Const(5), Const(6))),)))
check('a["hey",5,6]', Suite((Call('return', Call('[.]', Name('a'), Const(
    'hey'), Const(5), Const(6))),)))
check('a[1:2,5,6]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(1), Const(2), Const(None)), Const(5), Const(6))),)))
check('a[:,5,6]', Suite((Call('return', Call('[.]', Name('a'), Call('slice',
    Const(None), Const(None), Const(None)), Const(5), Const(6))),)))
check('a[1:,5,6]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(1), Const(None), Const(None)), Const(5), Const(6))),)))
check('a[:1,5,6]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(None), Const(1), Const(None)), Const(5), Const(6))),)))
check('a[::,5,6]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(None), Const(None), Const(None)), Const(5), Const(6))),)))
check('a[1::,5,6]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(1), Const(None), Const(None)), Const(5), Const(6))),)))
check('a[:1:,5,6]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(None), Const(1), Const(None)), Const(5), Const(6))),)))
check('a[::1,5,6]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(None), Const(None), Const(1)), Const(5), Const(6))),)))
check('a[1:2:,5,6]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(1), Const(2), Const(None)), Const(5), Const(6))),)))
check('a[:1:2,5,6]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(None), Const(1), Const(2)), Const(5), Const(6))),)))
check('a[1::2,5,6]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(1), Const(None), Const(2)), Const(5), Const(6))),)))
check('a[1:2:3,5,6]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(1), Const(2), Const(3)), Const(5), Const(6))),)))
check('a[1,5,6,]', Suite((Call('return', Call('[.]', Name('a'), Const(1),
    Const(5), Const(6))),)))
check('a["hey",5,6,]', Suite((Call('return', Call('[.]', Name('a'), Const(
    'hey'), Const(5), Const(6))),)))
check('a[1:2,5,6,]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(1), Const(2), Const(None)), Const(5), Const(6))),)))
check('a[:,5,6,]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(None), Const(None), Const(None)), Const(5), Const(6))),)))
check('a[1:,5,6,]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(1), Const(None), Const(None)), Const(5), Const(6))),)))
check('a[:1,5,6,]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(None), Const(1), Const(None)), Const(5), Const(6))),)))
check('a[::,5,6,]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(None), Const(None), Const(None)), Const(5), Const(6))),)))
check('a[1::,5,6,]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(1), Const(None), Const(None)), Const(5), Const(6))),)))
check('a[:1:,5,6,]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(None), Const(1), Const(None)), Const(5), Const(6))),)))
check('a[::1,5,6,]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(None), Const(None), Const(1)), Const(5), Const(6))),)))
check('a[1:2:,5,6,]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(1), Const(2), Const(None)), Const(5), Const(6))),)))
check('a[:1:2,5,6,]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(None), Const(1), Const(2)), Const(5), Const(6))),)))
check('a[1::2,5,6,]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(1), Const(None), Const(2)), Const(5), Const(6))),)))
check('a[1:2:3,5,6,]', Suite((Call('return', Call('[.]', Name('a'), Call(
    'slice', Const(1), Const(2), Const(3)), Const(5), Const(6))),)))
check('a[1:[2]:3,[],5,6,]', Suite((Call('return', Call('[.]', Name('a'),
    Call('slice', Const(1), Call('list', Const(2)), Const(3)), Call('list'),
    Const(5), Const(6))),)))
check('a[1:[[2]]:3,[[]],5,6,]', Suite((Call('return', Call('[.]', Name('a'),
    Call('slice', Const(1), Call('list', Call('list', Const(2))), Const(3)),
    Call('list', Call('list')), Const(5), Const(6))),)))
check('a[2].three', Suite((Call('return', Call('.', Call('[.]', Name('a'),
    Const(2)), 'three')),)))
check('a.three', Suite((Call('return', Call('.', Name('a'), 'three')),)))
check('a[2]', Suite((Call('return', Call('[.]', Name('a'), Const(2))),)))
check('a.three[2]', Suite((Call('return', Call('[.]', Call('.', Name('a'),
    'three'), Const(2))),)))
check('x and y', Suite((Call('return', Call('and', Name('x'), Name('y'))),)))
check('x and y and z', Suite((Call('return', Call('and', Name('x'), Call(
    'and', Name('y'), Name('z')))),)))
check('x and y and z and w', Suite((Call('return', Call('and', Name('x'),
    Call('and', Name('y'), Call('and', Name('z'), Name('w'))))),)))
check('not x', Suite((Call('return', Call('not', Name('x'))),)))
check('not x and y', Suite((Call('return', Call('and', Call('not', Name('x'
    )), Name('y'))),)))
check('x or y', Suite((Call('return', Call('or', Name('x'), Name('y'))),)))
check('x or y and z', Suite((Call('return', Call('or', Name('x'), Call(
    'and', Name('y'), Name('z')))),)))
check('x or y or z', Suite((Call('return', Call('or', Name('x'), Call('or',
    Name('y'), Name('z')))),)))
check('not x or y and z', Suite((Call('return', Call('or', Call('not', Name
    ('x')), Call('and', Name('y'), Name('z')))),)))
check('x or not y and z', Suite((Call('return', Call('or', Name('x'), Call(
    'and', Call('not', Name('y')), Name('z')))),)))
check('x or y and not z', Suite((Call('return', Call('or', Name('x'), Call(
    'and', Name('y'), Call('not', Name('z'))))),)))
check('not x or not y and z', Suite((Call('return', Call('or', Call('not',
    Name('x')), Call('and', Call('not', Name('y')), Name('z')))),)))
check('not x or y and not z', Suite((Call('return', Call('or', Call('not',
    Name('x')), Call('and', Name('y'), Call('not', Name('z'))))),)))
check('x or not y and not z', Suite((Call('return', Call('or', Name('x'),
    Call('and', Call('not', Name('y')), Call('not', Name('z'))))),)))
check('not x or not y and not z', Suite((Call('return', Call('or', Call(
    'not', Name('x')), Call('and', Call('not', Name('y')), Call('not', Name
    ('z'))))),)))
check('x and y or z', Suite((Call('return', Call('or', Call('and', Name('x'
    ), Name('y')), Name('z'))),)))
check('not x and y or z', Suite((Call('return', Call('or', Call('and', Call
    ('not', Name('x')), Name('y')), Name('z'))),)))
check('x and not y or z', Suite((Call('return', Call('or', Call('and', Name
    ('x'), Call('not', Name('y'))), Name('z'))),)))
check('x and y or not z', Suite((Call('return', Call('or', Call('and', Name
    ('x'), Name('y')), Call('not', Name('z')))),)))
check('not x and not y or z', Suite((Call('return', Call('or', Call('and',
    Call('not', Name('x')), Call('not', Name('y'))), Name('z'))),)))
check('not x and y or not z', Suite((Call('return', Call('or', Call('and',
    Call('not', Name('x')), Name('y')), Call('not', Name('z')))),)))
check('x and not y or not z', Suite((Call('return', Call('or', Call('and',
    Name('x'), Call('not', Name('y'))), Call('not', Name('z')))),)))
check('x < y', Suite((Call('return', Call('<', Name('x'), Name('y'))),)))
check('x > y', Suite((Call('return', Call('>', Name('x'), Name('y'))),)))
check('x == y', Suite((Call('return', Call('==', Name('x'), Name('y'))),)))
check('x >= y', Suite((Call('return', Call('>=', Name('x'), Name('y'))),)))
check('x <= y', Suite((Call('return', Call('<=', Name('x'), Name('y'))),)))
check('x != y', Suite((Call('return', Call('!=', Name('x'), Name('y'))),)))
check('x in y', Suite((Call('return', Call('in', Name('x'), Name('y'))),)))
check('x not in y', Suite((Call('return', Call('not-in', Name('x'), Name(
    'y'))),)))
check('1 < y < 2', Suite((Call('return', Call('and', Call('<', Const(1),
    Name('y')), Call('<', Name('y'), Const(2)))),)))
check('1 < y == 2', Suite((Call('return', Call('and', Call('<', Const(1),
    Name('y')), Call('==', Name('y'), Const(2)))),)))
check('(x, None) < y', Suite((Call('return', Call('<', Call('tuple', Name(
    'x'), Const(None)), Name('y'))),)))
check('(x, None) > y', Suite((Call('return', Call('>', Call('tuple', Name(
    'x'), Const(None)), Name('y'))),)))
check('(x, None) == y', Suite((Call('return', Call('==', Call('tuple', Name
    ('x'), Const(None)), Name('y'))),)))
check('(x, None) >= y', Suite((Call('return', Call('>=', Call('tuple', Name
    ('x'), Const(None)), Name('y'))),)))
check('(x, None) <= y', Suite((Call('return', Call('<=', Call('tuple', Name
    ('x'), Const(None)), Name('y'))),)))
check('(x, None) != y', Suite((Call('return', Call('!=', Call('tuple', Name
    ('x'), Const(None)), Name('y'))),)))
check('(x, None) in y', Suite((Call('return', Call('in', Call('tuple', Name
    ('x'), Const(None)), Name('y'))),)))
check('(x, None) not in y', Suite((Call('return', Call('not-in', Call(
    'tuple', Name('x'), Const(None)), Name('y'))),)))
check('(1, None) < y < 2', Suite((Call('return', Call('and', Call('<', Call
    ('tuple', Const(1), Const(None)), Name('y')), Call('<', Name('y'),
    Const(2)))),)))
check('(1, None) < y == 2', Suite((Call('return', Call('and', Call('<',
    Call('tuple', Const(1), Const(None)), Name('y')), Call('==', Name('y'),
    Const(2)))),)))
check('x < (y, None)', Suite((Call('return', Call('<', Name('x'), Call(
    'tuple', Name('y'), Const(None)))),)))
check('x > (y, None)', Suite((Call('return', Call('>', Name('x'), Call(
    'tuple', Name('y'), Const(None)))),)))
check('x == (y, None)', Suite((Call('return', Call('==', Name('x'), Call(
    'tuple', Name('y'), Const(None)))),)))
check('x >= (y, None)', Suite((Call('return', Call('>=', Name('x'), Call(
    'tuple', Name('y'), Const(None)))),)))
check('x <= (y, None)', Suite((Call('return', Call('<=', Name('x'), Call(
    'tuple', Name('y'), Const(None)))),)))
check('x != (y, None)', Suite((Call('return', Call('!=', Name('x'), Call(
    'tuple', Name('y'), Const(None)))),)))
check('x in (y, None)', Suite((Call('return', Call('in', Name('x'), Call(
    'tuple', Name('y'), Const(None)))),)))
check('x not in (y, None)', Suite((Call('return', Call('not-in', Name('x'),
    Call('tuple', Name('y'), Const(None)))),)))
check('1 < (y, None) < 2', Suite((Call('return', Call('and', Call('<',
    Const(1), Call('tuple', Name('y'), Const(None))), Call('<', Call(
    'tuple', Name('y'), Const(None)), Const(2)))),)))
check('1 < (y, None) == 2', Suite((Call('return', Call('and', Call('<',
    Const(1), Call('tuple', Name('y'), Const(None))), Call('==', Call(
    'tuple', Name('y'), Const(None)), Const(2)))),)))
check('1 < y < (2, None)', Suite((Call('return', Call('and', Call('<',
    Const(1), Name('y')), Call('<', Name('y'), Call('tuple', Const(2),
    Const(None))))),)))
check('1 < y == (2, None)', Suite((Call('return', Call('and', Call('<',
    Const(1), Name('y')), Call('==', Name('y'), Call('tuple', Const(2),
    Const(None))))),)))
check('(x, None) < (y, None)', Suite((Call('return', Call('<', Call('tuple',
    Name('x'), Const(None)), Call('tuple', Name('y'), Const(None)))),)))
check('(x, None) > (y, None)', Suite((Call('return', Call('>', Call('tuple',
    Name('x'), Const(None)), Call('tuple', Name('y'), Const(None)))),)))
check('(x, None) == (y, None)', Suite((Call('return', Call('==', Call(
    'tuple', Name('x'), Const(None)), Call('tuple', Name('y'), Const(None))
    )),)))
check('(x, None) >= (y, None)', Suite((Call('return', Call('>=', Call(
    'tuple', Name('x'), Const(None)), Call('tuple', Name('y'), Const(None))
    )),)))
check('(x, None) <= (y, None)', Suite((Call('return', Call('<=', Call(
    'tuple', Name('x'), Const(None)), Call('tuple', Name('y'), Const(None))
    )),)))
check('(x, None) != (y, None)', Suite((Call('return', Call('!=', Call(
    'tuple', Name('x'), Const(None)), Call('tuple', Name('y'), Const(None))
    )),)))
check('(x, None) in (y, None)', Suite((Call('return', Call('in', Call(
    'tuple', Name('x'), Const(None)), Call('tuple', Name('y'), Const(None))
    )),)))
check('(x, None) not in (y, None)', Suite((Call('return', Call('not-in',
    Call('tuple', Name('x'), Const(None)), Call('tuple', Name('y'), Const(
    None)))),)))
check('(1, None) < (y, None) < 2', Suite((Call('return', Call('and', Call(
    '<', Call('tuple', Const(1), Const(None)), Call('tuple', Name('y'),
    Const(None))), Call('<', Call('tuple', Name('y'), Const(None)), Const(2
    )))),)))
check('(1, None) < (y, None) == 2', Suite((Call('return', Call('and', Call(
    '<', Call('tuple', Const(1), Const(None)), Call('tuple', Name('y'),
    Const(None))), Call('==', Call('tuple', Name('y'), Const(None)), Const(
    2)))),)))
check('(1, None) < y < (2, None)', Suite((Call('return', Call('and', Call(
    '<', Call('tuple', Const(1), Const(None)), Name('y')), Call('<', Name(
    'y'), Call('tuple', Const(2), Const(None))))),)))
check('(1, None) < y == (2, None)', Suite((Call('return', Call('and', Call(
    '<', Call('tuple', Const(1), Const(None)), Name('y')), Call('==', Name(
    'y'), Call('tuple', Const(2), Const(None))))),)))
check('x + y', Suite((Call('return', Call('+', Name('x'), Name('y'))),)))
check('x + y + z', Suite((Call('return', Call('+', Call('+', Name('x'),
    Name('y')), Name('z'))),)))
check('x + y + z + w', Suite((Call('return', Call('+', Call('+', Call('+',
    Name('x'), Name('y')), Name('z')), Name('w'))),)))
check('x - y', Suite((Call('return', Call('-', Name('x'), Name('y'))),)))
check('x - y - z', Suite((Call('return', Call('-', Call('-', Name('x'),
    Name('y')), Name('z'))),)))
check('x - y - z - w', Suite((Call('return', Call('-', Call('-', Call('-',
    Name('x'), Name('y')), Name('z')), Name('w'))),)))
check('x - y + z - w', Suite((Call('return', Call('-', Call('+', Call('-',
    Name('x'), Name('y')), Name('z')), Name('w'))),)))
check('x * y', Suite((Call('return', Call('*', Name('x'), Name('y'))),)))
check('x * y * z', Suite((Call('return', Call('*', Call('*', Name('x'),
    Name('y')), Name('z'))),)))
check('x * y * z * w', Suite((Call('return', Call('*', Call('*', Call('*',
    Name('x'), Name('y')), Name('z')), Name('w'))),)))
check('x * y - z * w', Suite((Call('return', Call('-', Call('*', Name('x'),
    Name('y')), Call('*', Name('z'), Name('w')))),)))
check('x / y', Suite((Call('return', Call('/', Name('x'), Name('y'))),)))
check('x / y / z', Suite((Call('return', Call('/', Call('/', Name('x'),
    Name('y')), Name('z'))),)))
check('x / y / z / w', Suite((Call('return', Call('/', Call('/', Call('/',
    Name('x'), Name('y')), Name('z')), Name('w'))),)))
check('x / y * z / w', Suite((Call('return', Call('/', Call('*', Call('/',
    Name('x'), Name('y')), Name('z')), Name('w'))),)))
check('x % y', Suite((Call('return', Call('%', Name('x'), Name('y'))),)))
check('x % y % z', Suite((Call('return', Call('%', Call('%', Name('x'),
    Name('y')), Name('z'))),)))
check('x % y % z % w', Suite((Call('return', Call('%', Call('%', Call('%',
    Name('x'), Name('y')), Name('z')), Name('w'))),)))
check('x % y / z % w', Suite((Call('return', Call('%', Call('/', Call('%',
    Name('x'), Name('y')), Name('z')), Name('w'))),)))
check('x // y', Suite((Call('return', Call('//', Name('x'), Name('y'))),)))
check('x // y // z', Suite((Call('return', Call('//', Call('//', Name('x'),
    Name('y')), Name('z'))),)))
check('x // y // z // w', Suite((Call('return', Call('//', Call('//', Call(
    '//', Name('x'), Name('y')), Name('z')), Name('w'))),)))
check('x // y % z // w', Suite((Call('return', Call('//', Call('%', Call(
    '//', Name('x'), Name('y')), Name('z')), Name('w'))),)))
check('+x', Suite((Call('return', Call('u+', Name('x'))),)))
check('-x', Suite((Call('return', Call('u-', Name('x'))),)))
check('++x', Suite((Call('return', Call('u+', Call('u+', Name('x')))),)))
check('+-x', Suite((Call('return', Call('u+', Call('u-', Name('x')))),)))
check('-+x', Suite((Call('return', Call('u-', Call('u+', Name('x')))),)))
check('--x', Suite((Call('return', Call('u-', Call('u-', Name('x')))),)))
check('+x + y', Suite((Call('return', Call('+', Call('u+', Name('x')), Name
    ('y'))),)))
check('-x + y', Suite((Call('return', Call('+', Call('u-', Name('x')), Name
    ('y'))),)))
check('++x + y', Suite((Call('return', Call('+', Call('u+', Call('u+', Name
    ('x'))), Name('y'))),)))
check('+-x + y', Suite((Call('return', Call('+', Call('u+', Call('u-', Name
    ('x'))), Name('y'))),)))
check('-+x + y', Suite((Call('return', Call('+', Call('u-', Call('u+', Name
    ('x'))), Name('y'))),)))
check('--x + y', Suite((Call('return', Call('+', Call('u-', Call('u-', Name
    ('x'))), Name('y'))),)))
check('x + +x', Suite((Call('return', Call('+', Name('x'), Call('u+', Name(
    'x')))),)))
check('x + -x', Suite((Call('return', Call('+', Name('x'), Call('u-', Name(
    'x')))),)))
check('x + ++x', Suite((Call('return', Call('+', Name('x'), Call('u+', Call
    ('u+', Name('x'))))),)))
check('x + +-x', Suite((Call('return', Call('+', Name('x'), Call('u+', Call
    ('u-', Name('x'))))),)))
check('x + -+x', Suite((Call('return', Call('+', Name('x'), Call('u-', Call
    ('u+', Name('x'))))),)))
check('x + --x', Suite((Call('return', Call('+', Name('x'), Call('u-', Call
    ('u-', Name('x'))))),)))
check('x ** y', Suite((Call('return', Call('**', Name('x'), Name('y'))),)))
check('x ** y ** z', Suite((Call('return', Call('**', Name('x'), Call('**',
    Name('y'), Name('z')))),)))
check('x ** y ** z ** w', Suite((Call('return', Call('**', Name('x'), Call(
    '**', Name('y'), Call('**', Name('z'), Name('w'))))),)))
check('x ** y // z ** w', Suite((Call('return', Call('//', Call('**', Name(
    'x'), Name('y')), Call('**', Name('z'), Name('w')))),)))
check('x.y**2', Suite((Call('return', Call('**', Call('.', Name('x'), 'y'),
    Const(2))),)))
check('f(None)', Suite((Call('return', Call(Name('f'), Const(None))),)))
check('f(x, None)', Suite((Call('return', Call(Name('f'), Name('x'), Const(
    None))),)))
check('f(x, y, None)', Suite((Call('return', Call(Name('f'), Name('x'),
    Name('y'), Const(None))),)))
check('f(x, y, z, None)', Suite((Call('return', Call(Name('f'), Name('x'),
    Name('y'), Name('z'), Const(None))),)))
check('f(x=1)', Suite((Call('return', CallKeyword(Name('f'), (), (('x',
    Const(1)),))),)))
check('f(x, y=1)', Suite((Call('return', CallKeyword(Name('f'), (Name('x'),
    ), (('y', Const(1)),))),)))
check('f(x, y, z=1)', Suite((Call('return', CallKeyword(Name('f'), (Name(
    'x'), Name('y')), (('z', Const(1)),))),)))
check('x = 1; x', Suite((Assign((Name('x'),), Const(1)), Name('x'), Call(
    'return', Const(None)))))
check('x = 1; x;', Suite((Assign((Name('x'),), Const(1)), Name('x'), Call(
    'return', Const(None)))))
check('x, = 1; x', Suite((Assign((Unpack((Name('x'),)),), Const(1)), Name(
    'x'), Call('return', Const(None)))))
check('x, y = 1; x', Suite((Assign((Unpack((Name('x'), Name('y'))),), Const
    (1)), Name('x'), Call('return', Const(None)))))
check('x, y, = 1; x', Suite((Assign((Unpack((Name('x'), Name('y'))),),
    Const(1)), Name('x'), Call('return', Const(None)))))
check('x, y, z = 1; x', Suite((Assign((Unpack((Name('x'), Name('y'), Name(
    'z'))),), Const(1)), Name('x'), Call('return', Const(None)))))
check('x, y, z, = 1; x', Suite((Assign((Unpack((Name('x'), Name('y'), Name(
    'z'))),), Const(1)), Name('x'), Call('return', Const(None)))))
check('False', Suite((Call('return', Const(False)),)))
check('True', Suite((Call('return', Const(True)),)))
check('not x', Suite((Call('return', Call('not', Name('x'))),)))
check('not x and not y', Suite((Call('return', Call('and', Call('not', Name
    ('x')), Call('not', Name('y')))),)))
check('not x and not y and not z', Suite((Call('return', Call('and', Call(
    'not', Name('x')), Call('and', Call('not', Name('y')), Call('not', Name
    ('z'))))),)))
check('not x and not y and not z', Suite((Call('return', Call('and', Call(
    'not', Name('x')), Call('and', Call('not', Name('y')), Call('not', Name
    ('z'))))),)))
check('not x and not y and not z', Suite((Call('return', Call('and', Call(
    'not', Name('x')), Call('and', Call('not', Name('y')), Call('not', Name
    ('z'))))),)))
check('not x or not y', Suite((Call('return', Call('or', Call('not', Name(
    'x')), Call('not', Name('y')))),)))
check('not x or not y or not z', Suite((Call('return', Call('or', Call(
    'not', Name('x')), Call('or', Call('not', Name('y')), Call('not', Name(
    'z'))))),)))
check('not x or not y or not z', Suite((Call('return', Call('or', Call(
    'not', Name('x')), Call('or', Call('not', Name('y')), Call('not', Name(
    'z'))))),)))
check('not x or not y or not z', Suite((Call('return', Call('or', Call(
    'not', Name('x')), Call('or', Call('not', Name('y')), Call('not', Name(
    'z'))))),)))
check('(not x or not y, None) and not z', Suite((Call('return', Call('and',
    Call('tuple', Call('or', Call('not', Name('x')), Call('not', Name('y'))
    ), Const(None)), Call('not', Name('z')))),)))
check('not x and (not y or not z, None)', Suite((Call('return', Call('and',
    Call('not', Name('x')), Call('tuple', Call('or', Call('not', Name('y')),
    Call('not', Name('z'))), Const(None)))),)))
check('not x(1, None)', Suite((Call('return', Call('not', Call(Name('x'),
    Const(1), Const(None)))),)))
check('not x(1, None) and not y(2, None)', Suite((Call('return', Call('and',
    Call('not', Call(Name('x'), Const(1), Const(None))), Call('not', Call(
    Name('y'), Const(2), Const(None))))),)))
check('not x(1, None) and not y(2, None) and not z(3, None)', Suite((Call(
    'return', Call('and', Call('not', Call(Name('x'), Const(1), Const(None)
    )), Call('and', Call('not', Call(Name('y'), Const(2), Const(None))),
    Call('not', Call(Name('z'), Const(3), Const(None)))))),)))
check('not x(1, None) and not y(2, None) and not z(3, None)', Suite((Call(
    'return', Call('and', Call('not', Call(Name('x'), Const(1), Const(None)
    )), Call('and', Call('not', Call(Name('y'), Const(2), Const(None))),
    Call('not', Call(Name('z'), Const(3), Const(None)))))),)))
check('not x(1, None) and not y(2, None) and not z(3, None)', Suite((Call(
    'return', Call('and', Call('not', Call(Name('x'), Const(1), Const(None)
    )), Call('and', Call('not', Call(Name('y'), Const(2), Const(None))),
    Call('not', Call(Name('z'), Const(3), Const(None)))))),)))
check('not x(1, None) or not y(2, None)', Suite((Call('return', Call('or',
    Call('not', Call(Name('x'), Const(1), Const(None))), Call('not', Call(
    Name('y'), Const(2), Const(None))))),)))
check('not x(1, None) or not y(2, None) or not z(3, None)', Suite((Call(
    'return', Call('or', Call('not', Call(Name('x'), Const(1), Const(None))
    ), Call('or', Call('not', Call(Name('y'), Const(2), Const(None))), Call
    ('not', Call(Name('z'), Const(3), Const(None)))))),)))
check('not x(1, None) or not y(2, None) or not z(3, None)', Suite((Call(
    'return', Call('or', Call('not', Call(Name('x'), Const(1), Const(None))
    ), Call('or', Call('not', Call(Name('y'), Const(2), Const(None))), Call
    ('not', Call(Name('z'), Const(3), Const(None)))))),)))
check('not x(1, None) or not y(2, None) or not z(3, None)', Suite((Call(
    'return', Call('or', Call('not', Call(Name('x'), Const(1), Const(None))
    ), Call('or', Call('not', Call(Name('y'), Const(2), Const(None))), Call
    ('not', Call(Name('z'), Const(3), Const(None)))))),)))
check('(not x(1, None) or not y(2, None), None) and not z(3, None)', Suite(
    (Call('return', Call('and', Call('tuple', Call('or', Call('not', Call(
    Name('x'), Const(1), Const(None))), Call('not', Call(Name('y'), Const(2
    ), Const(None)))), Const(None)), Call('not', Call(Name('z'), Const(3),
    Const(None))))),)))
check('not x(1, None) and (not y(2, None) or not z(3, None), None)', Suite(
    (Call('return', Call('and', Call('not', Call(Name('x'), Const(1), Const
    (None))), Call('tuple', Call('or', Call('not', Call(Name('y'), Const(2),
    Const(None))), Call('not', Call(Name('z'), Const(3), Const(None)))),
    Const(None)))),)))
check('not x.a', Suite((Call('return', Call('not', Call('.', Name('x'), 'a'
    ))),)))
check('not x.a and not y.b', Suite((Call('return', Call('and', Call('not',
    Call('.', Name('x'), 'a')), Call('not', Call('.', Name('y'), 'b')))),)))
check('not x.a and not y.b and not z.c', Suite((Call('return', Call('and',
    Call('not', Call('.', Name('x'), 'a')), Call('and', Call('not', Call(
    '.', Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check('not x.a and not y.b and not z.c', Suite((Call('return', Call('and',
    Call('not', Call('.', Name('x'), 'a')), Call('and', Call('not', Call(
    '.', Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check('not x.a and not y.b and not z.c', Suite((Call('return', Call('and',
    Call('not', Call('.', Name('x'), 'a')), Call('and', Call('not', Call(
    '.', Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check('not x.a or not y.b', Suite((Call('return', Call('or', Call('not',
    Call('.', Name('x'), 'a')), Call('not', Call('.', Name('y'), 'b')))),)))
check('not x.a or not y.b or not z.c', Suite((Call('return', Call('or',
    Call('not', Call('.', Name('x'), 'a')), Call('or', Call('not', Call('.',
    Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check('not x.a or not y.b or not z.c', Suite((Call('return', Call('or',
    Call('not', Call('.', Name('x'), 'a')), Call('or', Call('not', Call('.',
    Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check('not x.a or not y.b or not z.c', Suite((Call('return', Call('or',
    Call('not', Call('.', Name('x'), 'a')), Call('or', Call('not', Call('.',
    Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check('(not x.a or not y.b, None) and not z.c', Suite((Call('return', Call(
    'and', Call('tuple', Call('or', Call('not', Call('.', Name('x'), 'a')),
    Call('not', Call('.', Name('y'), 'b'))), Const(None)), Call('not', Call
    ('.', Name('z'), 'c')))),)))
check('not x.a and (not y.b or not z.c, None)', Suite((Call('return', Call(
    'and', Call('not', Call('.', Name('x'), 'a')), Call('tuple', Call('or',
    Call('not', Call('.', Name('y'), 'b')), Call('not', Call('.', Name('z'),
    'c'))), Const(None)))),)))
check('False', Suite((Call('return', Const(False)),)))
check('True', Suite((Call('return', Const(True)),)))
check('not x', Suite((Call('return', Call('not', Name('x'))),)))
check('not x and not y', Suite((Call('return', Call('and', Call('not', Name
    ('x')), Call('not', Name('y')))),)))
check('not x and not y and not z', Suite((Call('return', Call('and', Call(
    'not', Name('x')), Call('and', Call('not', Name('y')), Call('not', Name
    ('z'))))),)))
check('not x and not y and not z', Suite((Call('return', Call('and', Call(
    'not', Name('x')), Call('and', Call('not', Name('y')), Call('not', Name
    ('z'))))),)))
check('not x and not y and not z', Suite((Call('return', Call('and', Call(
    'not', Name('x')), Call('and', Call('not', Name('y')), Call('not', Name
    ('z'))))),)))
check('not x or not y', Suite((Call('return', Call('or', Call('not', Name(
    'x')), Call('not', Name('y')))),)))
check('not x or not y or not z', Suite((Call('return', Call('or', Call(
    'not', Name('x')), Call('or', Call('not', Name('y')), Call('not', Name(
    'z'))))),)))
check('not x or not y or not z', Suite((Call('return', Call('or', Call(
    'not', Name('x')), Call('or', Call('not', Name('y')), Call('not', Name(
    'z'))))),)))
check('not x or not y or not z', Suite((Call('return', Call('or', Call(
    'not', Name('x')), Call('or', Call('not', Name('y')), Call('not', Name(
    'z'))))),)))
check('(not x or not y, None) and not z', Suite((Call('return', Call('and',
    Call('tuple', Call('or', Call('not', Name('x')), Call('not', Name('y'))
    ), Const(None)), Call('not', Name('z')))),)))
check('not x and (not y or not z, None)', Suite((Call('return', Call('and',
    Call('not', Name('x')), Call('tuple', Call('or', Call('not', Name('y')),
    Call('not', Name('z'))), Const(None)))),)))
check('not x(1, None)', Suite((Call('return', Call('not', Call(Name('x'),
    Const(1), Const(None)))),)))
check('not x(1, None) and not y(2, None)', Suite((Call('return', Call('and',
    Call('not', Call(Name('x'), Const(1), Const(None))), Call('not', Call(
    Name('y'), Const(2), Const(None))))),)))
check('not x(1, None) and not y(2, None) and not z(3, None)', Suite((Call(
    'return', Call('and', Call('not', Call(Name('x'), Const(1), Const(None)
    )), Call('and', Call('not', Call(Name('y'), Const(2), Const(None))),
    Call('not', Call(Name('z'), Const(3), Const(None)))))),)))
check('not x(1, None) and not y(2, None) and not z(3, None)', Suite((Call(
    'return', Call('and', Call('not', Call(Name('x'), Const(1), Const(None)
    )), Call('and', Call('not', Call(Name('y'), Const(2), Const(None))),
    Call('not', Call(Name('z'), Const(3), Const(None)))))),)))
check('not x(1, None) and not y(2, None) and not z(3, None)', Suite((Call(
    'return', Call('and', Call('not', Call(Name('x'), Const(1), Const(None)
    )), Call('and', Call('not', Call(Name('y'), Const(2), Const(None))),
    Call('not', Call(Name('z'), Const(3), Const(None)))))),)))
check('not x(1, None) or not y(2, None)', Suite((Call('return', Call('or',
    Call('not', Call(Name('x'), Const(1), Const(None))), Call('not', Call(
    Name('y'), Const(2), Const(None))))),)))
check('not x(1, None) or not y(2, None) or not z(3, None)', Suite((Call(
    'return', Call('or', Call('not', Call(Name('x'), Const(1), Const(None))
    ), Call('or', Call('not', Call(Name('y'), Const(2), Const(None))), Call
    ('not', Call(Name('z'), Const(3), Const(None)))))),)))
check('not x(1, None) or not y(2, None) or not z(3, None)', Suite((Call(
    'return', Call('or', Call('not', Call(Name('x'), Const(1), Const(None))
    ), Call('or', Call('not', Call(Name('y'), Const(2), Const(None))), Call
    ('not', Call(Name('z'), Const(3), Const(None)))))),)))
check('not x(1, None) or not y(2, None) or not z(3, None)', Suite((Call(
    'return', Call('or', Call('not', Call(Name('x'), Const(1), Const(None))
    ), Call('or', Call('not', Call(Name('y'), Const(2), Const(None))), Call
    ('not', Call(Name('z'), Const(3), Const(None)))))),)))
check('(not x(1, None) or not y(2, None), None) and not z(3, None)', Suite(
    (Call('return', Call('and', Call('tuple', Call('or', Call('not', Call(
    Name('x'), Const(1), Const(None))), Call('not', Call(Name('y'), Const(2
    ), Const(None)))), Const(None)), Call('not', Call(Name('z'), Const(3),
    Const(None))))),)))
check('not x(1, None) and (not y(2, None) or not z(3, None), None)', Suite(
    (Call('return', Call('and', Call('not', Call(Name('x'), Const(1), Const
    (None))), Call('tuple', Call('or', Call('not', Call(Name('y'), Const(2),
    Const(None))), Call('not', Call(Name('z'), Const(3), Const(None)))),
    Const(None)))),)))
check('not x.a', Suite((Call('return', Call('not', Call('.', Name('x'), 'a'
    ))),)))
check('not x.a and not y.b', Suite((Call('return', Call('and', Call('not',
    Call('.', Name('x'), 'a')), Call('not', Call('.', Name('y'), 'b')))),)))
check('not x.a and not y.b and not z.c', Suite((Call('return', Call('and',
    Call('not', Call('.', Name('x'), 'a')), Call('and', Call('not', Call(
    '.', Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check('not x.a and not y.b and not z.c', Suite((Call('return', Call('and',
    Call('not', Call('.', Name('x'), 'a')), Call('and', Call('not', Call(
    '.', Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check('not x.a and not y.b and not z.c', Suite((Call('return', Call('and',
    Call('not', Call('.', Name('x'), 'a')), Call('and', Call('not', Call(
    '.', Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check('not x.a or not y.b', Suite((Call('return', Call('or', Call('not',
    Call('.', Name('x'), 'a')), Call('not', Call('.', Name('y'), 'b')))),)))
check('not x.a or not y.b or not z.c', Suite((Call('return', Call('or',
    Call('not', Call('.', Name('x'), 'a')), Call('or', Call('not', Call('.',
    Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check('not x.a or not y.b or not z.c', Suite((Call('return', Call('or',
    Call('not', Call('.', Name('x'), 'a')), Call('or', Call('not', Call('.',
    Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check('not x.a or not y.b or not z.c', Suite((Call('return', Call('or',
    Call('not', Call('.', Name('x'), 'a')), Call('or', Call('not', Call('.',
    Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check('(not x.a or not y.b, None) and not z.c', Suite((Call('return', Call(
    'and', Call('tuple', Call('or', Call('not', Call('.', Name('x'), 'a')),
    Call('not', Call('.', Name('y'), 'b'))), Const(None)), Call('not', Call
    ('.', Name('z'), 'c')))),)))
check('not x.a and (not y.b or not z.c, None)', Suite((Call('return', Call(
    'and', Call('not', Call('.', Name('x'), 'a')), Call('tuple', Call('or',
    Call('not', Call('.', Name('y'), 'b')), Call('not', Call('.', Name('z'),
    'c'))), Const(None)))),)))
check('False', Suite((Call('return', Const(False)),)))
check('True', Suite((Call('return', Const(True)),)))
check('not x', Suite((Call('return', Call('not', Name('x'))),)))
check('not x and not y', Suite((Call('return', Call('and', Call('not', Name
    ('x')), Call('not', Name('y')))),)))
check('not x and not y and not z', Suite((Call('return', Call('and', Call(
    'not', Name('x')), Call('and', Call('not', Name('y')), Call('not', Name
    ('z'))))),)))
check('not x and not y and not z', Suite((Call('return', Call('and', Call(
    'not', Name('x')), Call('and', Call('not', Name('y')), Call('not', Name
    ('z'))))),)))
check('not x and not y and not z', Suite((Call('return', Call('and', Call(
    'not', Name('x')), Call('and', Call('not', Name('y')), Call('not', Name
    ('z'))))),)))
check('not x or not y', Suite((Call('return', Call('or', Call('not', Name(
    'x')), Call('not', Name('y')))),)))
check('not x or not y or not z', Suite((Call('return', Call('or', Call(
    'not', Name('x')), Call('or', Call('not', Name('y')), Call('not', Name(
    'z'))))),)))
check('not x or not y or not z', Suite((Call('return', Call('or', Call(
    'not', Name('x')), Call('or', Call('not', Name('y')), Call('not', Name(
    'z'))))),)))
check('not x or not y or not z', Suite((Call('return', Call('or', Call(
    'not', Name('x')), Call('or', Call('not', Name('y')), Call('not', Name(
    'z'))))),)))
check('(not x or not y, None) and not z', Suite((Call('return', Call('and',
    Call('tuple', Call('or', Call('not', Name('x')), Call('not', Name('y'))
    ), Const(None)), Call('not', Name('z')))),)))
check('not x and (not y or not z, None)', Suite((Call('return', Call('and',
    Call('not', Name('x')), Call('tuple', Call('or', Call('not', Name('y')),
    Call('not', Name('z'))), Const(None)))),)))
check('not x(1, None)', Suite((Call('return', Call('not', Call(Name('x'),
    Const(1), Const(None)))),)))
check('not x(1, None) and not y(2, None)', Suite((Call('return', Call('and',
    Call('not', Call(Name('x'), Const(1), Const(None))), Call('not', Call(
    Name('y'), Const(2), Const(None))))),)))
check('not x(1, None) and not y(2, None) and not z(3, None)', Suite((Call(
    'return', Call('and', Call('not', Call(Name('x'), Const(1), Const(None)
    )), Call('and', Call('not', Call(Name('y'), Const(2), Const(None))),
    Call('not', Call(Name('z'), Const(3), Const(None)))))),)))
check('not x(1, None) and not y(2, None) and not z(3, None)', Suite((Call(
    'return', Call('and', Call('not', Call(Name('x'), Const(1), Const(None)
    )), Call('and', Call('not', Call(Name('y'), Const(2), Const(None))),
    Call('not', Call(Name('z'), Const(3), Const(None)))))),)))
check('not x(1, None) and not y(2, None) and not z(3, None)', Suite((Call(
    'return', Call('and', Call('not', Call(Name('x'), Const(1), Const(None)
    )), Call('and', Call('not', Call(Name('y'), Const(2), Const(None))),
    Call('not', Call(Name('z'), Const(3), Const(None)))))),)))
check('not x(1, None) or not y(2, None)', Suite((Call('return', Call('or',
    Call('not', Call(Name('x'), Const(1), Const(None))), Call('not', Call(
    Name('y'), Const(2), Const(None))))),)))
check('not x(1, None) or not y(2, None) or not z(3, None)', Suite((Call(
    'return', Call('or', Call('not', Call(Name('x'), Const(1), Const(None))
    ), Call('or', Call('not', Call(Name('y'), Const(2), Const(None))), Call
    ('not', Call(Name('z'), Const(3), Const(None)))))),)))
check('not x(1, None) or not y(2, None) or not z(3, None)', Suite((Call(
    'return', Call('or', Call('not', Call(Name('x'), Const(1), Const(None))
    ), Call('or', Call('not', Call(Name('y'), Const(2), Const(None))), Call
    ('not', Call(Name('z'), Const(3), Const(None)))))),)))
check('not x(1, None) or not y(2, None) or not z(3, None)', Suite((Call(
    'return', Call('or', Call('not', Call(Name('x'), Const(1), Const(None))
    ), Call('or', Call('not', Call(Name('y'), Const(2), Const(None))), Call
    ('not', Call(Name('z'), Const(3), Const(None)))))),)))
check('(not x(1, None) or not y(2, None), None) and not z(3, None)', Suite(
    (Call('return', Call('and', Call('tuple', Call('or', Call('not', Call(
    Name('x'), Const(1), Const(None))), Call('not', Call(Name('y'), Const(2
    ), Const(None)))), Const(None)), Call('not', Call(Name('z'), Const(3),
    Const(None))))),)))
check('not x(1, None) and (not y(2, None) or not z(3, None), None)', Suite(
    (Call('return', Call('and', Call('not', Call(Name('x'), Const(1), Const
    (None))), Call('tuple', Call('or', Call('not', Call(Name('y'), Const(2),
    Const(None))), Call('not', Call(Name('z'), Const(3), Const(None)))),
    Const(None)))),)))
check('not x.a', Suite((Call('return', Call('not', Call('.', Name('x'), 'a'
    ))),)))
check('not x.a and not y.b', Suite((Call('return', Call('and', Call('not',
    Call('.', Name('x'), 'a')), Call('not', Call('.', Name('y'), 'b')))),)))
check('not x.a and not y.b and not z.c', Suite((Call('return', Call('and',
    Call('not', Call('.', Name('x'), 'a')), Call('and', Call('not', Call(
    '.', Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check('not x.a and not y.b and not z.c', Suite((Call('return', Call('and',
    Call('not', Call('.', Name('x'), 'a')), Call('and', Call('not', Call(
    '.', Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check('not x.a and not y.b and not z.c', Suite((Call('return', Call('and',
    Call('not', Call('.', Name('x'), 'a')), Call('and', Call('not', Call(
    '.', Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check('not x.a or not y.b', Suite((Call('return', Call('or', Call('not',
    Call('.', Name('x'), 'a')), Call('not', Call('.', Name('y'), 'b')))),)))
check('not x.a or not y.b or not z.c', Suite((Call('return', Call('or',
    Call('not', Call('.', Name('x'), 'a')), Call('or', Call('not', Call('.',
    Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check('not x.a or not y.b or not z.c', Suite((Call('return', Call('or',
    Call('not', Call('.', Name('x'), 'a')), Call('or', Call('not', Call('.',
    Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check('not x.a or not y.b or not z.c', Suite((Call('return', Call('or',
    Call('not', Call('.', Name('x'), 'a')), Call('or', Call('not', Call('.',
    Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check('(not x.a or not y.b, None) and not z.c', Suite((Call('return', Call(
    'and', Call('tuple', Call('or', Call('not', Call('.', Name('x'), 'a')),
    Call('not', Call('.', Name('y'), 'b'))), Const(None)), Call('not', Call
    ('.', Name('z'), 'c')))),)))
check('not x.a and (not y.b or not z.c, None)', Suite((Call('return', Call(
    'and', Call('not', Call('.', Name('x'), 'a')), Call('tuple', Call('or',
    Call('not', Call('.', Name('y'), 'b')), Call('not', Call('.', Name('z'),
    'c'))), Const(None)))),)))
check('x != y', Suite((Call('return', Call('!=', Name('x'), Name('y'))),)))
check('x == y', Suite((Call('return', Call('==', Name('x'), Name('y'))),)))
check('x <= y', Suite((Call('return', Call('<=', Name('x'), Name('y'))),)))
check('x > y', Suite((Call('return', Call('>', Name('x'), Name('y'))),)))
check('x >= y', Suite((Call('return', Call('>=', Name('x'), Name('y'))),)))
check('x < y', Suite((Call('return', Call('<', Name('x'), Name('y'))),)))
check('x not in y', Suite((Call('return', Call('not-in', Name('x'), Name(
    'y'))),)))
check('x in y', Suite((Call('return', Call('in', Name('x'), Name('y'))),)))
check('x == y and y == z', Suite((Call('return', Call('and', Call('==',
    Name('x'), Name('y')), Call('==', Name('y'), Name('z')))),)))
check('x == y and y == z', Suite((Call('return', Call('and', Call('==',
    Name('x'), Name('y')), Call('==', Name('y'), Name('z')))),)))
check('x == y or y == z', Suite((Call('return', Call('or', Call('==', Name(
    'x'), Name('y')), Call('==', Name('y'), Name('z')))),)))
check('x != y or y != z', Suite((Call('return', Call('or', Call('!=', Name(
    'x'), Name('y')), Call('!=', Name('y'), Name('z')))),)))
check('x != y or y != z', Suite((Call('return', Call('or', Call('!=', Name(
    'x'), Name('y')), Call('!=', Name('y'), Name('z')))),)))
check('x != y or y == z', Suite((Call('return', Call('or', Call('!=', Name(
    'x'), Name('y')), Call('==', Name('y'), Name('z')))),)))
check('a and b and c and d and e', Suite((Call('return', Call('and', Name(
    'a'), Call('and', Name('b'), Call('and', Name('c'), Call('and', Name(
    'd'), Name('e')))))),)))
check('a and b and c and d and e', Suite((Call('return', Call('and', Name(
    'a'), Call('and', Name('b'), Call('and', Name('c'), Call('and', Name(
    'd'), Name('e')))))),)))
check('def g(x): return 3.14', Suite((Assign((Name('g'),), Def(('x',), (),
    Suite((Call('return', Const(3.14)),)))), Call('return', Const(None)))))
check("""def g(x):
    return 3.14""", Suite((Assign((Name('g'),), Def(('x'
    ,), (), Suite((Call('return', Const(3.14)),)))), Call('return', Const(
    None)))))
check('def g(x, y): return x**2', Suite((Assign((Name('g'),), Def(('x', 'y'
    ), (), Suite((Call('return', Call('**', Name('x'), Const(2))),)))),
    Call('return', Const(None)))))
check("""def g(x, y):
    return x**2""", Suite((Assign((Name('g'),), Def((
    'x', 'y'), (), Suite((Call('return', Call('**', Name('x'), Const(2))),)
    ))), Call('return', Const(None)))))
check('lambda: 3.14', Suite((Call('return', Def((), (), Suite((Call(
    'return', Const(3.14)),)))),)))
check('lambda x: x**2', Suite((Call('return', Def(('x',), (), Suite((Call(
    'return', Call('**', Name('x'), Const(2))),)))),)))
check('(lambda x: x**2, None)', Suite((Call('return', Call('tuple', Def((
    'x',), (), Suite((Call('return', Call('**', Name('x'), Const(2))),))),
    Const(None))),)))
check('1 if x == 0 else 2', Suite((Call('if', Call('==', Name('x'), Const(0
    )), Suite((Call('return', Const(1)),)), Suite((Call('return', Const(2))
    ,))),)))
check('y = (1 if x == 0 else 2, None)', Suite((Assign((Name('y'),), Call(
    'tuple', Call('?', Call('==', Name('x'), Const(0)), Const(1), Const(2)),
    Const(None))), Call('return', Const(None)))))
check('1 if x == 0 else None', Suite((Call('if', Call('==', Name('x'),
    Const(0)), Suite((Call('return', Const(1)),)), Suite((Call('return',
    Const(None)),))),)))
check('(1 if x == 0 else 2, None)', Suite((Call('return', Call('tuple',
    Call('?', Call('==', Name('x'), Const(0)), Const(1), Const(2)), Const(
    None))),)))
check('(1 if x == 0 else None, None)', Suite((Call('return', Call('tuple',
    Call('?', Call('==', Name('x'), Const(0)), Const(1), Const(None)),
    Const(None))),)))
check("""if x == 0:
    return 1""", Suite((Call('if', Call('==', Name('x'),
    Const(0)), Suite((Call('return', Const(1)),)), Suite((Call('return',
    Const(None)),))),)))
check("""if x == 0:
    y = 1
    return 1""", Suite((Call('if', Call('==',
    Name('x'), Const(0)), Suite((Assign((Name('y'),), Const(1)), Call(
    'return', Const(1)))), Suite((Call('return', Const(None)),))),)))
check("""if x == 0:
    return 1
else:
    return 2""", Suite((Call('if',
    Call('==', Name('x'), Const(0)), Suite((Call('return', Const(1)),)),
    Suite((Call('return', Const(2)),))),)))
check("""if x == 0:
    y = 1
    return 1
else:
    y = 2
    return 2""",
    Suite((Call('if', Call('==', Name('x'), Const(0)), Suite((Assign((Name(
    'y'),), Const(1)), Call('return', Const(1)))), Suite((Assign((Name('y')
    ,), Const(2)), Call('return', Const(2))))),)))
check(
    """if x == 0:
    return 1
elif x == 1:
    return 2
else:
    return 3""",
    Suite((Call('if', Call('==', Name('x'), Const(0)), Suite((Call('return',
    Const(1)),)), Suite((Call('if', Call('==', Name('x'), Const(1)), Suite(
    (Call('return', Const(2)),)), Suite((Call('return', Const(3)),))),))),)))
check(
    """if x == 0:
    y = 1
    return 1
elif x == 1:
    y = 2
    return 2
else:
    y = 3
    return 3"""
    , Suite((Call('if', Call('==', Name('x'), Const(0)), Suite((Assign((
    Name('y'),), Const(1)), Call('return', Const(1)))), Suite((Call('if',
    Call('==', Name('x'), Const(1)), Suite((Assign((Name('y'),), Const(2)),
    Call('return', Const(2)))), Suite((Assign((Name('y'),), Const(3)), Call
    ('return', Const(3))))),))),)))
check("""if x == 0:
    y = 1""", Suite((Call('if', Call('==', Name('x'),
    Const(0)), Suite((Assign((Name('y'),), Const(1)),))), Call('return',
    Const(None)))))
check("""if x == 0:
    y = 1
    z = 1""", Suite((Call('if', Call('==',
    Name('x'), Const(0)), Suite((Assign((Name('y'),), Const(1)), Assign((
    Name('z'),), Const(1))))), Call('return', Const(None)))))
check("""if x == 0:
    y = 1
else:
    y = 2""", Suite((Call('if', Call(
    '==', Name('x'), Const(0)), Suite((Assign((Name('y'),), Const(1)),)),
    Suite((Assign((Name('y'),), Const(2)),))), Call('return', Const(None)))))
check("""if x == 0:
    y = 1
    z = 1
else:
    y = 2
    z = 2""", Suite
    ((Call('if', Call('==', Name('x'), Const(0)), Suite((Assign((Name('y'),
    ), Const(1)), Assign((Name('z'),), Const(1)))), Suite((Assign((Name('y'
    ),), Const(2)), Assign((Name('z'),), Const(2))))), Call('return', Const
    (None)))))
check('[]', Suite((Call('return', Call('list')),)))
check('[1]', Suite((Call('return', Call('list', Const(1))),)))
check('[1, 2]', Suite((Call('return', Call('list', Const(1), Const(2))),)))
check('[one]', Suite((Call('return', Call('list', Name('one'))),)))
check('[one, two]', Suite((Call('return', Call('list', Name('one'), Name(
    'two'))),)))
check("['one']", Suite((Call('return', Call('list', Const('one'))),)))
check("['one', 'two']", Suite((Call('return', Call('list', Const('one'),
    Const('two'))),)))
check('set([])', Suite((Call('return', Call(Name('set'), Call('list'))),)))
check('set([1])', Suite((Call('return', Call(Name('set'), Call('list',
    Const(1)))),)))
check('set([1, 2])', Suite((Call('return', Call(Name('set'), Call('list',
    Const(1), Const(2)))),)))
check('set([one])', Suite((Call('return', Call(Name('set'), Call('list',
    Name('one')))),)))
check('set([one, two])', Suite((Call('return', Call(Name('set'), Call(
    'list', Name('one'), Name('two')))),)))
check("set(['one'])", Suite((Call('return', Call(Name('set'), Call('list',
    Const('one')))),)))
check("set(['one', 'two'])", Suite((Call('return', Call(Name('set'), Call(
    'list', Const('one'), Const('two')))),)))
check('{}', Suite((Call('return', Call('dict')),)))
check('{1}', Suite((Call('return', Call('set', Const(1))),)))
check('{1, 2}', Suite((Call('return', Call('set', Const(1), Const(2))),)))
check('{one}', Suite((Call('return', Call('set', Name('one'))),)))
check('{one, two}', Suite((Call('return', Call('set', Name('one'), Name(
    'two'))),)))
check("{'one'}", Suite((Call('return', Call('set', Const('one'))),)))
check("{'one', 'two'}", Suite((Call('return', Call('set', Const('one'),
    Const('two'))),)))
check("{'x': 1}", Suite((Call('return', Call('dict', Const('x'), Const(1))),)))
check("{'x': 1, 'y': 2}", Suite((Call('return', Call('dict', Const('x'),
    Const(1), Const('y'), Const(2))),)))
check("{'x': 1, 'y': 2, 'z': 3}", Suite((Call('return', Call('dict', Const(
    'x'), Const(1), Const('y'), Const(2), Const('z'), Const(3))),)))
check("{'x': one}", Suite((Call('return', Call('dict', Const('x'), Name(
    'one'))),)))
check("{'x': one, 'y': two}", Suite((Call('return', Call('dict', Const('x'),
    Name('one'), Const('y'), Name('two'))),)))
check("{'x': one, 'y': two, 'z': three}", Suite((Call('return', Call('dict',
    Const('x'), Name('one'), Const('y'), Name('two'), Const('z'), Name(
    'three'))),)))
check('{1: 1}', Suite((Call('return', Call('dict', Const(1), Const(1))),)))
check('{1: 1, 2: 2}', Suite((Call('return', Call('dict', Const(1), Const(1),
    Const(2), Const(2))),)))
check('{1: 1, 2: 2, 3: 3}', Suite((Call('return', Call('dict', Const(1),
    Const(1), Const(2), Const(2), Const(3), Const(3))),)))
check('{1: one}', Suite((Call('return', Call('dict', Const(1), Name('one'))),))
    )
check('{1: one, 2: two}', Suite((Call('return', Call('dict', Const(1), Name
    ('one'), Const(2), Name('two'))),)))
check('{1: one, 2: two, 3: three}', Suite((Call('return', Call('dict',
    Const(1), Name('one'), Const(2), Name('two'), Const(3), Name('three'))),)))
check('{one: 1}', Suite((Call('return', Call('dict', Name('one'), Const(1))),))
    )
check('{one: 1, two: 2}', Suite((Call('return', Call('dict', Name('one'),
    Const(1), Name('two'), Const(2))),)))
check('{one: 1, two: 2, three: 3}', Suite((Call('return', Call('dict', Name
    ('one'), Const(1), Name('two'), Const(2), Name('three'), Const(3))),)))
check('{one: one}', Suite((Call('return', Call('dict', Name('one'), Name(
    'one'))),)))
check('{one: one, two: two}', Suite((Call('return', Call('dict', Name('one'
    ), Name('one'), Name('two'), Name('two'))),)))
check('{one: one, two: two, three: three}', Suite((Call('return', Call(
    'dict', Name('one'), Name('one'), Name('two'), Name('two'), Name(
    'three'), Name('three'))),)))
check('[x**2 for x in something]', Suite((Call('return', Call(Call('.',
    Name('something'), 'map'), Def(('x',), (), Suite((Call('return', Call(
    '**', Name('x'), Const(2))),))))),)))
check('[x**2 for x in something if x > 0]', Suite((Call('return', Call(Call
    ('.', Call(Call('.', Name('something'), 'filter'), Def(('x',), (),
    Suite((Call('return', Call('>', Name('x'), Const(0))),)))), 'map'), Def
    (('x',), (), Suite((Call('return', Call('**', Name('x'), Const(2))),)))
    )),)))
check('[y**2 for x in something for y in x]', Suite((Call('return', Call(
    Call('.', Name('something'), 'map'), Def(('x',), (), Suite((Call(
    'return', Call(Call('.', Name('x'), 'map'), Def(('y',), (), Suite((Call
    ('return', Call('**', Name('y'), Const(2))),))))),))))),)))
check('[y**2 for x in something for y in x if x > 0]', Suite((Call('return',
    Call(Call('.', Name('something'), 'map'), Def(('x',), (), Suite((Call(
    'return', Call(Call('.', Call(Call('.', Name('x'), 'filter'), Def(('y',
    ), (), Suite((Call('return', Call('>', Name('x'), Const(0))),)))),
    'map'), Def(('y',), (), Suite((Call('return', Call('**', Name('y'),
    Const(2))),))))),))))),)))
check('[y**2 for x in something for y in x if y > 0]', Suite((Call('return',
    Call(Call('.', Name('something'), 'map'), Def(('x',), (), Suite((Call(
    'return', Call(Call('.', Call(Call('.', Name('x'), 'filter'), Def(('y',
    ), (), Suite((Call('return', Call('>', Name('y'), Const(0))),)))),
    'map'), Def(('y',), (), Suite((Call('return', Call('**', Name('y'),
    Const(2))),))))),))))),)))
check('[y**2 for x in something if x for y in x if x > 0]', Suite((Call(
    'return', Call(Call('.', Call(Call('.', Name('something'), 'filter'),
    Def(('x',), (), Suite((Call('return', Name('x')),)))), 'map'), Def(('x'
    ,), (), Suite((Call('return', Call(Call('.', Call(Call('.', Name('x'),
    'filter'), Def(('y',), (), Suite((Call('return', Call('>', Name('x'),
    Const(0))),)))), 'map'), Def(('y',), (), Suite((Call('return', Call(
    '**', Name('y'), Const(2))),))))),))))),)))
check('f([x**2 for x in something], None)', Suite((Call('return', Call(Name
    ('f'), Call(Call('.', Name('something'), 'map'), Def(('x',), (), Suite(
    (Call('return', Call('**', Name('x'), Const(2))),)))), Const(None))),)))
check('f([x**2 for x in something if x > 0], None)', Suite((Call('return',
    Call(Name('f'), Call(Call('.', Call(Call('.', Name('something'),
    'filter'), Def(('x',), (), Suite((Call('return', Call('>', Name('x'),
    Const(0))),)))), 'map'), Def(('x',), (), Suite((Call('return', Call(
    '**', Name('x'), Const(2))),)))), Const(None))),)))
check('f([y**2 for x in something for y in x], None)', Suite((Call('return',
    Call(Name('f'), Call(Call('.', Name('something'), 'map'), Def(('x',), (
    ), Suite((Call('return', Call(Call('.', Name('x'), 'map'), Def(('y',),
    (), Suite((Call('return', Call('**', Name('y'), Const(2))),))))),)))),
    Const(None))),)))
check('f([y**2 for x in something for y in x if x > 0], None)', Suite((Call
    ('return', Call(Name('f'), Call(Call('.', Name('something'), 'map'),
    Def(('x',), (), Suite((Call('return', Call(Call('.', Call(Call('.',
    Name('x'), 'filter'), Def(('y',), (), Suite((Call('return', Call('>',
    Name('x'), Const(0))),)))), 'map'), Def(('y',), (), Suite((Call(
    'return', Call('**', Name('y'), Const(2))),))))),)))), Const(None))),)))
check('f([y**2 for x in something for y in x if y > 0], None)', Suite((Call
    ('return', Call(Name('f'), Call(Call('.', Name('something'), 'map'),
    Def(('x',), (), Suite((Call('return', Call(Call('.', Call(Call('.',
    Name('x'), 'filter'), Def(('y',), (), Suite((Call('return', Call('>',
    Name('y'), Const(0))),)))), 'map'), Def(('y',), (), Suite((Call(
    'return', Call('**', Name('y'), Const(2))),))))),)))), Const(None))),)))
check('f([y**2 for x in something if x for y in x if x > 0], None)', Suite(
    (Call('return', Call(Name('f'), Call(Call('.', Call(Call('.', Name(
    'something'), 'filter'), Def(('x',), (), Suite((Call('return', Name('x'
    )),)))), 'map'), Def(('x',), (), Suite((Call('return', Call(Call('.',
    Call(Call('.', Name('x'), 'filter'), Def(('y',), (), Suite((Call(
    'return', Call('>', Name('x'), Const(0))),)))), 'map'), Def(('y',), (),
    Suite((Call('return', Call('**', Name('y'), Const(2))),))))),)))),
    Const(None))),)))
check('f((x**2 for x in something), None)', Suite((Call('return', Call(Name
    ('f'), Call(Call('.', Name('something'), 'map'), Def(('x',), (), Suite(
    (Call('return', Call('**', Name('x'), Const(2))),)))), Const(None))),)))
check('f((x**2 for x in something if x > 0), None)', Suite((Call('return',
    Call(Name('f'), Call(Call('.', Call(Call('.', Name('something'),
    'filter'), Def(('x',), (), Suite((Call('return', Call('>', Name('x'),
    Const(0))),)))), 'map'), Def(('x',), (), Suite((Call('return', Call(
    '**', Name('x'), Const(2))),)))), Const(None))),)))
check('f((y**2 for x in something for y in x), None)', Suite((Call('return',
    Call(Name('f'), Call(Call('.', Name('something'), 'map'), Def(('x',), (
    ), Suite((Call('return', Call(Call('.', Name('x'), 'map'), Def(('y',),
    (), Suite((Call('return', Call('**', Name('y'), Const(2))),))))),)))),
    Const(None))),)))
check('f((y**2 for x in something for y in x if x > 0), None)', Suite((Call
    ('return', Call(Name('f'), Call(Call('.', Name('something'), 'map'),
    Def(('x',), (), Suite((Call('return', Call(Call('.', Call(Call('.',
    Name('x'), 'filter'), Def(('y',), (), Suite((Call('return', Call('>',
    Name('x'), Const(0))),)))), 'map'), Def(('y',), (), Suite((Call(
    'return', Call('**', Name('y'), Const(2))),))))),)))), Const(None))),)))
check('f((y**2 for x in something for y in x if y > 0), None)', Suite((Call
    ('return', Call(Name('f'), Call(Call('.', Name('something'), 'map'),
    Def(('x',), (), Suite((Call('return', Call(Call('.', Call(Call('.',
    Name('x'), 'filter'), Def(('y',), (), Suite((Call('return', Call('>',
    Name('y'), Const(0))),)))), 'map'), Def(('y',), (), Suite((Call(
    'return', Call('**', Name('y'), Const(2))),))))),)))), Const(None))),)))
check('f((y**2 for x in something if x for y in x if x > 0), None)', Suite(
    (Call('return', Call(Name('f'), Call(Call('.', Call(Call('.', Name(
    'something'), 'filter'), Def(('x',), (), Suite((Call('return', Name('x'
    )),)))), 'map'), Def(('x',), (), Suite((Call('return', Call(Call('.',
    Call(Call('.', Name('x'), 'filter'), Def(('y',), (), Suite((Call(
    'return', Call('>', Name('x'), Const(0))),)))), 'map'), Def(('y',), (),
    Suite((Call('return', Call('**', Name('y'), Const(2))),))))),)))),
    Const(None))),)))
check('f(one=1)', Suite((Call('return', CallKeyword(Name('f'), (), (('one',
    Const(1)),))),)))
check('f(one=1, two=2)', Suite((Call('return', CallKeyword(Name('f'), (), (
    ('one', Const(1)), ('two', Const(2))))),)))
check('f(x, one=1)', Suite((Call('return', CallKeyword(Name('f'), (Name('x'
    ),), (('one', Const(1)),))),)))
check('f(x, one=1, two=2)', Suite((Call('return', CallKeyword(Name('f'), (
    Name('x'),), (('one', Const(1)), ('two', Const(2))))),)))
check('x[..., :]', Suite((Call('return', Call('[.]', Name('x'), Const(
    Ellipsis), Call('slice', Const(None), Const(None), Const(None)))),)))
check('x = y = 1', Suite((Assign((Name('x'), Name('y')), Const(1)), Call(
    'return', Const(None)))))
check('x = y = z = 1', Suite((Assign((Name('x'), Name('y'), Name('z')),
    Const(1)), Call('return', Const(None)))))
check('x, y = 1', Suite((Assign((Unpack((Name('x'), Name('y'))),), Const(1)
    ), Call('return', Const(None)))))
check('x, y = z = 1', Suite((Assign((Unpack((Name('x'), Name('y'))), Name(
    'z')), Const(1)), Call('return', Const(None)))))
check('x = y, z = 1', Suite((Assign((Name('x'), Unpack((Name('y'), Name('z'
    )))), Const(1)), Call('return', Const(None)))))
check('x.a = y = 1', Suite((Assign((Call('.', Name('x'), 'a'), Name('y')),
    Const(1)), Call('return', Const(None)))))
check('x.a = y = z = 1', Suite((Assign((Call('.', Name('x'), 'a'), Name('y'
    ), Name('z')), Const(1)), Call('return', Const(None)))))
check('x.a, y = 1', Suite((Assign((Unpack((Call('.', Name('x'), 'a'), Name(
    'y'))),), Const(1)), Call('return', Const(None)))))
check('x.a, y = z = 1', Suite((Assign((Unpack((Call('.', Name('x'), 'a'),
    Name('y'))), Name('z')), Const(1)), Call('return', Const(None)))))
check('x.a = y, z = 1', Suite((Assign((Call('.', Name('x'), 'a'), Unpack((
    Name('y'), Name('z')))), Const(1)), Call('return', Const(None)))))
check('x = y.a = 1', Suite((Assign((Name('x'), Call('.', Name('y'), 'a')),
    Const(1)), Call('return', Const(None)))))
check('x = y.a = z = 1', Suite((Assign((Name('x'), Call('.', Name('y'), 'a'
    ), Name('z')), Const(1)), Call('return', Const(None)))))
check('x, y.a = 1', Suite((Assign((Unpack((Name('x'), Call('.', Name('y'),
    'a'))),), Const(1)), Call('return', Const(None)))))
check('x, y.a = z = 1', Suite((Assign((Unpack((Name('x'), Call('.', Name(
    'y'), 'a'))), Name('z')), Const(1)), Call('return', Const(None)))))
check('x = y.a, z = 1', Suite((Assign((Name('x'), Unpack((Call('.', Name(
    'y'), 'a'), Name('z')))), Const(1)), Call('return', Const(None)))))
check('x = y = z.a = 1', Suite((Assign((Name('x'), Name('y'), Call('.',
    Name('z'), 'a')), Const(1)), Call('return', Const(None)))))
check('x, y = z.a = 1', Suite((Assign((Unpack((Name('x'), Name('y'))), Call
    ('.', Name('z'), 'a')), Const(1)), Call('return', Const(None)))))
check('x = y, z.a = 1', Suite((Assign((Name('x'), Unpack((Name('y'), Call(
    '.', Name('z'), 'a')))), Const(1)), Call('return', Const(None)))))
check('x[0] = y = 1', Suite((Assign((Call('[.]', Name('x'), Const(0)), Name
    ('y')), Const(1)), Call('return', Const(None)))))
check('x[0] = y = z = 1', Suite((Assign((Call('[.]', Name('x'), Const(0)),
    Name('y'), Name('z')), Const(1)), Call('return', Const(None)))))
check('x[0], y = 1', Suite((Assign((Unpack((Call('[.]', Name('x'), Const(0)
    ), Name('y'))),), Const(1)), Call('return', Const(None)))))
check('x[0], y = z = 1', Suite((Assign((Unpack((Call('[.]', Name('x'),
    Const(0)), Name('y'))), Name('z')), Const(1)), Call('return', Const(
    None)))))
check('x[0] = y, z = 1', Suite((Assign((Call('[.]', Name('x'), Const(0)),
    Unpack((Name('y'), Name('z')))), Const(1)), Call('return', Const(None)))))
check('x = y[0] = 1', Suite((Assign((Name('x'), Call('[.]', Name('y'),
    Const(0))), Const(1)), Call('return', Const(None)))))
check('x = y[0] = z = 1', Suite((Assign((Name('x'), Call('[.]', Name('y'),
    Const(0)), Name('z')), Const(1)), Call('return', Const(None)))))
check('x, y[0] = 1', Suite((Assign((Unpack((Name('x'), Call('[.]', Name('y'
    ), Const(0)))),), Const(1)), Call('return', Const(None)))))
check('x, y[0] = z = 1', Suite((Assign((Unpack((Name('x'), Call('[.]', Name
    ('y'), Const(0)))), Name('z')), Const(1)), Call('return', Const(None)))))
check('x = y[0], z = 1', Suite((Assign((Name('x'), Unpack((Call('[.]', Name
    ('y'), Const(0)), Name('z')))), Const(1)), Call('return', Const(None)))))
check('x = y = z[0] = 1', Suite((Assign((Name('x'), Name('y'), Call('[.]',
    Name('z'), Const(0))), Const(1)), Call('return', Const(None)))))
check('x, y = z[0] = 1', Suite((Assign((Unpack((Name('x'), Name('y'))),
    Call('[.]', Name('z'), Const(0))), Const(1)), Call('return', Const(None))))
    )
check('x = y, z[0] = 1', Suite((Assign((Name('x'), Unpack((Name('y'), Call(
    '[.]', Name('z'), Const(0))))), Const(1)), Call('return', Const(None)))))
check('x[:, ...] = y = 1', Suite((Assign((Call('[.]', Name('x'), Call(
    'slice', Const(None), Const(None), Const(None)), Const(Ellipsis)), Name
    ('y')), Const(1)), Call('return', Const(None)))))
check('x[:, ...] = y = z = 1', Suite((Assign((Call('[.]', Name('x'), Call(
    'slice', Const(None), Const(None), Const(None)), Const(Ellipsis)), Name
    ('y'), Name('z')), Const(1)), Call('return', Const(None)))))
check('x[:, ...], y = 1', Suite((Assign((Unpack((Call('[.]', Name('x'),
    Call('slice', Const(None), Const(None), Const(None)), Const(Ellipsis)),
    Name('y'))),), Const(1)), Call('return', Const(None)))))
check('x[:, ...], y = z = 1', Suite((Assign((Unpack((Call('[.]', Name('x'),
    Call('slice', Const(None), Const(None), Const(None)), Const(Ellipsis)),
    Name('y'))), Name('z')), Const(1)), Call('return', Const(None)))))
check('x[:, ...] = y, z = 1', Suite((Assign((Call('[.]', Name('x'), Call(
    'slice', Const(None), Const(None), Const(None)), Const(Ellipsis)),
    Unpack((Name('y'), Name('z')))), Const(1)), Call('return', Const(None)))))
check('x = y[:, ...] = 1', Suite((Assign((Name('x'), Call('[.]', Name('y'),
    Call('slice', Const(None), Const(None), Const(None)), Const(Ellipsis))),
    Const(1)), Call('return', Const(None)))))
check('x = y[:, ...] = z = 1', Suite((Assign((Name('x'), Call('[.]', Name(
    'y'), Call('slice', Const(None), Const(None), Const(None)), Const(
    Ellipsis)), Name('z')), Const(1)), Call('return', Const(None)))))
check('x, y[:, ...] = 1', Suite((Assign((Unpack((Name('x'), Call('[.]',
    Name('y'), Call('slice', Const(None), Const(None), Const(None)), Const(
    Ellipsis)))),), Const(1)), Call('return', Const(None)))))
check('x, y[:, ...] = z = 1', Suite((Assign((Unpack((Name('x'), Call('[.]',
    Name('y'), Call('slice', Const(None), Const(None), Const(None)), Const(
    Ellipsis)))), Name('z')), Const(1)), Call('return', Const(None)))))
check('x = y[:, ...], z = 1', Suite((Assign((Name('x'), Unpack((Call('[.]',
    Name('y'), Call('slice', Const(None), Const(None), Const(None)), Const(
    Ellipsis)), Name('z')))), Const(1)), Call('return', Const(None)))))
check('x = y = z[:, ...] = 1', Suite((Assign((Name('x'), Name('y'), Call(
    '[.]', Name('z'), Call('slice', Const(None), Const(None), Const(None)),
    Const(Ellipsis))), Const(1)), Call('return', Const(None)))))
check('x, y = z[:, ...] = 1', Suite((Assign((Unpack((Name('x'), Name('y'))),
    Call('[.]', Name('z'), Call('slice', Const(None), Const(None), Const(
    None)), Const(Ellipsis))), Const(1)), Call('return', Const(None)))))
check('x = y, z[:, ...] = 1', Suite((Assign((Name('x'), Unpack((Name('y'),
    Call('[.]', Name('z'), Call('slice', Const(None), Const(None), Const(
    None)), Const(Ellipsis))))), Const(1)), Call('return', Const(None)))))

import rejig.pybytecode
from rejig.syntaxtree import *

def check(what_is, what_should_be):
    global failed, total
    env = {}
    if "\n" in what_is or " = " in what_is or "def " in what_is or "print(" in what_is:
        exec("def f():\n    " + "\n    ".join(what_is.split("\n")), env)
    else:
        exec("def f():\n    return " + what_is, env)
    ast = rejig.pybytecode.ast(env["f"])
    print(str(ast))
    assert ast == what_should_be, "\nshould be: " + repr(what_should_be) + "\nyet it is: " + repr(ast)

check('"hello"', Suite((Call('return', Const('hello')),)))
check('''.3''', Suite((Call('return', Const(.3)),)))
check('''-3''', Suite((Call('return', Const(-3)),)))
check('''--3''', Suite((Call('return', Const(--3)),)))
check('''+3''', Suite((Call('return', Const(+3)),)))
check('''++3''', Suite((Call('return', Const(++3)),)))
check('''+-3''', Suite((Call('return', Const(+-3)),)))
check('''3e1''', Suite((Call('return', Const(3e1)),)))
check('''-3e1''', Suite((Call('return', Const(-3e1)),)))
check('''+3e1''', Suite((Call('return', Const(+3e1)),)))
check('0x123', Suite((Call('return', Const(0x123)),)))
check('0o123', Suite((Call('return', Const(0o123)),)))
check('3+4j', Suite((Call('return', Const(3+4j)),)))

check('''[]''', Suite((Call('return', Call('list')),)))
check('''[3]''', Suite((Call('return', Call('list', Const(3))),)))
check('''[3,]''', Suite((Call('return', Call('list', Const(3))),)))
check('''[3, 4]''', Suite((Call('return', Call('list', Const(3), Const(4))),)))
check('''[3, 4,]''', Suite((Call('return', Call('list', Const(3), Const(4))),)))
check('''[3, 4, 5]''', Suite((Call('return', Call('list', Const(3), Const(4), Const(5))),)))
check('''[3, 4, 5,]''', Suite((Call('return', Call('list', Const(3), Const(4), Const(5))),)))
check('''[3, 4, 5, 6]''', Suite((Call('return', Call('list', Const(3), Const(4), Const(5), Const(6))),)))
check('''[3, 4, 5, 6,]''', Suite((Call('return', Call('list', Const(3), Const(4), Const(5), Const(6))),)))

check('''[[1], 2, 3, 4, 5]''', Suite((Call('return', Call('list', Call('list', Const(1)), Const(2), Const(3), Const(4), Const(5))),)))
check('''[[1, 2], 3, 4, 5]''', Suite((Call('return', Call('list', Call('list', Const(1), Const(2)), Const(3), Const(4), Const(5))),)))
check('''[[1, 2, 3], 4, 5]''', Suite((Call('return', Call('list', Call('list', Const(1), Const(2), Const(3)), Const(4), Const(5))),)))
check('''[[1, 2, 3, 4], 5]''', Suite((Call('return', Call('list', Call('list', Const(1), Const(2), Const(3), Const(4)), Const(5))),)))
check('''[[1, 2, 3, 4, 5]]''', Suite((Call('return', Call('list', Call('list', Const(1), Const(2), Const(3), Const(4), Const(5)))),)))
check('''[[[1], 2, 3, 4, 5]]''', Suite((Call('return', Call('list', Call('list', Call('list', Const(1)), Const(2), Const(3), Const(4), Const(5)))),)))
check('''[[[1, 2], 3, 4, 5]]''', Suite((Call('return', Call('list', Call('list', Call('list', Const(1), Const(2)), Const(3), Const(4), Const(5)))),)))
check('''[[[1, 2, 3], 4, 5]]''', Suite((Call('return', Call('list', Call('list', Call('list', Const(1), Const(2), Const(3)), Const(4), Const(5)))),)))
check('''[[[1, 2, 3, 4], 5]]''', Suite((Call('return', Call('list', Call('list', Call('list', Const(1), Const(2), Const(3), Const(4)), Const(5)))),)))
check('''[[[1, 2, 3, 4, 5]]]''', Suite((Call('return', Call('list', Call('list', Call('list', Const(1), Const(2), Const(3), Const(4), Const(5))))),)))

check('''[1, 2, 3, 4, [5]]''', Suite((Call('return', Call('list', Const(1), Const(2), Const(3), Const(4), Call('list', Const(5)))),)))
check('''[1, 2, 3, [4, 5]]''', Suite((Call('return', Call('list', Const(1), Const(2), Const(3), Call('list', Const(4), Const(5)))),)))
check('''[1, 2, [3, 4, 5]]''', Suite((Call('return', Call('list', Const(1), Const(2), Call('list', Const(3), Const(4), Const(5)))),)))
check('''[1, [2, 3, 4, 5]]''', Suite((Call('return', Call('list', Const(1), Call('list', Const(2), Const(3), Const(4), Const(5)))),)))
check('''[[1, 2, 3, 4, [5]]]''', Suite((Call('return', Call('list', Call('list', Const(1), Const(2), Const(3), Const(4), Call('list', Const(5))))),)))
check('''[[1, 2, 3, [4, 5]]]''', Suite((Call('return', Call('list', Call('list', Const(1), Const(2), Const(3), Call('list', Const(4), Const(5))))),)))
check('''[[1, 2, [3, 4, 5]]]''', Suite((Call('return', Call('list', Call('list', Const(1), Const(2), Call('list', Const(3), Const(4), Const(5))))),)))
check('''[[1, [2, 3, 4, 5]]]''', Suite((Call('return', Call('list', Call('list', Const(1), Call('list', Const(2), Const(3), Const(4), Const(5))))),)))

check('''x = (None)''', Suite((Assign((Name('x'),), Const(None)), Call('return', Const(None)),)))
check('''x = (3, None)''', Suite((Assign((Name('x'),), Call('tuple', Const(3), Const(None))), Call('return', Const(None)),)))
check('''x = (3, 4, None)''', Suite((Assign((Name('x'),), Call('tuple', Const(3), Const(4), Const(None))), Call('return', Const(None)),)))
check('''x = (3, 4, 5, None)''', Suite((Assign((Name('x'),), Call('tuple', Const(3), Const(4), Const(5), Const(None))), Call('return', Const(None)),)))
check('''x = (3, 4, 5, 6, None)''', Suite((Assign((Name('x'),), Call('tuple', Const(3), Const(4), Const(5), Const(6), Const(None))), Call('return', Const(None)),)))

check('''x = ((1, None), 2, 3, 4, 5, None)''', Suite((Assign((Name('x'),), Call('tuple', Call('tuple', Const(1), Const(None)), Const(2), Const(3), Const(4), Const(5), Const(None))), Call('return', Const(None)),)))
check('''x = ((1, 2, None), 3, 4, 5, None)''', Suite((Assign((Name('x'),), Call('tuple', Call('tuple', Const(1), Const(2), Const(None)), Const(3), Const(4), Const(5), Const(None))), Call('return', Const(None)),)))
check('''x = ((1, 2, 3, None), 4, 5, None)''', Suite((Assign((Name('x'),), Call('tuple', Call('tuple', Const(1), Const(2), Const(3), Const(None)), Const(4), Const(5), Const(None))), Call('return', Const(None)),)))
check('''x = ((1, 2, 3, 4, None), 5, None)''', Suite((Assign((Name('x'),), Call('tuple', Call('tuple', Const(1), Const(2), Const(3), Const(4), Const(None)), Const(5), Const(None))), Call('return', Const(None)),)))
check('''x = ((1, 2, 3, 4, 5, None), None)''', Suite((Assign((Name('x'),), Call('tuple', Call('tuple', Const(1), Const(2), Const(3), Const(4), Const(5), Const(None)), Const(None))), Call('return', Const(None)),)))
check('''x = (((1, None), 2, 3, 4, 5, None), None)''', Suite((Assign((Name('x'),), Call('tuple', Call('tuple', Call('tuple', Const(1), Const(None)), Const(2), Const(3), Const(4), Const(5), Const(None)), Const(None))), Call('return', Const(None)),)))
check('''x = (((1, 2, None), 3, 4, 5, None), None)''', Suite((Assign((Name('x'),), Call('tuple', Call('tuple', Call('tuple', Const(1), Const(2), Const(None)), Const(3), Const(4), Const(5), Const(None)), Const(None))), Call('return', Const(None)),)))
check('''x = (((1, 2, 3, None), 4, 5, None), None)''', Suite((Assign((Name('x'),), Call('tuple', Call('tuple', Call('tuple', Const(1), Const(2), Const(3), Const(None)), Const(4), Const(5), Const(None)), Const(None))), Call('return', Const(None)),)))
check('''x = (((1, 2, 3, 4, None), 5, None), None)''', Suite((Assign((Name('x'),), Call('tuple', Call('tuple', Call('tuple', Const(1), Const(2), Const(3), Const(4), Const(None)), Const(5), Const(None)), Const(None))), Call('return', Const(None)),)))
check('''x = (((1, 2, 3, 4, 5, None), None), None)''', Suite((Assign((Name('x'),), Call('tuple', Call('tuple', Call('tuple', Const(1), Const(2), Const(3), Const(4), Const(5), Const(None)), Const(None)), Const(None))), Call('return', Const(None)),)))

check('''x = (1, 2, 3, 4, (5, None), None)''', Suite((Assign((Name('x'),), Call('tuple', Const(1), Const(2), Const(3), Const(4), Call('tuple', Const(5), Const(None)), Const(None))), Call('return', Const(None)),)))
check('''x = (1, 2, 3, (4, 5, None), None)''', Suite((Assign((Name('x'),), Call('tuple', Const(1), Const(2), Const(3), Call('tuple', Const(4), Const(5), Const(None)), Const(None))), Call('return', Const(None)),)))
check('''x = (1, 2, (3, 4, 5, None), None)''', Suite((Assign((Name('x'),), Call('tuple', Const(1), Const(2), Call('tuple', Const(3), Const(4), Const(5), Const(None)), Const(None))), Call('return', Const(None)),)))
check('''x = (1, (2, 3, 4, 5, None), None)''', Suite((Assign((Name('x'),), Call('tuple', Const(1), Call('tuple', Const(2), Const(3), Const(4), Const(5), Const(None)), Const(None))), Call('return', Const(None)),)))
check('''x = ((1, 2, 3, 4, (5, None), None), None)''', Suite((Assign((Name('x'),), Call('tuple', Call('tuple', Const(1), Const(2), Const(3), Const(4), Call('tuple', Const(5), Const(None)), Const(None)), Const(None))), Call('return', Const(None)),)))
check('''x = ((1, 2, 3, (4, 5, None), None), None)''', Suite((Assign((Name('x'),), Call('tuple', Call('tuple', Const(1), Const(2), Const(3), Call('tuple', Const(4), Const(5), Const(None)), Const(None)), Const(None))), Call('return', Const(None)),)))
check('''x = ((1, 2, (3, 4, 5, None), None), None)''', Suite((Assign((Name('x'),), Call('tuple', Call('tuple', Const(1), Const(2), Call('tuple', Const(3), Const(4), Const(5), Const(None)), Const(None)), Const(None))), Call('return', Const(None)),)))
check('''x = ((1, (2, 3, 4, 5, None), None), None)''', Suite((Assign((Name('x'),), Call('tuple', Call('tuple', Const(1), Call('tuple', Const(2), Const(3), Const(4), Const(5), Const(None)), Const(None)), Const(None))), Call('return', Const(None)),)))

check('''3
    ''', Suite((Call('return', Const(None)),)))   # hey look: Python does dead code removal!
check('''3
    ''', Suite((Call('return', Const(None)),)))
check('''3
    ''', Suite((Call('return', Const(None)),)))
check('''3
    ''', Suite((Call('return', Const(None)),)))
check('''
3''', Suite((Call('return', Const(None)),)))
check('''
3''', Suite((Call('return', Const(None)),)))
check('''
3''', Suite((Call('return', Const(None)),)))
check('''
3''', Suite((Call('return', Const(None)),)))

check('''a''', Suite((Call('return', Name('a')),)))
check('''a.b''', Suite((Call('return', Call('.', Name('a'), 'b')),)))
check('''a.b.c''', Suite((Call('return', Call('.', Call('.', Name('a'), 'b'), 'c')),)))
check('''a.b.c.d''', Suite((Call('return', Call('.', Call('.', Call('.', Name('a'), 'b'), 'c'), 'd')),)))
check('''a.b.c.d.e''', Suite((Call('return', Call('.', Call('.', Call('.', Call('.', Name('a'), 'b'), 'c'), 'd'), 'e')),)))
check('''a[1]''', Suite((Call('return', Call('[.]', Name('a'), Const(1))),)))
check('''a[1][2]''', Suite((Call('return', Call('[.]', Call('[.]', Name('a'), Const(1)), Const(2))),)))
check('''a[1][2][3]''', Suite((Call('return', Call('[.]', Call('[.]', Call('[.]', Name('a'), Const(1)), Const(2)), Const(3))),)))
check('''a[1][2][3][4]''', Suite((Call('return', Call('[.]', Call('[.]', Call('[.]', Call('[.]', Name('a'), Const(1)), Const(2)), Const(3)), Const(4))),)))
check('''(9, None).stuff''', Suite((Call('return', Call('.', Call('tuple', Const(9), Const(None)), 'stuff')),)))
check('''((9, None), None).stuff''', Suite((Call('return', Call('.', Call('tuple', Call('tuple', Const(9), Const(None)), Const(None)), 'stuff')),)))
check('''(((9, None), None), None).stuff''', Suite((Call('return', Call('.', Call('tuple', Call('tuple', Call('tuple', Const(9), Const(None)), Const(None)), Const(None)), 'stuff')),)))

check('''a[1]''', Suite((Call('return', Call('[.]', Name('a'), Const(1))),)))
check('''a["hey"]''', Suite((Call('return', Call('[.]', Name('a'), Const('hey'))),)))
check('''a[1:2]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(2), Const(None)))),)))
check('''a[:]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(None), Const(None)))),)))
check('''a[1:]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(None), Const(None)))),)))
check('''a[:1]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(1), Const(None)))),)))
check('''a[::]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(None), Const(None)))),)))
check('''a[1::]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(None), Const(None)))),)))
check('''a[:1:]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(1), Const(None)))),)))
check('''a[::1]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(None), Const(1)))),)))
check('''a[1:2:]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(2), Const(None)))),)))
check('''a[:1:2]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(1), Const(2)))),)))
check('''a[1::2]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(None), Const(2)))),)))
check('''a[1:2:3]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(2), Const(3)))),)))
check('''a[1,]''', Suite((Call('return', Call('[.]', Name('a'), Const(1))),)))
check('''a["hey",]''', Suite((Call('return', Call('[.]', Name('a'), Const('hey'))),)))
check('''a[1:2,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(2), Const(None)))),)))
check('''a[:,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(None), Const(None)))),)))
check('''a[1:,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(None), Const(None)))),)))
check('''a[:1,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(1), Const(None)))),)))
check('''a[::,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(None), Const(None)))),)))
check('''a[1::,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(None), Const(None)))),)))
check('''a[:1:,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(1), Const(None)))),)))
check('''a[::1,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(None), Const(1)))),)))
check('''a[1:2:,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(2), Const(None)))),)))
check('''a[:1:2,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(1), Const(2)))),)))
check('''a[1::2,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(None), Const(2)))),)))
check('''a[1:2:3,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(2), Const(3)))),)))
check('''a[1,5]''', Suite((Call('return', Call('[.]', Name('a'), Const(1), Const(5))),)))
check('''a["hey",5]''', Suite((Call('return', Call('[.]', Name('a'), Const('hey'), Const(5))),)))
check('''a[1:2,5]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(2), Const(None)), Const(5))),)))
check('''a[:,5]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(None), Const(None)), Const(5))),)))
check('''a[1:,5]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(None), Const(None)), Const(5))),)))
check('''a[:1,5]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(1), Const(None)), Const(5))),)))
check('''a[::,5]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(None), Const(None)), Const(5))),)))
check('''a[1::,5]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(None), Const(None)), Const(5))),)))
check('''a[:1:,5]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(1), Const(None)), Const(5))),)))
check('''a[::1,5]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(None), Const(1)), Const(5))),)))
check('''a[1:2:,5]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(2), Const(None)), Const(5))),)))
check('''a[:1:2,5]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(1), Const(2)), Const(5))),)))
check('''a[1::2,5]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(None), Const(2)), Const(5))),)))
check('''a[1:2:3,5]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(2), Const(3)), Const(5))),)))
check('''a[1,5,]''', Suite((Call('return', Call('[.]', Name('a'), Const(1), Const(5))),)))
check('''a["hey",5,]''', Suite((Call('return', Call('[.]', Name('a'), Const('hey'), Const(5))),)))
check('''a[1:2,5,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(2), Const(None)), Const(5))),)))
check('''a[:,5,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(None), Const(None)), Const(5))),)))
check('''a[1:,5,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(None), Const(None)), Const(5))),)))
check('''a[:1,5,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(1), Const(None)), Const(5))),)))
check('''a[::,5,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(None), Const(None)), Const(5))),)))
check('''a[1::,5,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(None), Const(None)), Const(5))),)))
check('''a[:1:,5,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(1), Const(None)), Const(5))),)))
check('''a[::1,5,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(None), Const(1)), Const(5))),)))
check('''a[1:2:,5,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(2), Const(None)), Const(5))),)))
check('''a[:1:2,5,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(1), Const(2)), Const(5))),)))
check('''a[1::2,5,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(None), Const(2)), Const(5))),)))
check('''a[1:2:3,5,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(2), Const(3)), Const(5))),)))
check('''a[1,"a":"b"]''', Suite((Call('return', Call('[.]', Name('a'), Const(1), Call('slice', Const('a'), Const('b'), Const(None)))),)))
check('''a["hey","a":"b"]''', Suite((Call('return', Call('[.]', Name('a'), Const('hey'), Call('slice', Const('a'), Const('b'), Const(None)))),)))
check('''a[1:2,"a":"b"]''', Suite((Call('return', Call('[.]', Name('a'), Call("slice", Const(1), Const(2), Const(None)), Call('slice', Const('a'), Const('b'), Const(None)))),)))
check('''a[:,"a":"b"]''', Suite((Call('return', Call('[.]', Name('a'), Call("slice", Const(None), Const(None), Const(None)), Call('slice', Const('a'), Const('b'), Const(None)))),)))
check('''a[1:,"a":"b"]''', Suite((Call('return', Call('[.]', Name('a'), Call("slice", Const(1), Const(None), Const(None)), Call('slice', Const('a'), Const('b'), Const(None)))),)))
check('''a[:1,"a":"b"]''', Suite((Call('return', Call('[.]', Name('a'), Call("slice", Const(None), Const(1), Const(None)), Call('slice', Const('a'), Const('b'), Const(None)))),)))
check('''a[::,"a":"b"]''', Suite((Call('return', Call('[.]', Name('a'), Call("slice", Const(None), Const(None), Const(None)), Call('slice', Const('a'), Const('b'), Const(None)))),)))
check('''a[1::,"a":"b"]''', Suite((Call('return', Call('[.]', Name('a'), Call("slice", Const(1), Const(None), Const(None)), Call('slice', Const('a'), Const('b'), Const(None)))),)))
check('''a[:1:,"a":"b"]''', Suite((Call('return', Call('[.]', Name('a'), Call("slice", Const(None), Const(1), Const(None)), Call('slice', Const('a'), Const('b'), Const(None)))),)))
check('''a[::1,"a":"b"]''', Suite((Call('return', Call('[.]', Name('a'), Call("slice", Const(None), Const(None), Const(1)), Call('slice', Const('a'), Const('b'), Const(None)))),)))
check('''a[1:2:,"a":"b"]''', Suite((Call('return', Call('[.]', Name('a'), Call("slice", Const(1), Const(2), Const(None)), Call('slice', Const('a'), Const('b'), Const(None)))),)))
check('''a[:1:2,"a":"b"]''', Suite((Call('return', Call('[.]', Name('a'), Call("slice", Const(None), Const(1), Const(2)), Call('slice', Const('a'), Const('b'), Const(None)))),)))
check('''a[1::2,"a":"b"]''', Suite((Call('return', Call('[.]', Name('a'), Call("slice", Const(1), Const(None), Const(2)), Call('slice', Const('a'), Const('b'), Const(None)))),)))
check('''a[1:2:3,"a":"b"]''', Suite((Call('return', Call('[.]', Name('a'), Call("slice", Const(1), Const(2), Const(3)), Call('slice', Const('a'), Const('b'), Const(None)))),)))
check('''a[1,"a":"b",]''', Suite((Call('return', Call('[.]', Name('a'), Const(1), Call('slice', Const('a'), Const('b'), Const(None)))),)))
check('''a["hey","a":"b",]''', Suite((Call('return', Call('[.]', Name('a'), Const('hey'), Call('slice', Const('a'), Const('b'), Const(None)))),)))
check('''a[1:2,"a":"b",]''', Suite((Call('return', Call('[.]', Name('a'), Call("slice", Const(1), Const(2), Const(None)), Call('slice', Const('a'), Const('b'), Const(None)))),)))
check('''a[:,"a":"b",]''', Suite((Call('return', Call('[.]', Name('a'), Call("slice", Const(None), Const(None), Const(None)), Call('slice', Const('a'), Const('b'), Const(None)))),)))
check('''a[1:,"a":"b",]''', Suite((Call('return', Call('[.]', Name('a'), Call("slice", Const(1), Const(None), Const(None)), Call('slice', Const('a'), Const('b'), Const(None)))),)))
check('''a[:1,"a":"b",]''', Suite((Call('return', Call('[.]', Name('a'), Call("slice", Const(None), Const(1), Const(None)), Call('slice', Const('a'), Const('b'), Const(None)))),)))
check('''a[::,"a":"b",]''', Suite((Call('return', Call('[.]', Name('a'), Call("slice", Const(None), Const(None), Const(None)), Call('slice', Const('a'), Const('b'), Const(None)))),)))
check('''a[1::,"a":"b",]''', Suite((Call('return', Call('[.]', Name('a'), Call("slice", Const(1), Const(None), Const(None)), Call('slice', Const('a'), Const('b'), Const(None)))),)))
check('''a[:1:,"a":"b",]''', Suite((Call('return', Call('[.]', Name('a'), Call("slice", Const(None), Const(1), Const(None)), Call('slice', Const('a'), Const('b'), Const(None)))),)))
check('''a[::1,"a":"b",]''', Suite((Call('return', Call('[.]', Name('a'), Call("slice", Const(None), Const(None), Const(1)), Call('slice', Const('a'), Const('b'), Const(None)))),)))
check('''a[1:2:,"a":"b",]''', Suite((Call('return', Call('[.]', Name('a'), Call("slice", Const(1), Const(2), Const(None)), Call('slice', Const('a'), Const('b'), Const(None)))),)))
check('''a[:1:2,"a":"b",]''', Suite((Call('return', Call('[.]', Name('a'), Call("slice", Const(None), Const(1), Const(2)), Call('slice', Const('a'), Const('b'), Const(None)))),)))
check('''a[1::2,"a":"b",]''', Suite((Call('return', Call('[.]', Name('a'), Call("slice", Const(1), Const(None), Const(2)), Call('slice', Const('a'), Const('b'), Const(None)))),)))
check('''a[1:2:3,"a":"b",]''', Suite((Call('return', Call('[.]', Name('a'), Call("slice", Const(1), Const(2), Const(3)), Call('slice', Const('a'), Const('b'), Const(None)))),)))
check('''a[1,5,6]''', Suite((Call('return', Call('[.]', Name('a'), Const(1), Const(5), Const(6))),)))
check('''a["hey",5,6]''', Suite((Call('return', Call('[.]', Name('a'), Const('hey'), Const(5), Const(6))),)))
check('''a[1:2,5,6]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(2), Const(None)), Const(5), Const(6))),)))
check('''a[:,5,6]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(None), Const(None)), Const(5), Const(6))),)))
check('''a[1:,5,6]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(None), Const(None)), Const(5), Const(6))),)))
check('''a[:1,5,6]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(1), Const(None)), Const(5), Const(6))),)))
check('''a[::,5,6]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(None), Const(None)), Const(5), Const(6))),)))
check('''a[1::,5,6]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(None), Const(None)), Const(5), Const(6))),)))
check('''a[:1:,5,6]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(1), Const(None)), Const(5), Const(6))),)))
check('''a[::1,5,6]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(None), Const(1)), Const(5), Const(6))),)))
check('''a[1:2:,5,6]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(2), Const(None)), Const(5), Const(6))),)))
check('''a[:1:2,5,6]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(1), Const(2)), Const(5), Const(6))),)))
check('''a[1::2,5,6]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(None), Const(2)), Const(5), Const(6))),)))
check('''a[1:2:3,5,6]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(2), Const(3)), Const(5), Const(6))),)))
check('''a[1,5,6,]''', Suite((Call('return', Call('[.]', Name('a'), Const(1), Const(5), Const(6))),)))
check('''a["hey",5,6,]''', Suite((Call('return', Call('[.]', Name('a'), Const('hey'), Const(5), Const(6))),)))
check('''a[1:2,5,6,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(2), Const(None)), Const(5), Const(6))),)))
check('''a[:,5,6,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(None), Const(None)), Const(5), Const(6))),)))
check('''a[1:,5,6,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(None), Const(None)), Const(5), Const(6))),)))
check('''a[:1,5,6,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(1), Const(None)), Const(5), Const(6))),)))
check('''a[::,5,6,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(None), Const(None)), Const(5), Const(6))),)))
check('''a[1::,5,6,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(None), Const(None)), Const(5), Const(6))),)))
check('''a[:1:,5,6,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(1), Const(None)), Const(5), Const(6))),)))
check('''a[::1,5,6,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(None), Const(1)), Const(5), Const(6))),)))
check('''a[1:2:,5,6,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(2), Const(None)), Const(5), Const(6))),)))
check('''a[:1:2,5,6,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(None), Const(1), Const(2)), Const(5), Const(6))),)))
check('''a[1::2,5,6,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(None), Const(2)), Const(5), Const(6))),)))
check('''a[1:2:3,5,6,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Const(2), Const(3)), Const(5), Const(6))),)))
check('''a[1:[2]:3,[],5,6,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Call('list', Const(2)), Const(3)), Call('list'), Const(5), Const(6))),)))
check('''a[1:[[2]]:3,[[]],5,6,]''', Suite((Call('return', Call('[.]', Name('a'), Call('slice', Const(1), Call('list', Call('list', Const(2))), Const(3)), Call('list', Call('list')), Const(5), Const(6))),)))

check('''a[2].three''', Suite((Call('return', Call('.', Call('[.]', Name('a'), Const(2)), 'three')),)))
check('''a.three''', Suite((Call('return', Call('.', Name('a'), 'three')),)))
check('''a[2]''', Suite((Call('return', Call('[.]', Name('a'), Const(2))),)))
check('''a.three[2]''', Suite((Call('return', Call('[.]', Call('.', Name('a'), 'three'), Const(2))),)))

check('''x and y''', Suite((Call('return', Call('and', Name('x'), Name('y'))),)))
check('''x and y and z''', Suite((Call('return', Call('and', Name('x'), Call('and', Name('y'), Name('z')))),)))
check('''x and y and z and w''', Suite((Call('return', Call('and', Name('x'), Call('and', Name('y'), Call('and', Name('z'), Name('w'))))),)))
check('''not x''', Suite((Call('return', Call('not', Name('x'))),)))
check('''not x and y''', Suite((Call('return', Call('and', Call('not', Name('x')), Name('y'))),)))
check('''x or y''', Suite((Call('return', Call('or', Name('x'), Name('y'))),)))
check('''x or y and z''', Suite((Call('return', Call('or', Name('x'), Call('and', Name('y'), Name('z')))),)))
check('''x or y or z''', Suite((Call('return', Call('or', Name('x'), Call('or', Name('y'), Name('z')))),)))
check('''not x or y and z''', Suite((Call('return', Call('or', Call('not', Name('x')), Call('and', Name('y'), Name('z')))),)))
check('''x or not y and z''', Suite((Call('return', Call('or', Name('x'), Call('and', Call('not', Name('y')), Name('z')))),)))
check('''x or y and not z''', Suite((Call('return', Call('or', Name('x'), Call('and', Name('y'), Call('not', Name('z'))))),)))
check('''not x or not y and z''', Suite((Call('return', Call('or', Call('not', Name('x')), Call('and', Call('not', Name('y')), Name('z')))),)))
check('''not x or y and not z''', Suite((Call('return', Call('or', Call('not', Name('x')), Call('and', Name('y'), Call('not', Name('z'))))),)))
check('''x or not y and not z''', Suite((Call('return', Call('or', Name('x'), Call('and', Call('not', Name('y')), Call('not', Name('z'))))),)))
check('''not x or not y and not z''', Suite((Call('return', Call('or', Call('not', Name('x')), Call('and', Call('not', Name('y')), Call('not', Name('z'))))),)))
check('''x and y or z''', Suite((Call('return', Call('or', Call('and', Name('x'), Name('y')), Name('z'))),)))
check('''not x and y or z''', Suite((Call('return', Call('or', Call('and', Call('not', Name('x')), Name('y')), Name('z'))),)))
check('''x and not y or z''', Suite((Call('return', Call('or', Call('and', Name('x'), Call('not', Name('y'))), Name('z'))),)))
check('''x and y or not z''', Suite((Call('return', Call('or', Call('and', Name('x'), Name('y')), Call('not', Name('z')))),)))
check('''not x and not y or z''', Suite((Call('return', Call('or', Call('and', Call('not', Name('x')), Call('not', Name('y'))), Name('z'))),)))
check('''not x and y or not z''', Suite((Call('return', Call('or', Call('and', Call('not', Name('x')), Name('y')), Call('not', Name('z')))),)))
check('''x and not y or not z''', Suite((Call('return', Call('or', Call('and', Name('x'), Call('not', Name('y'))), Call('not', Name('z')))),)))

check('''x < y''', Suite((Call('return', Call('<', Name('x'), Name('y'))),)))
check('''x > y''', Suite((Call('return', Call('>', Name('x'), Name('y'))),)))
check('''x == y''', Suite((Call('return', Call('==', Name('x'), Name('y'))),)))
check('''x >= y''', Suite((Call('return', Call('>=', Name('x'), Name('y'))),)))
check('''x <= y''', Suite((Call('return', Call('<=', Name('x'), Name('y'))),)))
check('''x != y''', Suite((Call('return', Call('!=', Name('x'), Name('y'))),)))
check('''x in y''', Suite((Call('return', Call('in', Name('x'), Name('y'))),)))
check('''x not in y''', Suite((Call('return', Call('not-in', Name('x'), Name('y'))),)))
check('''1 < y < 2''', Suite((Call('return', Call('and', Call('<', Const(1), Name('y')), Call('<', Name('y'), Const(2)))),)))
check('''1 < y == 2''', Suite((Call('return', Call('and', Call('<', Const(1), Name('y')), Call('==', Name('y'), Const(2)))),)))

check('''(x, None) < y''', Suite((Call('return', Call('<', Call('tuple', Name('x'), Const(None)), Name('y'))),)))
check('''(x, None) > y''', Suite((Call('return', Call('>', Call('tuple', Name('x'), Const(None)), Name('y'))),)))
check('''(x, None) == y''', Suite((Call('return', Call('==', Call('tuple', Name('x'), Const(None)), Name('y'))),)))
check('''(x, None) >= y''', Suite((Call('return', Call('>=', Call('tuple', Name('x'), Const(None)), Name('y'))),)))
check('''(x, None) <= y''', Suite((Call('return', Call('<=', Call('tuple', Name('x'), Const(None)), Name('y'))),)))
check('''(x, None) != y''', Suite((Call('return', Call('!=', Call('tuple', Name('x'), Const(None)), Name('y'))),)))
check('''(x, None) in y''', Suite((Call('return', Call('in', Call('tuple', Name('x'), Const(None)), Name('y'))),)))
check('''(x, None) not in y''', Suite((Call('return', Call('not-in', Call('tuple', Name('x'), Const(None)), Name('y'))),)))
check('''(1, None) < y < 2''', Suite((Call('return', Call('and', Call('<', Call('tuple', Const(1), Const(None)), Name('y')), Call('<', Name('y'), Const(2)))),)))
check('''(1, None) < y == 2''', Suite((Call('return', Call('and', Call('<', Call('tuple', Const(1), Const(None)), Name('y')), Call('==', Name('y'), Const(2)))),)))

check('''x < (y, None)''', Suite((Call('return', Call('<', Name('x'), Call('tuple', Name('y'), Const(None)))),)))
check('''x > (y, None)''', Suite((Call('return', Call('>', Name('x'), Call('tuple', Name('y'), Const(None)))),)))
check('''x == (y, None)''', Suite((Call('return', Call('==', Name('x'), Call('tuple', Name('y'), Const(None)))),)))
check('''x >= (y, None)''', Suite((Call('return', Call('>=', Name('x'), Call('tuple', Name('y'), Const(None)))),)))
check('''x <= (y, None)''', Suite((Call('return', Call('<=', Name('x'), Call('tuple', Name('y'), Const(None)))),)))
check('''x != (y, None)''', Suite((Call('return', Call('!=', Name('x'), Call('tuple', Name('y'), Const(None)))),)))
check('''x in (y, None)''', Suite((Call('return', Call('in', Name('x'), Call('tuple', Name('y'), Const(None)))),)))
check('''x not in (y, None)''', Suite((Call('return', Call('not-in', Name('x'), Call('tuple', Name('y'), Const(None)))),)))
check('''1 < (y, None) < 2''', Suite((Call('return', Call('and', Call('<', Const(1), Call('tuple', Name('y'), Const(None))), Call('<', Call('tuple', Name('y'), Const(None)), Const(2)))),)))
check('''1 < (y, None) == 2''', Suite((Call('return', Call('and', Call('<', Const(1), Call('tuple', Name('y'), Const(None))), Call('==', Call('tuple', Name('y'), Const(None)), Const(2)))),)))
check('''1 < y < (2, None)''', Suite((Call('return', Call('and', Call('<', Const(1), Name('y')), Call('<', Name('y'), Call('tuple', Const(2), Const(None))))),)))
check('''1 < y == (2, None)''', Suite((Call('return', Call('and', Call('<', Const(1), Name('y')), Call('==', Name('y'), Call('tuple', Const(2), Const(None))))),)))

check('''(x, None) < (y, None)''', Suite((Call('return', Call('<', Call('tuple', Name('x'), Const(None)), Call('tuple', Name('y'), Const(None)))),)))
check('''(x, None) > (y, None)''', Suite((Call('return', Call('>', Call('tuple', Name('x'), Const(None)), Call('tuple', Name('y'), Const(None)))),)))
check('''(x, None) == (y, None)''', Suite((Call('return', Call('==', Call('tuple', Name('x'), Const(None)), Call('tuple', Name('y'), Const(None)))),)))
check('''(x, None) >= (y, None)''', Suite((Call('return', Call('>=', Call('tuple', Name('x'), Const(None)), Call('tuple', Name('y'), Const(None)))),)))
check('''(x, None) <= (y, None)''', Suite((Call('return', Call('<=', Call('tuple', Name('x'), Const(None)), Call('tuple', Name('y'), Const(None)))),)))
check('''(x, None) != (y, None)''', Suite((Call('return', Call('!=', Call('tuple', Name('x'), Const(None)), Call('tuple', Name('y'), Const(None)))),)))
check('''(x, None) in (y, None)''', Suite((Call('return', Call('in', Call('tuple', Name('x'), Const(None)), Call('tuple', Name('y'), Const(None)))),)))
check('''(x, None) not in (y, None)''', Suite((Call('return', Call('not-in', Call('tuple', Name('x'), Const(None)), Call('tuple', Name('y'), Const(None)))),)))
check('''(1, None) < (y, None) < 2''', Suite((Call('return', Call('and', Call('<', Call('tuple', Const(1), Const(None)), Call('tuple', Name('y'), Const(None))), Call('<', Call('tuple', Name('y'), Const(None)), Const(2)))),)))
check('''(1, None) < (y, None) == 2''', Suite((Call('return', Call('and', Call('<', Call('tuple', Const(1), Const(None)), Call('tuple', Name('y'), Const(None))), Call('==', Call('tuple', Name('y'), Const(None)), Const(2)))),)))
check('''(1, None) < y < (2, None)''', Suite((Call('return', Call('and', Call('<', Call('tuple', Const(1), Const(None)), Name('y')), Call('<', Name('y'), Call('tuple', Const(2), Const(None))))),)))
check('''(1, None) < y == (2, None)''', Suite((Call('return', Call('and', Call('<', Call('tuple', Const(1), Const(None)), Name('y')), Call('==', Name('y'), Call('tuple', Const(2), Const(None))))),)))

check('''x + y''', Suite((Call('return', Call('+', Name('x'), Name('y'))),)))
check('''x + y + z''', Suite((Call('return', Call('+', Call('+', Name('x'), Name('y')), Name('z'))),)))
check('''x + y + z + w''', Suite((Call('return', Call('+', Call('+', Call('+', Name('x'), Name('y')), Name('z')), Name('w'))),)))
check('''x - y''', Suite((Call('return', Call('-', Name('x'), Name('y'))),)))
check('''x - y - z''', Suite((Call('return', Call('-', Call('-', Name('x'), Name('y')), Name('z'))),)))
check('''x - y - z - w''', Suite((Call('return', Call('-', Call('-', Call('-', Name('x'), Name('y')), Name('z')), Name('w'))),)))
check('''x - y + z - w''', Suite((Call('return', Call('-', Call('+', Call('-', Name('x'), Name('y')), Name('z')), Name('w'))),)))
check('''x * y''', Suite((Call('return', Call('*', Name('x'), Name('y'))),)))
check('''x * y * z''', Suite((Call('return', Call('*', Call('*', Name('x'), Name('y')), Name('z'))),)))
check('''x * y * z * w''', Suite((Call('return', Call('*', Call('*', Call('*', Name('x'), Name('y')), Name('z')), Name('w'))),)))
check('''x * y - z * w''', Suite((Call('return', Call('-', Call('*', Name('x'), Name('y')), Call('*', Name('z'), Name('w')))),)))
check('''x / y''', Suite((Call('return', Call('/', Name('x'), Name('y'))),)))
check('''x / y / z''', Suite((Call('return', Call('/', Call('/', Name('x'), Name('y')), Name('z'))),)))
check('''x / y / z / w''', Suite((Call('return', Call('/', Call('/', Call('/', Name('x'), Name('y')), Name('z')), Name('w'))),)))
check('''x / y * z / w''', Suite((Call('return', Call('/', Call('*', Call('/', Name('x'), Name('y')), Name('z')), Name('w'))),)))
check('''x % y''', Suite((Call('return', Call('%', Name('x'), Name('y'))),)))
check('''x % y % z''', Suite((Call('return', Call('%', Call('%', Name('x'), Name('y')), Name('z'))),)))
check('''x % y % z % w''', Suite((Call('return', Call('%', Call('%', Call('%', Name('x'), Name('y')), Name('z')), Name('w'))),)))
check('''x % y / z % w''', Suite((Call('return', Call('%', Call('/', Call('%', Name('x'), Name('y')), Name('z')), Name('w'))),)))
check('''x // y''', Suite((Call('return', Call('//', Name('x'), Name('y'))),)))
check('''x // y // z''', Suite((Call('return', Call('//', Call('//', Name('x'), Name('y')), Name('z'))),)))
check('''x // y // z // w''', Suite((Call('return', Call('//', Call('//', Call('//', Name('x'), Name('y')), Name('z')), Name('w'))),)))
check('''x // y % z // w''', Suite((Call('return', Call('//', Call('%', Call('//', Name('x'), Name('y')), Name('z')), Name('w'))),)))
check('''+x''', Suite((Call('return', Call('u+', Name('x'))),)))
check('''-x''', Suite((Call('return', Call('u-', Name('x'))),)))
check('''++x''', Suite((Call('return', Call('u+', Call('u+', Name('x')))),)))
check('''+-x''', Suite((Call('return', Call('u+', Call('u-', Name('x')))),)))
check('''-+x''', Suite((Call('return', Call('u-', Call('u+', Name('x')))),)))
check('''--x''', Suite((Call('return', Call('u-', Call('u-', Name('x')))),)))
check('''+x + y''', Suite((Call('return', Call('+', Call('u+', Name('x')), Name('y'))),)))
check('''-x + y''', Suite((Call('return', Call('+', Call('u-', Name('x')), Name('y'))),)))
check('''++x + y''', Suite((Call('return', Call('+', Call('u+', Call('u+', Name('x'))), Name('y'))),)))
check('''+-x + y''', Suite((Call('return', Call('+', Call('u+', Call('u-', Name('x'))), Name('y'))),)))
check('''-+x + y''', Suite((Call('return', Call('+', Call('u-', Call('u+', Name('x'))), Name('y'))),)))
check('''--x + y''', Suite((Call('return', Call('+', Call('u-', Call('u-', Name('x'))), Name('y'))),)))
check('''x + +x''', Suite((Call('return', Call('+', Name('x'), Call('u+', Name('x')))),)))
check('''x + -x''', Suite((Call('return', Call('+', Name('x'), Call('u-', Name('x')))),)))
check('''x + ++x''', Suite((Call('return', Call('+', Name('x'), Call('u+', Call('u+', Name('x'))))),)))
check('''x + +-x''', Suite((Call('return', Call('+', Name('x'), Call('u+', Call('u-', Name('x'))))),)))
check('''x + -+x''', Suite((Call('return', Call('+', Name('x'), Call('u-', Call('u+', Name('x'))))),)))
check('''x + --x''', Suite((Call('return', Call('+', Name('x'), Call('u-', Call('u-', Name('x'))))),)))
check('''x ** y''', Suite((Call('return', Call('**', Name('x'), Name('y'))),)))
check('''x ** y ** z''', Suite((Call('return', Call('**', Name('x'), Call('**', Name('y'), Name('z')))),)))
check('''x ** y ** z ** w''', Suite((Call('return', Call('**', Name('x'), Call('**', Name('y'), Call('**', Name('z'), Name('w'))))),)))
check('''x ** y // z ** w''', Suite((Call('return', Call('//', Call('**', Name('x'), Name('y')), Call('**', Name('z'), Name('w')))),)))
check('''x.y**2''', Suite((Call('return', Call('**', Call('.', Name('x'), 'y'), Const(2))),)))

check('f(None)', Suite((Call('return', Call(Name('f'), Const(None))),)))
check('f(x, None)', Suite((Call('return', Call(Name('f'), Name('x'), Const(None))),)))
check('f(x, y, None)', Suite((Call('return', Call(Name('f'), Name('x'), Name('y'), Const(None))),)))
check('f(x, y, z, None)', Suite((Call('return', Call(Name('f'), Name('x'), Name('y'), Name('z'), Const(None))),)))
check('f(x=1)', Suite((Call('return', CallKeyword(Name('f'), (), (('x', Const(1)),))),)))
check('f(x, y=1)', Suite((Call('return', CallKeyword(Name('f'), (Name('x'),), (('y', Const(1)),))),)))
check('f(x, y, z=1)', Suite((Call('return', CallKeyword(Name('f'), (Name('x'), Name('y'),), (('z', Const(1)),))),)))

check('x = 1; x', Suite((Assign((Name('x'),), Const(1)), Name('x'), Call('return', Const(None)),)))
check('x = 1; x;', Suite((Assign((Name('x'),), Const(1)), Name('x'), Call('return', Const(None)),)))
check('x, = 1; x', Suite((Assign((Unpack((Name('x'),)),), Const(1)), Name('x'), Call('return', Const(None)),)))
check('x, y = 1; x', Suite((Assign((Unpack((Name('x'), Name('y'))),), Const(1)), Name('x'), Call('return', Const(None)),)))
check('x, y, = 1; x', Suite((Assign((Unpack((Name('x'), Name('y'))),), Const(1)), Name('x'), Call('return', Const(None)),)))
check('x, y, z = 1; x', Suite((Assign((Unpack((Name('x'), Name('y'), Name('z'))),), Const(1)), Name('x'), Call('return', Const(None)),)))
check('x, y, z, = 1; x', Suite((Assign((Unpack((Name('x'), Name('y'), Name('z'))),), Const(1)), Name('x'), Call('return', Const(None)),)))

check("False", Suite((Call('return', Const(False)),)))
check("True", Suite((Call('return', Const(True)),)))
check("not x", Suite((Call('return', Call('not', Name('x'))),)))
check("not x and not y", Suite((Call('return', Call('and', Call('not', Name('x')), Call('not', Name('y')))),)))
check("not x and not y and not z", Suite((Call('return', Call('and', Call('not', Name('x')), Call('and', Call('not', Name('y')), Call('not', Name('z'))))),)))
check("not x and not y and not z", Suite((Call('return', Call('and', Call('not', Name('x')), Call('and', Call('not', Name('y')), Call('not', Name('z'))))),)))
check("not x and not y and not z", Suite((Call('return', Call('and', Call('not', Name('x')), Call('and', Call('not', Name('y')), Call('not', Name('z'))))),)))
check("not x or not y", Suite((Call('return', Call('or', Call('not', Name('x')), Call('not', Name('y')))),)))
check("not x or not y or not z", Suite((Call('return', Call('or', Call('not', Name('x')), Call('or', Call('not', Name('y')), Call('not', Name('z'))))),)))
check("not x or not y or not z", Suite((Call('return', Call('or', Call('not', Name('x')), Call('or', Call('not', Name('y')), Call('not', Name('z'))))),)))
check("not x or not y or not z", Suite((Call('return', Call('or', Call('not', Name('x')), Call('or', Call('not', Name('y')), Call('not', Name('z'))))),)))
check("(not x or not y, None) and not z", Suite((Call('return', Call('and', Call('tuple', Call('or', Call('not', Name('x')), Call('not', Name('y'))), Const(None)), Call('not', Name('z')))),)))
check("not x and (not y or not z, None)", Suite((Call('return', Call('and', Call('not', Name('x')), Call('tuple', Call('or', Call('not', Name('y')), Call('not', Name('z'))), Const(None)))),)))

check("not x(1, None)", Suite((Call('return', Call('not', Call(Name('x'), Const(1), Const(None)))),)))
check("not x(1, None) and not y(2, None)", Suite((Call('return', Call('and', Call('not', Call(Name('x'), Const(1), Const(None))), Call('not', Call(Name('y'), Const(2), Const(None))))),)))
check("not x(1, None) and not y(2, None) and not z(3, None)", Suite((Call('return', Call('and', Call('not', Call(Name('x'), Const(1), Const(None))), Call('and', Call('not', Call(Name('y'), Const(2), Const(None))), Call('not', Call(Name('z'), Const(3), Const(None)))))),)))
check("not x(1, None) and not y(2, None) and not z(3, None)", Suite((Call('return', Call('and', Call('not', Call(Name('x'), Const(1), Const(None))), Call('and', Call('not', Call(Name('y'), Const(2), Const(None))), Call('not', Call(Name('z'), Const(3), Const(None)))))),)))
check("not x(1, None) and not y(2, None) and not z(3, None)", Suite((Call('return', Call('and', Call('not', Call(Name('x'), Const(1), Const(None))), Call('and', Call('not', Call(Name('y'), Const(2), Const(None))), Call('not', Call(Name('z'), Const(3), Const(None)))))),)))
check("not x(1, None) or not y(2, None)", Suite((Call('return', Call('or', Call('not', Call(Name('x'), Const(1), Const(None))), Call('not', Call(Name('y'), Const(2), Const(None))))),)))
check("not x(1, None) or not y(2, None) or not z(3, None)", Suite((Call('return', Call('or', Call('not', Call(Name('x'), Const(1), Const(None))), Call('or', Call('not', Call(Name('y'), Const(2), Const(None))), Call('not', Call(Name('z'), Const(3), Const(None)))))),)))
check("not x(1, None) or not y(2, None) or not z(3, None)", Suite((Call('return', Call('or', Call('not', Call(Name('x'), Const(1), Const(None))), Call('or', Call('not', Call(Name('y'), Const(2), Const(None))), Call('not', Call(Name('z'), Const(3), Const(None)))))),)))
check("not x(1, None) or not y(2, None) or not z(3, None)", Suite((Call('return', Call('or', Call('not', Call(Name('x'), Const(1), Const(None))), Call('or', Call('not', Call(Name('y'), Const(2), Const(None))), Call('not', Call(Name('z'), Const(3), Const(None)))))),)))
check("(not x(1, None) or not y(2, None), None) and not z(3, None)", Suite((Call('return', Call('and', Call('tuple', Call('or', Call('not', Call(Name('x'), Const(1), Const(None))), Call('not', Call(Name('y'), Const(2), Const(None)))), Const(None)), Call('not', Call(Name('z'), Const(3), Const(None))))),)))
check("not x(1, None) and (not y(2, None) or not z(3, None), None)", Suite((Call('return', Call('and', Call('not', Call(Name('x'), Const(1), Const(None))), Call('tuple', Call('or', Call('not', Call(Name('y'), Const(2), Const(None))), Call('not', Call(Name('z'), Const(3), Const(None)))), Const(None)))),)))

check("not x.a", Suite((Call('return', Call('not', Call('.', Name('x'), 'a'))),)))
check("not x.a and not y.b", Suite((Call('return', Call('and', Call('not', Call('.', Name('x'), 'a')), Call('not', Call('.', Name('y'), 'b')))),)))
check("not x.a and not y.b and not z.c", Suite((Call('return', Call('and', Call('not', Call('.', Name('x'), 'a')), Call('and', Call('not', Call('.', Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check("not x.a and not y.b and not z.c", Suite((Call('return', Call('and', Call('not', Call('.', Name('x'), 'a')), Call('and', Call('not', Call('.', Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check("not x.a and not y.b and not z.c", Suite((Call('return', Call('and', Call('not', Call('.', Name('x'), 'a')), Call('and', Call('not', Call('.', Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check("not x.a or not y.b", Suite((Call('return', Call('or', Call('not', Call('.', Name('x'), 'a')), Call('not', Call('.', Name('y'), 'b')))),)))
check("not x.a or not y.b or not z.c", Suite((Call('return', Call('or', Call('not', Call('.', Name('x'), 'a')), Call('or', Call('not', Call('.', Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check("not x.a or not y.b or not z.c", Suite((Call('return', Call('or', Call('not', Call('.', Name('x'), 'a')), Call('or', Call('not', Call('.', Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check("not x.a or not y.b or not z.c", Suite((Call('return', Call('or', Call('not', Call('.', Name('x'), 'a')), Call('or', Call('not', Call('.', Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check("(not x.a or not y.b, None) and not z.c", Suite((Call('return', Call('and', Call('tuple', Call('or', Call('not', Call('.', Name('x'), 'a')), Call('not', Call('.', Name('y'), 'b'))), Const(None)), Call('not', Call('.', Name('z'), 'c')))),)))
check("not x.a and (not y.b or not z.c, None)", Suite((Call('return', Call('and', Call('not', Call('.', Name('x'), 'a')), Call('tuple', Call('or', Call('not', Call('.', Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))), Const(None)))),)))

check("False", Suite((Call('return', Const(False)),)))
check("True", Suite((Call('return', Const(True)),)))
check("not x", Suite((Call('return', Call('not', Name('x'))),)))
check("not x and not y", Suite((Call('return', Call('and', Call('not', Name('x')), Call('not', Name('y')))),)))
check("not x and not y and not z", Suite((Call('return', Call('and', Call('not', Name('x')), Call('and', Call('not', Name('y')), Call('not', Name('z'))))),)))
check("not x and not y and not z", Suite((Call('return', Call('and', Call('not', Name('x')), Call('and', Call('not', Name('y')), Call('not', Name('z'))))),)))
check("not x and not y and not z", Suite((Call('return', Call('and', Call('not', Name('x')), Call('and', Call('not', Name('y')), Call('not', Name('z'))))),)))
check("not x or not y", Suite((Call('return', Call('or', Call('not', Name('x')), Call('not', Name('y')))),)))
check("not x or not y or not z", Suite((Call('return', Call('or', Call('not', Name('x')), Call('or', Call('not', Name('y')), Call('not', Name('z'))))),)))
check("not x or not y or not z", Suite((Call('return', Call('or', Call('not', Name('x')), Call('or', Call('not', Name('y')), Call('not', Name('z'))))),)))
check("not x or not y or not z", Suite((Call('return', Call('or', Call('not', Name('x')), Call('or', Call('not', Name('y')), Call('not', Name('z'))))),)))
check("(not x or not y, None) and not z", Suite((Call('return', Call('and', Call('tuple', Call('or', Call('not', Name('x')), Call('not', Name('y'))), Const(None)), Call('not', Name('z')))),)))
check("not x and (not y or not z, None)", Suite((Call('return', Call('and', Call('not', Name('x')), Call('tuple', Call('or', Call('not', Name('y')), Call('not', Name('z'))), Const(None)))),)))

check("not x(1, None)", Suite((Call('return', Call('not', Call(Name('x'), Const(1), Const(None)))),)))
check("not x(1, None) and not y(2, None)", Suite((Call('return', Call('and', Call('not', Call(Name('x'), Const(1), Const(None))), Call('not', Call(Name('y'), Const(2), Const(None))))),)))
check("not x(1, None) and not y(2, None) and not z(3, None)", Suite((Call('return', Call('and', Call('not', Call(Name('x'), Const(1), Const(None))), Call('and', Call('not', Call(Name('y'), Const(2), Const(None))), Call('not', Call(Name('z'), Const(3), Const(None)))))),)))
check("not x(1, None) and not y(2, None) and not z(3, None)", Suite((Call('return', Call('and', Call('not', Call(Name('x'), Const(1), Const(None))), Call('and', Call('not', Call(Name('y'), Const(2), Const(None))), Call('not', Call(Name('z'), Const(3), Const(None)))))),)))
check("not x(1, None) and not y(2, None) and not z(3, None)", Suite((Call('return', Call('and', Call('not', Call(Name('x'), Const(1), Const(None))), Call('and', Call('not', Call(Name('y'), Const(2), Const(None))), Call('not', Call(Name('z'), Const(3), Const(None)))))),)))
check("not x(1, None) or not y(2, None)", Suite((Call('return', Call('or', Call('not', Call(Name('x'), Const(1), Const(None))), Call('not', Call(Name('y'), Const(2), Const(None))))),)))
check("not x(1, None) or not y(2, None) or not z(3, None)", Suite((Call('return', Call('or', Call('not', Call(Name('x'), Const(1), Const(None))), Call('or', Call('not', Call(Name('y'), Const(2), Const(None))), Call('not', Call(Name('z'), Const(3), Const(None)))))),)))
check("not x(1, None) or not y(2, None) or not z(3, None)", Suite((Call('return', Call('or', Call('not', Call(Name('x'), Const(1), Const(None))), Call('or', Call('not', Call(Name('y'), Const(2), Const(None))), Call('not', Call(Name('z'), Const(3), Const(None)))))),)))
check("not x(1, None) or not y(2, None) or not z(3, None)", Suite((Call('return', Call('or', Call('not', Call(Name('x'), Const(1), Const(None))), Call('or', Call('not', Call(Name('y'), Const(2), Const(None))), Call('not', Call(Name('z'), Const(3), Const(None)))))),)))
check("(not x(1, None) or not y(2, None), None) and not z(3, None)", Suite((Call('return', Call('and', Call('tuple', Call('or', Call('not', Call(Name('x'), Const(1), Const(None))), Call('not', Call(Name('y'), Const(2), Const(None)))), Const(None)), Call('not', Call(Name('z'), Const(3), Const(None))))),)))
check("not x(1, None) and (not y(2, None) or not z(3, None), None)", Suite((Call('return', Call('and', Call('not', Call(Name('x'), Const(1), Const(None))), Call('tuple', Call('or', Call('not', Call(Name('y'), Const(2), Const(None))), Call('not', Call(Name('z'), Const(3), Const(None)))), Const(None)))),)))

check("not x.a", Suite((Call('return', Call('not', Call('.', Name('x'), 'a'))),)))
check("not x.a and not y.b", Suite((Call('return', Call('and', Call('not', Call('.', Name('x'), 'a')), Call('not', Call('.', Name('y'), 'b')))),)))
check("not x.a and not y.b and not z.c", Suite((Call('return', Call('and', Call('not', Call('.', Name('x'), 'a')), Call('and', Call('not', Call('.', Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check("not x.a and not y.b and not z.c", Suite((Call('return', Call('and', Call('not', Call('.', Name('x'), 'a')), Call('and', Call('not', Call('.', Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check("not x.a and not y.b and not z.c", Suite((Call('return', Call('and', Call('not', Call('.', Name('x'), 'a')), Call('and', Call('not', Call('.', Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check("not x.a or not y.b", Suite((Call('return', Call('or', Call('not', Call('.', Name('x'), 'a')), Call('not', Call('.', Name('y'), 'b')))),)))
check("not x.a or not y.b or not z.c", Suite((Call('return', Call('or', Call('not', Call('.', Name('x'), 'a')), Call('or', Call('not', Call('.', Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check("not x.a or not y.b or not z.c", Suite((Call('return', Call('or', Call('not', Call('.', Name('x'), 'a')), Call('or', Call('not', Call('.', Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check("not x.a or not y.b or not z.c", Suite((Call('return', Call('or', Call('not', Call('.', Name('x'), 'a')), Call('or', Call('not', Call('.', Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check("(not x.a or not y.b, None) and not z.c", Suite((Call('return', Call('and', Call('tuple', Call('or', Call('not', Call('.', Name('x'), 'a')), Call('not', Call('.', Name('y'), 'b'))), Const(None)), Call('not', Call('.', Name('z'), 'c')))),)))
check("not x.a and (not y.b or not z.c, None)", Suite((Call('return', Call('and', Call('not', Call('.', Name('x'), 'a')), Call('tuple', Call('or', Call('not', Call('.', Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))), Const(None)))),)))

check('''False''', Suite((Call('return', Const(False)),)))
check('''True''', Suite((Call('return', Const(True)),)))
check('''not x''', Suite((Call('return', Call('not', Name('x'))),)))
check('''not x and not y''', Suite((Call('return', Call('and', Call('not', Name('x')), Call('not', Name('y')))),)))
check('''not x and not y and not z''', Suite((Call('return', Call('and', Call('not', Name('x')), Call('and', Call('not', Name('y')), Call('not', Name('z'))))),)))
check('''not x and not y and not z''', Suite((Call('return', Call('and', Call('not', Name('x')), Call('and', Call('not', Name('y')), Call('not', Name('z'))))),)))
check('''not x and not y and not z''', Suite((Call('return', Call('and', Call('not', Name('x')), Call('and', Call('not', Name('y')), Call('not', Name('z'))))),)))
check('''not x or not y''', Suite((Call('return', Call('or', Call('not', Name('x')), Call('not', Name('y')))),)))
check('''not x or not y or not z''', Suite((Call('return', Call('or', Call('not', Name('x')), Call('or', Call('not', Name('y')), Call('not', Name('z'))))),)))
check('''not x or not y or not z''', Suite((Call('return', Call('or', Call('not', Name('x')), Call('or', Call('not', Name('y')), Call('not', Name('z'))))),)))
check('''not x or not y or not z''', Suite((Call('return', Call('or', Call('not', Name('x')), Call('or', Call('not', Name('y')), Call('not', Name('z'))))),)))
check('''(not x or not y, None) and not z''', Suite((Call('return', Call('and', Call('tuple', Call('or', Call('not', Name('x')), Call('not', Name('y'))), Const(None)), Call('not', Name('z')))),)))
check('''not x and (not y or not z, None)''', Suite((Call('return', Call('and', Call('not', Name('x')), Call('tuple', Call('or', Call('not', Name('y')), Call('not', Name('z'))), Const(None)))),)))

check('''not x(1, None)''', Suite((Call('return', Call('not', Call(Name('x'), Const(1), Const(None)))),)))
check('''not x(1, None) and not y(2, None)''', Suite((Call('return', Call('and', Call('not', Call(Name('x'), Const(1), Const(None))), Call('not', Call(Name('y'), Const(2), Const(None))))),)))
check('''not x(1, None) and not y(2, None) and not z(3, None)''', Suite((Call('return', Call('and', Call('not', Call(Name('x'), Const(1), Const(None))), Call('and', Call('not', Call(Name('y'), Const(2), Const(None))), Call('not', Call(Name('z'), Const(3), Const(None)))))),)))
check('''not x(1, None) and not y(2, None) and not z(3, None)''', Suite((Call('return', Call('and', Call('not', Call(Name('x'), Const(1), Const(None))), Call('and', Call('not', Call(Name('y'), Const(2), Const(None))), Call('not', Call(Name('z'), Const(3), Const(None)))))),)))
check('''not x(1, None) and not y(2, None) and not z(3, None)''', Suite((Call('return', Call('and', Call('not', Call(Name('x'), Const(1), Const(None))), Call('and', Call('not', Call(Name('y'), Const(2), Const(None))), Call('not', Call(Name('z'), Const(3), Const(None)))))),)))
check('''not x(1, None) or not y(2, None)''', Suite((Call('return', Call('or', Call('not', Call(Name('x'), Const(1), Const(None))), Call('not', Call(Name('y'), Const(2), Const(None))))),)))
check('''not x(1, None) or not y(2, None) or not z(3, None)''', Suite((Call('return', Call('or', Call('not', Call(Name('x'), Const(1), Const(None))), Call('or', Call('not', Call(Name('y'), Const(2), Const(None))), Call('not', Call(Name('z'), Const(3), Const(None)))))),)))
check('''not x(1, None) or not y(2, None) or not z(3, None)''', Suite((Call('return', Call('or', Call('not', Call(Name('x'), Const(1), Const(None))), Call('or', Call('not', Call(Name('y'), Const(2), Const(None))), Call('not', Call(Name('z'), Const(3), Const(None)))))),)))
check('''not x(1, None) or not y(2, None) or not z(3, None)''', Suite((Call('return', Call('or', Call('not', Call(Name('x'), Const(1), Const(None))), Call('or', Call('not', Call(Name('y'), Const(2), Const(None))), Call('not', Call(Name('z'), Const(3), Const(None)))))),)))
check('''(not x(1, None) or not y(2, None), None) and not z(3, None)''', Suite((Call('return', Call('and', Call('tuple', Call('or', Call('not', Call(Name('x'), Const(1), Const(None))), Call('not', Call(Name('y'), Const(2), Const(None)))), Const(None)), Call('not', Call(Name('z'), Const(3), Const(None))))),)))
check('''not x(1, None) and (not y(2, None) or not z(3, None), None)''', Suite((Call('return', Call('and', Call('not', Call(Name('x'), Const(1), Const(None))), Call('tuple', Call('or', Call('not', Call(Name('y'), Const(2), Const(None))), Call('not', Call(Name('z'), Const(3), Const(None)))), Const(None)))),)))

check('''not x.a''', Suite((Call('return', Call('not', Call('.', Name('x'), 'a'))),)))
check('''not x.a and not y.b''', Suite((Call('return', Call('and', Call('not', Call('.', Name('x'), 'a')), Call('not', Call('.', Name('y'), 'b')))),)))
check('''not x.a and not y.b and not z.c''', Suite((Call('return', Call('and', Call('not', Call('.', Name('x'), 'a')), Call('and', Call('not', Call('.', Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check('''not x.a and not y.b and not z.c''', Suite((Call('return', Call('and', Call('not', Call('.', Name('x'), 'a')), Call('and', Call('not', Call('.', Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check('''not x.a and not y.b and not z.c''', Suite((Call('return', Call('and', Call('not', Call('.', Name('x'), 'a')), Call('and', Call('not', Call('.', Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check('''not x.a or not y.b''', Suite((Call('return', Call('or', Call('not', Call('.', Name('x'), 'a')), Call('not', Call('.', Name('y'), 'b')))),)))
check('''not x.a or not y.b or not z.c''', Suite((Call('return', Call('or', Call('not', Call('.', Name('x'), 'a')), Call('or', Call('not', Call('.', Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check('''not x.a or not y.b or not z.c''', Suite((Call('return', Call('or', Call('not', Call('.', Name('x'), 'a')), Call('or', Call('not', Call('.', Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check('''not x.a or not y.b or not z.c''', Suite((Call('return', Call('or', Call('not', Call('.', Name('x'), 'a')), Call('or', Call('not', Call('.', Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))))),)))
check('''(not x.a or not y.b, None) and not z.c''', Suite((Call('return', Call('and', Call('tuple', Call('or', Call('not', Call('.', Name('x'), 'a')), Call('not', Call('.', Name('y'), 'b'))), Const(None)), Call('not', Call('.', Name('z'), 'c')))),)))
check('''not x.a and (not y.b or not z.c, None)''', Suite((Call('return', Call('and', Call('not', Call('.', Name('x'), 'a')), Call('tuple', Call('or', Call('not', Call('.', Name('y'), 'b')), Call('not', Call('.', Name('z'), 'c'))), Const(None)))),)))

check('''x != y''', Suite((Call('return', Call('!=', Name('x'), Name('y'))),)))
check('''x == y''', Suite((Call('return', Call('==', Name('x'), Name('y'))),)))
check('''x <= y''', Suite((Call('return', Call('<=', Name('x'), Name('y'))),)))
check('''x > y''', Suite((Call('return', Call('>', Name('x'), Name('y'))),)))
check('''x >= y''', Suite((Call('return', Call('>=', Name('x'), Name('y'))),)))
check('''x < y''', Suite((Call('return', Call('<', Name('x'), Name('y'))),)))
check('''x not in y''', Suite((Call('return', Call('not-in', Name('x'), Name('y'))),)))
check('''x in y''', Suite((Call('return', Call('in', Name('x'), Name('y'))),)))

check('''x == y and y == z''', Suite((Call('return', Call('and', Call('==', Name('x'), Name('y')), Call('==', Name('y'), Name('z')))),)))
check('''x == y and y == z''', Suite((Call('return', Call('and', Call('==', Name('x'), Name('y')), Call('==', Name('y'), Name('z')))),)))
check('''x == y or y == z''', Suite((Call('return', Call('or', Call('==', Name('x'), Name('y')), Call('==', Name('y'), Name('z')))),)))
check('''x != y or y != z''', Suite((Call('return', Call('or', Call('!=', Name('x'), Name('y')), Call('!=', Name('y'), Name('z')))),)))
check('''x != y or y != z''', Suite((Call('return', Call('or', Call('!=', Name('x'), Name('y')), Call('!=', Name('y'), Name('z')))),)))
check('''x != y or y == z''', Suite((Call('return', Call('or', Call('!=', Name('x'), Name('y')), Call('==', Name('y'), Name('z')))),)))

check('''a and b and c and d and e''', Suite((Call('return', Call('and', Name('a'), Call('and', Name('b'), Call('and', Name('c'), Call('and', Name('d'), Name('e')))))),)))
check('''a and b and c and d and e''', Suite((Call('return', Call('and', Name('a'), Call('and', Name('b'), Call('and', Name('c'), Call('and', Name('d'), Name('e')))))),)))

check("def g(x): return 3.14", Suite((Assign((Name('g'),), Def(('x',), (), Suite((Call('return', Const(3.14)),)))), Call('return', Const(None)),)))
check("""def g(x):
    return 3.14""", Suite((Assign((Name('g'),), Def(('x',), (), Suite((Call('return', Const(3.14)),)))), Call('return', Const(None)),)))
check("def g(x, y): return x**2", Suite((Assign((Name('g'),), Def(('x', 'y'), (), Suite((Call('return', Call('**', Name('x'), Const(2))),)))), Call('return', Const(None)),)))
check("""def g(x, y):
    return x**2""", Suite((Assign((Name('g'),), Def(('x', 'y'), (), Suite((Call('return', Call('**', Name('x'), Const(2))),)))), Call('return', Const(None)),)))
check("lambda: 3.14", Suite((Call('return', Def((), (), Suite((Call('return', Const(3.14)),)))),)))
check("lambda x: x**2", Suite((Call('return', Def(('x',), (), Suite((Call('return', Call('**', Name('x'), Const(2))),)))),)))
check("(lambda x: x**2, None)", Suite((Call('return', Call('tuple', Def(('x',), (), Suite((Call('return', Call('**', Name('x'), Const(2))),))), Const(None))),)))

check("1 if x == 0 else 2", Suite((Call('if', Call('==', Name('x'), Const(0)), Suite((Call('return', Const(1)),)), Suite((Call('return', Const(2)),))),)))
check("y = (1 if x == 0 else 2, None)", Suite((Assign((Name('y'),), Call('tuple', Call('?', Call('==', Name('x'), Const(0)), Const(1), Const(2)), Const(None))), Call('return', Const(None)),)))
check("1 if x == 0 else None", Suite((Call('if', Call('==', Name('x'), Const(0)), Suite((Call('return', Const(1)),)), Suite((Call('return', Const(None)),))),)))
check("(1 if x == 0 else 2, None)", Suite((Call('return', Call('tuple', Call('?', Call('==', Name('x'), Const(0)), Const(1), Const(2)), Const(None))),)))
check("(1 if x == 0 else None, None)", Suite((Call('return', Call('tuple', Call('?', Call('==', Name('x'), Const(0)), Const(1), Const(None)), Const(None))),)))
check("""if x == 0:
    return 1""", Suite((Call('if', Call('==', Name('x'), Const(0)), Suite((Call('return', Const(1)),)), Suite((Call('return', Const(None)),))),)))
check("""if x == 0:
    y = 1
    return 1""", Suite((Call('if', Call('==', Name('x'), Const(0)), Suite((Assign((Name('y'),), Const(1)), Call('return', Const(1)),)), Suite((Call('return', Const(None)),))),)))
check('''if x == 0:
    return 1
else:
    return 2''', Suite((Call('if', Call('==', Name('x'), Const(0)), Suite((Call('return', Const(1)),)), Suite((Call('return', Const(2)),))),)))
check('''if x == 0:
    y = 1
    return 1
else:
    y = 2
    return 2''', Suite((Call('if', Call('==', Name('x'), Const(0)), Suite((Assign((Name('y'),), Const(1)), Call('return', Const(1)),)), Suite((Assign((Name('y'),), Const(2)), Call("return", Const(2))))),)))
check('''if x == 0:
    return 1
elif x == 1:
    return 2
else:
    return 3''', Suite((Call('if', Call('==', Name('x'), Const(0)), Suite((Call('return', Const(1)),)), Suite((Call('if', Call('==', Name('x'), Const(1)), Suite((Call('return', Const(2)),)), Suite((Call('return', Const(3)),))),))),)))

check('''if x == 0:
    y = 1
    return 1
elif x == 1:
    y = 2
    return 2
else:
    y = 3
    return 3''', Suite((Call('if', Call('==', Name('x'), Const(0)), Suite((Assign((Name('y'),), Const(1)), Call('return', Const(1)),)), Suite((Call('if', Call('==', Name('x'), Const(1)), Suite((Assign((Name('y'),), Const(2)), Call('return', Const(2)),)), Suite((Assign((Name('y'),), Const(3)), Call("return", Const(3))))),))),)))
check('''if x == 0:
    y = 1''', Suite((Call('if', Call('==', Name('x'), Const(0)), Suite((Assign((Name('y'),), Const(1)),))), Call('return', Const(None)),)))
check('''if x == 0:
    y = 1
    z = 1''', Suite((Call('if', Call('==', Name('x'), Const(0)), Suite((Assign((Name('y'),), Const(1)), Assign((Name('z'),), Const(1)),))), Call('return', Const(None)),)))
check('''if x == 0:
    y = 1
else:
    y = 2''', Suite((Call('if', Call('==', Name('x'), Const(0)), Suite((Assign((Name('y'),), Const(1)),)), Suite((Assign((Name('y'),), Const(2)),))), Call('return', Const(None)),)))
check('''if x == 0:
    y = 1
    z = 1
else:
    y = 2
    z = 2''', Suite((Call('if', Call('==', Name('x'), Const(0)), Suite((Assign((Name('y'),), Const(1)), Assign((Name('z'),), Const(1)),)), Suite((Assign((Name('y'),), Const(2)), Assign((Name('z'),), Const(2)),))), Call('return', Const(None)),)))

# check("print(None)", Suite((Call('return', Call(Name('print'), Const(None))),)))
# check("print(1, None)", Suite((Call('return', Call(Name('print'), Const(1), Const(None))),)))
# check("print(1, 2, 3, None)", Suite((Call('return', Call(Name('print'), Const(1), Const(2), Const(3), Const(None))),)))

check("[]", Suite((Call('return', Call('list')),)))
check("[1]", Suite((Call('return', Call('list', Const(1))),)))
check("[1, 2]", Suite((Call('return', Call('list', Const(1), Const(2))),)))
check("[one]", Suite((Call('return', Call('list', Name('one'))),)))
check("[one, two]", Suite((Call('return', Call('list', Name('one'), Name('two'))),)))
check("['one']", Suite((Call('return', Call('list', Const('one'))),)))
check("['one', 'two']", Suite((Call('return', Call('list', Const('one'), Const('two'))),)))
check("set([])", Suite((Call('return', Call(Name('set'), Call('list'))),)))
check("set([1])", Suite((Call('return', Call(Name('set'), Call('list', Const(1)))),)))
check("set([1, 2])", Suite((Call('return', Call(Name('set'), Call('list', Const(1), Const(2)))),)))
check("set([one])", Suite((Call('return', Call(Name('set'), Call('list', Name('one')))),)))
check("set([one, two])", Suite((Call('return', Call(Name('set'), Call('list', Name('one'), Name('two')))),)))
check("set(['one'])", Suite((Call('return', Call(Name('set'), Call('list', Const('one')))),)))
check("set(['one', 'two'])", Suite((Call('return', Call(Name('set'), Call('list', Const('one'), Const('two')))),)))
check("{}", Suite((Call('return', Call('dict')),)))
check("{1}", Suite((Call('return', Call('set', Const(1))),)))
check("{1, 2}", Suite((Call('return', Call('set', Const(1), Const(2))),)))
check("{one}", Suite((Call('return', Call('set', Name('one'))),)))
check("{one, two}", Suite((Call('return', Call('set', Name('one'), Name('two'))),)))
check("{'one'}", Suite((Call('return', Call('set', Const('one'))),)))
check("{'one', 'two'}", Suite((Call('return', Call('set', Const('one'), Const('two'))),)))
check("{'x': 1}", Suite((Call('return', Call('dict', Const('x'), Const(1))),)))
check("{'x': 1, 'y': 2}", Suite((Call('return', Call('dict', Const('x'), Const(1), Const('y'), Const(2))),)))
check("{'x': 1, 'y': 2, 'z': 3}", Suite((Call('return', Call('dict', Const('x'), Const(1), Const('y'), Const(2), Const('z'), Const(3))),)))
check("{'x': one}", Suite((Call('return', Call('dict', Const('x'), Name('one'))),)))
check("{'x': one, 'y': two}", Suite((Call('return', Call('dict', Const('x'), Name('one'), Const('y'), Name('two'))),)))
check("{'x': one, 'y': two, 'z': three}", Suite((Call('return', Call('dict', Const('x'), Name('one'), Const('y'), Name('two'), Const('z'), Name('three'))),)))
check("{1: 1}", Suite((Call('return', Call('dict', Const(1), Const(1))),)))
check("{1: 1, 2: 2}", Suite((Call('return', Call('dict', Const(1), Const(1), Const(2), Const(2))),)))
check("{1: 1, 2: 2, 3: 3}", Suite((Call('return', Call('dict', Const(1), Const(1), Const(2), Const(2), Const(3), Const(3))),)))
check("{1: one}", Suite((Call('return', Call('dict', Const(1), Name('one'))),)))
check("{1: one, 2: two}", Suite((Call('return', Call('dict', Const(1), Name('one'), Const(2), Name('two'))),)))
check("{1: one, 2: two, 3: three}", Suite((Call('return', Call('dict', Const(1), Name('one'), Const(2), Name('two'), Const(3), Name('three'))),)))
check("{one: 1}", Suite((Call('return', Call('dict', Name('one'), Const(1))),)))
check("{one: 1, two: 2}", Suite((Call('return', Call('dict', Name('one'), Const(1), Name('two'), Const(2))),)))
check("{one: 1, two: 2, three: 3}", Suite((Call('return', Call('dict', Name('one'), Const(1), Name('two'), Const(2), Name('three'), Const(3))),)))
check("{one: one}", Suite((Call('return', Call('dict', Name('one'), Name('one'))),)))
check("{one: one, two: two}", Suite((Call('return', Call('dict', Name('one'), Name('one'), Name('two'), Name('two'))),)))
check("{one: one, two: two, three: three}", Suite((Call('return', Call('dict', Name('one'), Name('one'), Name('two'), Name('two'), Name('three'), Name('three'))),)))

check("[x**2 for x in something]", Suite((Call('return', Call(Call('.', Name('something'), 'map'), Def(('x',), (), Suite((Call('return', Call('**', Name('x'), Const(2))),))))),)))
check("[x**2 for x in something if x > 0]", Suite((Call('return', Call(Call('.', Call(Call('.', Name('something'), 'filter'), Def(('x',), (), Suite((Call('return', Call('>', Name('x'), Const(0))),)))), 'map'), Def(('x',), (), Suite((Call('return', Call('**', Name('x'), Const(2))),))))),)))
check("[y**2 for x in something for y in x]", Suite((Call('return', Call(Call('.', Name('something'), 'map'), Def(('x',), (), Suite((Call('return', Call(Call('.', Name('x'), 'map'), Def(('y',), (), Suite((Call('return', Call('**', Name('y'), Const(2))),))))),))))),)))
check("[y**2 for x in something for y in x if x > 0]", Suite((Call('return', Call(Call('.', Name('something'), 'map'), Def(('x',), (), Suite((Call('return', Call(Call('.', Call(Call('.', Name('x'), 'filter'), Def(('y',), (), Suite((Call('return', Call('>', Name('x'), Const(0))),)))), 'map'), Def(('y',), (), Suite((Call('return', Call('**', Name('y'), Const(2))),))))),))))),)))
check("[y**2 for x in something for y in x if y > 0]", Suite((Call('return', Call(Call('.', Name('something'), 'map'), Def(('x',), (), Suite((Call('return', Call(Call('.', Call(Call('.', Name('x'), 'filter'), Def(('y',), (), Suite((Call('return', Call('>', Name('y'), Const(0))),)))), 'map'), Def(('y',), (), Suite((Call('return', Call('**', Name('y'), Const(2))),))))),))))),)))
check("[y**2 for x in something if x for y in x if x > 0]", Suite((Call('return', Call(Call('.', Call(Call('.', Name('something'), 'filter'), Def(('x',), (), Suite((Call('return', Name('x')),)))), 'map'), Def(('x',), (), Suite((Call('return', Call(Call('.', Call(Call('.', Name('x'), 'filter'), Def(('y',), (), Suite((Call('return', Call('>', Name('x'), Const(0))),)))), 'map'), Def(('y',), (), Suite((Call('return', Call('**', Name('y'), Const(2))),))))),))))),)))

check("f([x**2 for x in something], None)", Suite((Call('return', Call(Name('f'), Call(Call('.', Name('something'), 'map'), Def(('x',), (), Suite((Call('return', Call('**', Name('x'), Const(2))),)))), Const(None))),)))
check("f([x**2 for x in something if x > 0], None)", Suite((Call('return', Call(Name('f'), Call(Call('.', Call(Call('.', Name('something'), 'filter'), Def(('x',), (), Suite((Call('return', Call('>', Name('x'), Const(0))),)))), 'map'), Def(('x',), (), Suite((Call('return', Call('**', Name('x'), Const(2))),)))), Const(None))),)))
check("f([y**2 for x in something for y in x], None)", Suite((Call('return', Call(Name('f'), Call(Call('.', Name('something'), 'map'), Def(('x',), (), Suite((Call('return', Call(Call('.', Name('x'), 'map'), Def(('y',), (), Suite((Call('return', Call('**', Name('y'), Const(2))),))))),)))), Const(None))),)))
check("f([y**2 for x in something for y in x if x > 0], None)", Suite((Call('return', Call(Name('f'), Call(Call('.', Name('something'), 'map'), Def(('x',), (), Suite((Call('return', Call(Call('.', Call(Call('.', Name('x'), 'filter'), Def(('y',), (), Suite((Call('return', Call('>', Name('x'), Const(0))),)))), 'map'), Def(('y',), (), Suite((Call('return', Call('**', Name('y'), Const(2))),))))),)))), Const(None))),)))
check("f([y**2 for x in something for y in x if y > 0], None)", Suite((Call('return', Call(Name('f'), Call(Call('.', Name('something'), 'map'), Def(('x',), (), Suite((Call('return', Call(Call('.', Call(Call('.', Name('x'), 'filter'), Def(('y',), (), Suite((Call('return', Call('>', Name('y'), Const(0))),)))), 'map'), Def(('y',), (), Suite((Call('return', Call('**', Name('y'), Const(2))),))))),)))), Const(None))),)))
check("f([y**2 for x in something if x for y in x if x > 0], None)", Suite((Call('return', Call(Name('f'), Call(Call('.', Call(Call('.', Name('something'), 'filter'), Def(('x',), (), Suite((Call('return', Name('x')),)))), 'map'), Def(('x',), (), Suite((Call('return', Call(Call('.', Call(Call('.', Name('x'), 'filter'), Def(('y',), (), Suite((Call('return', Call('>', Name('x'), Const(0))),)))), 'map'), Def(('y',), (), Suite((Call('return', Call('**', Name('y'), Const(2))),))))),)))), Const(None))),)))

check("f((x**2 for x in something), None)", Suite((Call('return', Call(Name('f'), Call(Call('.', Name('something'), 'map'), Def(('x',), (), Suite((Call('return', Call('**', Name('x'), Const(2))),)))), Const(None))),)))
check("f((x**2 for x in something if x > 0), None)", Suite((Call('return', Call(Name('f'), Call(Call('.', Call(Call('.', Name('something'), 'filter'), Def(('x',), (), Suite((Call('return', Call('>', Name('x'), Const(0))),)))), 'map'), Def(('x',), (), Suite((Call('return', Call('**', Name('x'), Const(2))),)))), Const(None))),)))
check("f((y**2 for x in something for y in x), None)", Suite((Call('return', Call(Name('f'), Call(Call('.', Name('something'), 'map'), Def(('x',), (), Suite((Call('return', Call(Call('.', Name('x'), 'map'), Def(('y',), (), Suite((Call('return', Call('**', Name('y'), Const(2))),))))),)))), Const(None))),)))
check("f((y**2 for x in something for y in x if x > 0), None)", Suite((Call('return', Call(Name('f'), Call(Call('.', Name('something'), 'map'), Def(('x',), (), Suite((Call('return', Call(Call('.', Call(Call('.', Name('x'), 'filter'), Def(('y',), (), Suite((Call('return', Call('>', Name('x'), Const(0))),)))), 'map'), Def(('y',), (), Suite((Call('return', Call('**', Name('y'), Const(2))),))))),)))), Const(None))),)))
check("f((y**2 for x in something for y in x if y > 0), None)", Suite((Call('return', Call(Name('f'), Call(Call('.', Name('something'), 'map'), Def(('x',), (), Suite((Call('return', Call(Call('.', Call(Call('.', Name('x'), 'filter'), Def(('y',), (), Suite((Call('return', Call('>', Name('y'), Const(0))),)))), 'map'), Def(('y',), (), Suite((Call('return', Call('**', Name('y'), Const(2))),))))),)))), Const(None))),)))
check("f((y**2 for x in something if x for y in x if x > 0), None)", Suite((Call('return', Call(Name('f'), Call(Call('.', Call(Call('.', Name('something'), 'filter'), Def(('x',), (), Suite((Call('return', Name('x')),)))), 'map'), Def(('x',), (), Suite((Call('return', Call(Call('.', Call(Call('.', Name('x'), 'filter'), Def(('y',), (), Suite((Call('return', Call('>', Name('x'), Const(0))),)))), 'map'), Def(('y',), (), Suite((Call('return', Call('**', Name('y'), Const(2))),))))),)))), Const(None))),)))

check("f(one=1)", Suite((Call('return', CallKeyword(Name('f'), (), (('one', Const(1)),))),)))
check("f(one=1, two=2)", Suite((Call('return', CallKeyword(Name('f'), (), (('one', Const(1)), ('two', Const(2))))),)))
check("f(x, one=1)", Suite((Call('return', CallKeyword(Name('f'), (Name('x'),), (('one', Const(1)),))),)))
check("f(x, one=1, two=2)", Suite((Call('return', CallKeyword(Name('f'), (Name('x'),), (('one', Const(1)), ('two', Const(2))))),)))

check("x[..., :]", Suite((Call('return', Call('[.]', Name('x'), Const(Ellipsis), Call('slice', Const(None), Const(None), Const(None)))),)))

check('x = y = 1', Suite((Assign((Name('x'), Name('y')), Const(1)), Call('return', Const(None)),)))
check('x = y = z = 1', Suite((Assign((Name('x'), Name('y'), Name('z')), Const(1)), Call('return', Const(None)),)))
check('x, y = 1', Suite((Assign((Unpack((Name('x'), Name('y'))),), Const(1)), Call('return', Const(None)),)))
check('x, y = z = 1', Suite((Assign((Unpack((Name('x'), Name('y'))), Name('z')), Const(1)), Call('return', Const(None)),)))
check('x = y, z = 1', Suite((Assign((Name('x'), Unpack((Name('y'), Name('z')))), Const(1)), Call('return', Const(None)),)))

check('x.a = y = 1', Suite((Assign((Call('.', Name('x'), 'a'), Name('y'),), Const(1)), Call('return', Const(None)),)))
check('x.a = y = z = 1', Suite((Assign((Call('.', Name('x'), 'a'), Name('y'), Name('z'),), Const(1)), Call('return', Const(None)),)))
check('x.a, y = 1', Suite((Assign((Unpack((Call('.', Name('x'), 'a'), Name('y'))),), Const(1)), Call('return', Const(None)),)))
check('x.a, y = z = 1', Suite((Assign((Unpack((Call('.', Name('x'), 'a'), Name('y'))), Name('z')), Const(1)), Call('return', Const(None)),)))
check('x.a = y, z = 1', Suite((Assign((Call('.', Name('x'), 'a'), Unpack((Name('y'), Name('z')))), Const(1)), Call('return', Const(None)),)))

check('x = y.a = 1', Suite((Assign((Name('x'), Call('.', Name('y'), 'a'),), Const(1)), Call('return', Const(None)),)))
check('x = y.a = z = 1', Suite((Assign((Name('x'), Call('.', Name('y'), 'a'), Name('z')), Const(1)), Call('return', Const(None)),)))
check('x, y.a = 1', Suite((Assign((Unpack((Name('x'), Call('.', Name('y'), 'a'))),), Const(1)), Call('return', Const(None)),)))
check('x, y.a = z = 1', Suite((Assign((Unpack((Name('x'), Call('.', Name('y'), 'a'))), Name('z')), Const(1)), Call('return', Const(None)),)))
check('x = y.a, z = 1', Suite((Assign((Name('x'), Unpack((Call('.', Name('y'), 'a'), Name('z')))), Const(1)), Call('return', Const(None)),)))

check('x = y = z.a = 1', Suite((Assign((Name('x'), Name('y'), Call('.', Name('z'), 'a'),), Const(1)), Call('return', Const(None)),)))
check('x, y = z.a = 1', Suite((Assign((Unpack((Name('x'), Name('y'))), Call('.', Name('z'), 'a'),), Const(1)), Call('return', Const(None)),)))
check('x = y, z.a = 1', Suite((Assign((Name('x'), Unpack((Name('y'), Call('.', Name('z'), 'a'))),), Const(1)), Call('return', Const(None)),)))

check('x[0] = y = 1', Suite((Assign((Call('[.]', Name('x'), Const(0)), Name('y'),), Const(1)), Call('return', Const(None)),)))
check('x[0] = y = z = 1', Suite((Assign((Call('[.]', Name('x'), Const(0)), Name('y'), Name('z')), Const(1)), Call('return', Const(None)),)))
check('x[0], y = 1', Suite((Assign((Unpack((Call('[.]', Name('x'), Const(0)), Name('y'),)),), Const(1)), Call('return', Const(None)),)))
check('x[0], y = z = 1', Suite((Assign((Unpack((Call('[.]', Name('x'), Const(0)), Name('y'))), Name('z')), Const(1)), Call('return', Const(None)),)))
check('x[0] = y, z = 1', Suite((Assign((Call('[.]', Name('x'), Const(0)), Unpack((Name('y'), Name('z')))), Const(1)), Call('return', Const(None)),)))

check('x = y[0] = 1', Suite((Assign((Name('x'), Call('[.]', Name('y'), Const(0)),), Const(1)), Call('return', Const(None)),)))
check('x = y[0] = z = 1', Suite((Assign((Name('x'), Call('[.]', Name('y'), Const(0)), Name('z')), Const(1)), Call('return', Const(None)),)))
check('x, y[0] = 1', Suite((Assign((Unpack((Name('x'), Call('[.]', Name('y'), Const(0)))),), Const(1)), Call('return', Const(None)),)))
check('x, y[0] = z = 1', Suite((Assign((Unpack((Name('x'), Call('[.]', Name('y'), Const(0)))), Name('z')), Const(1)), Call('return', Const(None)),)))
check('x = y[0], z = 1', Suite((Assign((Name('x'), Unpack((Call('[.]', Name('y'), Const(0)), Name('z')))), Const(1)), Call('return', Const(None)),)))

check('x = y = z[0] = 1', Suite((Assign((Name('x'), Name('y'), Call('[.]', Name('z'), Const(0)),), Const(1)), Call('return', Const(None)),)))
check('x, y = z[0] = 1', Suite((Assign((Unpack((Name('x'), Name('y'))), Call('[.]', Name('z'), Const(0)),), Const(1)), Call('return', Const(None)),)))
check('x = y, z[0] = 1', Suite((Assign((Name('x'), Unpack((Name('y'), Call('[.]', Name('z'), Const(0)))),), Const(1)), Call('return', Const(None)),)))

check('x[:, ...] = y = 1', Suite((Assign((Call('[.]', Name('x'), Call('slice', Const(None), Const(None), Const(None)), Const(Ellipsis)), Name('y'),), Const(1)), Call('return', Const(None)),)))
check('x[:, ...] = y = z = 1', Suite((Assign((Call('[.]', Name('x'), Call('slice', Const(None), Const(None), Const(None)), Const(Ellipsis)), Name('y'), Name('z')), Const(1)), Call('return', Const(None)),)))
check('x[:, ...], y = 1', Suite((Assign((Unpack((Call('[.]', Name('x'), Call('slice', Const(None), Const(None), Const(None)), Const(Ellipsis)), Name('y'))),), Const(1)), Call('return', Const(None)),)))
check('x[:, ...], y = z = 1', Suite((Assign((Unpack((Call('[.]', Name('x'), Call('slice', Const(None), Const(None), Const(None)), Const(Ellipsis)), Name('y'))), Name('z')), Const(1)), Call('return', Const(None)),)))
check('x[:, ...] = y, z = 1', Suite((Assign((Call('[.]', Name('x'), Call('slice', Const(None), Const(None), Const(None)), Const(Ellipsis)), Unpack((Name('y'), Name('z')))), Const(1)), Call('return', Const(None)),)))

check('x = y[:, ...] = 1', Suite((Assign((Name('x'), Call('[.]', Name('y'), Call('slice', Const(None), Const(None), Const(None)), Const(Ellipsis)),), Const(1)), Call('return', Const(None)),)))
check('x = y[:, ...] = z = 1', Suite((Assign((Name('x'), Call('[.]', Name('y'), Call('slice', Const(None), Const(None), Const(None)), Const(Ellipsis)), Name('z')), Const(1)), Call('return', Const(None)),)))
check('x, y[:, ...] = 1', Suite((Assign((Unpack((Name('x'), Call('[.]', Name('y'), Call('slice', Const(None), Const(None), Const(None)), Const(Ellipsis)))),), Const(1)), Call('return', Const(None)),)))
check('x, y[:, ...] = z = 1', Suite((Assign((Unpack((Name('x'), Call('[.]', Name('y'), Call('slice', Const(None), Const(None), Const(None)), Const(Ellipsis)))), Name('z')), Const(1)), Call('return', Const(None)),)))
check('x = y[:, ...], z = 1', Suite((Assign((Name('x'), Unpack((Call('[.]', Name('y'), Call('slice', Const(None), Const(None), Const(None)), Const(Ellipsis)), Name('z')))), Const(1)), Call('return', Const(None)),)))

check('x = y = z[:, ...] = 1', Suite((Assign((Name('x'), Name('y'), Call('[.]', Name('z'), Call('slice', Const(None), Const(None), Const(None)), Const(Ellipsis)),), Const(1)), Call('return', Const(None)),)))
check('x, y = z[:, ...] = 1', Suite((Assign((Unpack((Name('x'), Name('y'))), Call('[.]', Name('z'), Call('slice', Const(None), Const(None), Const(None)), Const(Ellipsis)),), Const(1)), Call('return', Const(None)),)))
check('x = y, z[:, ...] = 1', Suite((Assign((Name('x'), Unpack((Name('y'), Call('[.]', Name('z'), Call('slice', Const(None), Const(None), Const(None)), Const(Ellipsis)))),), Const(1)), Call('return', Const(None)),)))
