def flatten(filenames):
    """Takes a list which may contain other lists and returns a single,
    flattened list
    Args:
        filenames (list): list of filenames
    Returns:
        flattened list of filenames
    """

    flat_filenames = [file for i in filenames for file in i]

    return flat_filenames