from functools import reduce


def flattenlist(alist):
    """Remove empty lists/values and flatten the list

    :param alist: list or list of lists
    :return: flatten list
    """

    alist = filter(None, alist)
    return reduce(lambda x, y: x + y, alist, [])