code: def _min_or_max_axis(X, axis, min_or_max):
      N = X.shape[axis]
      if N == 0:
          raise ValueError("zero-size array to reduction operation")
      M = X.shape[1 - axis]
      mat = X.tocsc() if axis == 0 else X.tocsr()
      mat.sum_duplicates()
      major_index, value = _minor_reduce(mat, min_or_max)
      not_full = np.diff(mat.indptr)[major_index] < N
      if "min" in min_or_max:
          fminmax = np.fmin
      else:
          fminmax = np.fmax
      is_nan = np.isnan(value)
      value[not_full] = fminmax(value[not_full], 0)
      if "nan" not in min_or_max:
          value[is_nan] = np.nan
      mask = value != 0
      major_index = np.compress(mask, major_index)
      value = np.compress(mask, value)
  
      if axis == 0:
          res = gpu_sp.coo_matrix(
              (value, (np.zeros(len(value)), major_index)),
              dtype=X.dtype,
              shape=(1, M),
          )
      else:
          res = gpu_sp.coo_matrix(
              (value, (major_index, np.zeros(len(value)))),
              dtype=X.dtype,
              shape=(M, 1),
          )
      return res.A.ravel()
  
file_path: cuml/python/cuml/_thirdparty/sklearn/utils/sparsefuncs.py
imports: from ....thirdparty_adapters.sparsefuncs_fast import csr_mean_variance_axis0, csc_mean_variance_axis0
  from cuml.internals.safe_imports import cpu_only_import
  from cuml.internals.safe_imports import gpu_only_import
  from cuml.internals.safe_imports import gpu_only_import_from
  from cuml.internals.safe_imports import cpu_only_import_from
label_desc: Use image node_id 11 for calling a global function with example usage: _min_or_max_axis(X, axis, min_or_max) and returns: res