parameters: (indices, n: int)
return_statement: return indices
docstring: Attempt to convert indices into valid, positive indices.
  
      If we have negative indices, translate to positive here.
      If we have indices that are out-of-bounds, raise an IndexError.
  
      Parameters
      ----------
      indices : array-like
          Array of indices that we are to convert.
      n : int
          Number of elements in the array that we are indexing.
  
      Returns
      -------
      array-like
          An array-like of positive indices that correspond to the ones
          that were passed in initially to this function.
  
      Raises
      ------
      IndexError
          One of the converted indices either exceeded the number of,
          elements (specified by `n`), or was still negative.
docstring_summary: Attempt to convert indices into valid, positive indices.
docstring_tokens: Attempt to convert indices into valid positive indices .
function: def maybe_convert_indices(indices, n: int):
      """
      Attempt to convert indices into valid, positive indices.
  
      If we have negative indices, translate to positive here.
      If we have indices that are out-of-bounds, raise an IndexError.
  
      Parameters
      ----------
      indices : array-like
          Array of indices that we are to convert.
      n : int
          Number of elements in the array that we are indexing.
  
      Returns
      -------
      array-like
          An array-like of positive indices that correspond to the ones
          that were passed in initially to this function.
  
      Raises
      ------
      IndexError
          One of the converted indices either exceeded the number of,
          elements (specified by `n`), or was still negative.
      """
      if isinstance(indices, list):
          indices = np.array(indices)
          if len(indices) == 0:
              # If `indices` is empty, np.array will return a float,
              # and will cause indexing errors.
              return np.empty(0, dtype=np.intp)
  
      mask = indices < 0
      if mask.any():
          indices = indices.copy()
          indices[mask] += n
  
      mask = (indices >= n) | (indices < 0)
      if mask.any():
          raise IndexError("indices are out-of-bounds")
      return indices
function_tokens: def maybe_convert_indices ( indices , n : int ) : if isinstance ( indices , list ) : indices = np . array ( indices ) if len ( indices ) == 0 : # If `indices` is empty, np.array will return a float, # and will cause indexing errors. return np . empty ( 0 , dtype = np . intp ) mask = indices < 0 if mask . any ( ) : indices = indices . copy ( ) indices [ mask ] += n mask = ( indices >= n ) | ( indices < 0 ) if mask . any ( ) : raise IndexError ( "indices are out-of-bounds" ) return indices