def list_strip(seq):
    """Remove None and '' on both sides

    Args:
        seq (list or tuple): list to remove None and ''

    Returns:
        list: trimmed list

    """
    if not type(seq) in [list, tuple]:
        raise TypeError

    if type(seq) is tuple:
        temp = list(seq)
    else:
        temp = seq[0:]  # copy

    while temp:  # forward
        if temp[0] is None or temp[0] == '':
            temp.pop(0)
        else:
            break

    while temp:  # backward
        if temp[-1] is None or temp[-1] == '':
            temp.pop()
        else:
            break

    return temp