import itertools


def flatten(lol):
    """
    See http://stackoverflow.com/questions/406121/flattening-a-shallow-list-in-python

    e.g. [['image00', 'image01'], ['image10'], []] -> ['image00', 'image01', 'image10']
    """

    chain = list(itertools.chain(*lol))
    return chain