code: def test_hellinger(spatial_data):
      hellinger_data = np.abs(spatial_data[:-2].copy())
      hellinger_data = (
          hellinger_data / hellinger_data.sum(axis=1)[:, np.newaxis]
      )
      hellinger_data = np.sqrt(hellinger_data)
      dist_matrix = hellinger_data @ hellinger_data.T
      dist_matrix = 1.0 - dist_matrix
      dist_matrix = np.sqrt(dist_matrix)
      # Correct for nan handling
      dist_matrix[np.isnan(dist_matrix)] = 0.0
  
      test_matrix = dist.pairwise_special_metric(
          np.abs(spatial_data[:-2])
      )
  
      assert_array_almost_equal(
          test_matrix,
          dist_matrix,
          err_msg="Distances don't match " "for metric hellinger",
      )
  
      # Ensure ll_dirichlet runs
      test_matrix = dist.pairwise_special_metric(
          np.abs(spatial_data[:-2]), metric="ll_dirichlet"
      )
      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 46 for calling a global function with example usage: test_hellinger(spatial_data) without return types