def get_time(size, which_build, n=100):
    setup = s + 'l = build_{}({});'.format(which_build, size)
ans = timeit.Timer(setup=setup, stmt='z=list(flatten(l))').timeit(n)
return ans
print(('length', 'none', 'some', 'lots'))
Python 3.3's yield from