y n : int Length of the array being indexed. Raises ------ ValueError Examples -------- >>> validate_indices(np.array([1, 2]), 3) # OK >>> validate_indices(np.array([1, -2]), 3) Traceback (most recent call last): ... ValueError: negative dimensions are not allowed >>> validate_indices(np.array([1, 2, 3]), 3) Traceback (most recent call last): ... IndexError: indices are out-of-bounds >>> validate_indices(np.array([-1, -1]), 0) # OK >>> validate_indices(np.array([0, 1]), 0) Traceback (most recent call last): ... IndexError: indices are out-of-bounds é