code: def _sparse_min_or_max(X, axis, min_or_max):
      if axis is None:
          if 0 in X.shape:
              raise ValueError("zero-size array to reduction operation")
          if X.nnz == 0:
              return X.dtype.type(0)
          fminmax = ufunc_dic[min_or_max]
          m = fminmax(X.data)
          if np.isnan(m):
              if "nan" in min_or_max:
                  m = 0
          elif X.nnz != cpu_np.product(X.shape):
              if "min" in min_or_max:
                  m = m if m <= 0 else 0
              else:
                  m = m if m >= 0 else 0
          return X.dtype.type(m)
      if axis < 0:
          axis += 2
      if (axis == 0) or (axis == 1):
          return _min_or_max_axis(X, axis, min_or_max)
      else:
          raise ValueError(
              "invalid axis, use 0 for rows, or 1 for columns"
          )
  
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 12 for calling a global function with example usage: _sparse_min_or_max(X, axis, min_or_max) and returns: X, _min_or_max_axis, X