def test1(a, b=2, c=3):
    return a + c

def test2(a, **kw):
    for k, v in kw.items():
        print k, v

def test3(find, zfill, a):
    from string import *
    return zfill(a, 10)

def test4(((a, b), c), x, (d, (e, f)), y, z):
    return a + b * c - d / e + f

def test5(a=1, *rest):
    print rest
    return map(lambda x, a=a: x + a, rest)

def test():
    print test1(2)
    print test2('a', b='c', c='d', abc='42')
    print test3(None, Ellipsis, "365")
    print test4(((10, 6), 2), 0, (6, (3, 22)), 0, 0)
    print test5()
    print test5(2, 0, 1, 2)
    # Some extended call tests.
    args = 0, (6, (3,22))
    kwargs = {'y':0, 'z':0}
    print test4( ((10,6), 2), *args, **kwargs)
    # Ensure kw args can come before the extended syntax.
    print test4( ((10,6), 2), y=0,z=0, *args)
    kwargs = {'a':1, 'c':4}
    print test1( **kwargs )

    print test5( *(2, 0, 1, 2) )
    print test5( 2, *(0, 1, 2) )

test()

