code: def test_sparse_hellinger(sparse_spatial_data):
      dist_matrix = dist.pairwise_special_metric(
          np.abs(sparse_spatial_data[:-2].toarray())
      )
      test_matrix = np.array(
          [
              [
                  spdist.sparse_hellinger(
                      np.abs(sparse_spatial_data[i]).indices,
                      np.abs(sparse_spatial_data[i]).data,
                      np.abs(sparse_spatial_data[j]).indices,
                      np.abs(sparse_spatial_data[j]).data,
                  )
                  for j in range(sparse_spatial_data.shape[0] - 2)
              ]
              for i in range(sparse_spatial_data.shape[0] - 2)
          ]
      )
  
      assert_array_almost_equal(
          test_matrix,
          dist_matrix,
          err_msg="Sparse distances don't match "
          "for metric hellinger",
          decimal=3,
      )
  
      # Ensure ll_dirichlet runs
      test_matrix = np.array(
          [
              [
                  spdist.sparse_ll_dirichlet(
                      sparse_spatial_data[i].indices,
                      sparse_spatial_data[i].data,
                      sparse_spatial_data[j].indices,
                      sparse_spatial_data[j].data,
                  )
                  for j in range(sparse_spatial_data.shape[0])
              ]
              for i in range(sparse_spatial_data.shape[0])
          ]
      )
      assert (
          test_matrix is not None
      ), "Pairwise Special Metric with LL Dirichlet metric failed"
  
imports: import numpy
  from numpy.testing import assert_array_almost_equal
  import umap.distances
  import umap.sparse
  from sklearn.metrics import pairwise_distances
  from sklearn.neighbors import BallTree
  from scipy.version import full_version
  import pytest
label_desc: Use image node_id 47 for calling a global function with example usage: test_sparse_hellinger(sparse_spatial_data) without return types