code: def csr_unique(
      matrix, return_index=True, return_inverse=True, return_counts=True
  ):
      """Find the unique elements of a sparse csr matrix.
      We don't explicitly construct the unique matrix leaving that to the user
      who may not want to duplicate a massive array in memory.
      Returns the indices of the input array that give the unique values.
      Returns the indices of the unique array that reconstructs the input array.
      Returns the number of times each unique row appears in the input matrix.
  
      matrix: a csr matrix
      return_index = bool, optional
          If true, return the row indices of 'matrix'
      return_inverse: bool, optional
          If true, return the indices of the unique array that can be
             used to reconstruct 'matrix'.
      return_counts = bool, optional
          If true, returns the number of times each unique item appears in 'matrix'
  
      The unique matrix can computed via
      unique_matrix = matrix[index]
      and the original matrix reconstructed via
      unique_matrix[inverse]
      """
      lil_matrix = matrix.tolil()
      rows = np.asarray(
          [
              tuple(x + y)
              for x, y in zip(lil_matrix.rows, lil_matrix.data)
          ],
          dtype=object,
      )
      return_values = return_counts + return_inverse + return_index
      return np.unique(
          rows,
          return_index=return_index,
          return_inverse=return_inverse,
          return_counts=return_counts,
      )[1 : (return_values + 1)]
  
file_path: umap/umap/utils.py
imports: import time
  from warnings import warn
  import numpy
  import numba
  from sklearn.utils.validation import check_is_fitted
  import scipy.sparse
label_desc: Use image node_id 7 for calling a global function with example usage: csr_unique(matrix, return_index, return_inverse, return_counts) and returns: np