def flatten(x):
    if isinstance(x[0], list):
        return list(toolz.concat(map(flatten, x)))
    else:
        return x
>>> flatten([[1]])
dataset/ETHPy150Open blaze/blaze/blaze/partition.py/flatten