def _invert_indices(arr, range_max):
    """calculate all indices from range(range_max) that are not in arr
    
    Args:
        arr (list-like): array.
    
    Returns:
        list: list of complementary indices.
    """
    inv = []
    for j in range(range_max):
        if j not in arr:
            inv.append(j)
    return inv