code: def test_cross_similarity_sparse():
      srand()
      data_ref = np.random.randn(3, 50)
      data = np.random.randn(3, 100)
  
      D_sparse = librosa.segment.cross_similarity(
          data, data_ref, sparse=True
      )
      D_dense = librosa.segment.cross_similarity(
          data, data_ref, sparse=False
      )
  
      assert scipy.sparse.isspmatrix(D_sparse)
      assert np.allclose(D_sparse.todense(), D_dense)
  
imports: from typing import Union
  import warnings
  import os
  import numpy
  import scipy
  from scipy.spatial.distance import cdist, pdist, squareform
  import pytest
  from test_core import srand
  import librosa
label_desc: Use image node_id 2 for calling a global function with example usage: test_cross_similarity_sparse() without return types