code: def _allclose_dense_sparse(x, y, rtol=1e-7, atol=1e-9):
      """Check allclose for sparse and dense data.
  
      Both x and y need to be either sparse or dense, they
      can't be mixed.
  
      Parameters
      ----------
      x : array-like or sparse matrix
          First array to compare.
  
      y : array-like or sparse matrix
          Second array to compare.
  
      rtol : float, optional
          relative tolerance; see numpy.allclose
  
      atol : float, optional
          absolute tolerance; see numpy.allclose. Note that the default here is
          more tolerant than the default for numpy.testing.assert_allclose, where
          atol=0.
      """
      if sp.issparse(x) and sp.issparse(y):
          x = x.tocsr()
          y = y.tocsr()
          x.sum_duplicates()
          y.sum_duplicates()
          return (
              cp.array_equal(x.indices, y.indices)
              and cp.array_equal(x.indptr, y.indptr)
              and cp.allclose(x.data, y.data, rtol=rtol, atol=atol)
          )
      elif not sp.issparse(x) and not sp.issparse(y):
          return cp.allclose(x, y, rtol=rtol, atol=atol)
      raise ValueError(
          "Can only compare two sparse matrices, not a sparse "
          "matrix and an array"
      )
  
file_path: cuml/python/cuml/_thirdparty/sklearn/utils/validation.py
imports: from ....thirdparty_adapters import check_array
  from ....common.exceptions import NotFittedError
  from inspect import isclass
  from cuml.internals.safe_imports import gpu_only_import
  import numbers
  from cuml.internals.safe_imports import cpu_only_import
label_desc: Use image node_id 4 for calling a global function with example usage: _allclose_dense_sparse(x, y, rtol, atol) and returns: unknown, cp