def which_opposite(vec):
    """
    find the True from the index 0 with bool vector vec
    ----------------------------------------------------------------------
    Input:
    vec        : vector of bool
    ----------------------------------------------------------------------
    Output:
    index of the last True from the bool vector vec
    ----------------------------------------------------------------------
    """
    for i in reversed(range(len(vec))):
        item = vec[i]
        if item:
            return i
    return -1
