code: def test_assert_allclose_dense_sparse(csr_container):
      x = np.arange(9).reshape(3, 3)
      msg = "Not equal to tolerance "
      y = csr_container(x)
      for X in [x, y]:
          # basic compare
          with pytest.raises(AssertionError, match=msg):
              assert_allclose_dense_sparse(X, X * 2)
          assert_allclose_dense_sparse(X, X)
  
      with pytest.raises(
          ValueError, match="Can only compare two sparse"
      ):
          assert_allclose_dense_sparse(x, y)
  
      A = sparse.diags(np.ones(5), offsets=0).tocsr()
      B = csr_container(np.ones((1, 5)))
      with pytest.raises(AssertionError, match="Arrays are not equal"):
          assert_allclose_dense_sparse(B, A)
  
imports: import atexit
  import os
  import unittest
  import warnings
  import numpy
  import pytest
  from scipy import sparse
  from sklearn.discriminant_analysis import LinearDiscriminantAnalysis
  from sklearn.tree import DecisionTreeClassifier
  from sklearn.utils import _IS_WASM
  from sklearn.utils._testing import TempMemmap, _convert_container, _delete_folder, assert_allclose, assert_allclose_dense_sparse, assert_no_warnings, assert_raise_message, assert_raises, assert_raises_regex, assert_run_python_script_without_output, check_docstring_parameters, create_memmap_backed_data, ignore_warnings, raises, set_random_state
  from sklearn.utils.deprecation import deprecated
  from sklearn.utils.fixes import CSC_CONTAINERS, CSR_CONTAINERS, parse_version, sp_version
  from sklearn.utils.metaestimators import available_if
label_desc: Use image node_id 2 for calling a global function with example usage: test_assert_allclose_dense_sparse(csr_container) without return types