def unpad_list(listA, val=-1):
    """Unpad list of lists with which has values equal to 'val'.

    Parameters
    ----------
    listA : list
        List of lists of equal sizes.
    val : number, optional
        Value to unpad the lists.

    Returns
    -------
    list
        A list of lists without the padding values.

    Examples
    --------
    Remove the padding values of a list of lists.

    >>> from dbcollection.utils.pad import unpad_list
    >>> unpad_list([[1,2,3,-1,-1],[5,6,-1,-1,-1]])
    [[1, 2, 3], [5, 6]]
    >>> unpad_list([[5,0,-1],[1,2,3,4,5]], 5)
    [[0, -1], [1, 2, 3, 4]]

    """
    # pad list with zeros in order to have all lists of the same size
    assert isinstance(listA, list), 'Input must be a list. Got {}, expected {}' \
                                    .format(type(listA), type(list))

    if isinstance(listA[0], list):
        return [list(filter(lambda x: x != val, l)) for i, l in enumerate(listA)]
    else:
        return list(filter(lambda x: x != val, listA))