parameters: (indices: np.ndarray, n: int)
docstring: Perform bounds-checking for an indexer.
  
      -1 is allowed for indicating missing values.
  
      Parameters
      ----------
      indices : ndarray
      n : int
          Length of the array being indexed.
  
      Raises
      ------
      ValueError
  
      Examples
      --------
      >>> validate_indices([1, 2], 3)
      # OK
      >>> validate_indices([1, -2], 3)
      ValueError
      >>> validate_indices([1, 2, 3], 3)
      IndexError
      >>> validate_indices([-1, -1], 0)
      # OK
      >>> validate_indices([0, 1], 0)
      IndexError
docstring_summary: Perform bounds-checking for an indexer.
docstring_tokens: Perform bounds - checking for an indexer .
function: def validate_indices(indices: np.ndarray, n: int) -> None:
      """
      Perform bounds-checking for an indexer.
  
      -1 is allowed for indicating missing values.
  
      Parameters
      ----------
      indices : ndarray
      n : int
          Length of the array being indexed.
  
      Raises
      ------
      ValueError
  
      Examples
      --------
      >>> validate_indices([1, 2], 3)
      # OK
      >>> validate_indices([1, -2], 3)
      ValueError
      >>> validate_indices([1, 2, 3], 3)
      IndexError
      >>> validate_indices([-1, -1], 0)
      # OK
      >>> validate_indices([0, 1], 0)
      IndexError
      """
      if len(indices):
          min_idx = indices.min()
          if min_idx < -1:
              msg = f"'indices' contains values less than allowed ({min_idx} < -1)"
              raise ValueError(msg)
  
          max_idx = indices.max()
          if max_idx >= n:
              raise IndexError("indices are out-of-bounds")
function_tokens: def validate_indices ( indices : np . ndarray , n : int ) -> None : if len ( indices ) : min_idx = indices . min ( ) if min_idx < - 1 : msg = f"'indices' contains values less than allowed ({min_idx} < -1)" raise ValueError ( msg ) max_idx = indices . max ( ) if max_idx >= n : raise IndexError ( "indices are out-of-bounds" )