code: def test_cluster_nearest_neighbor():
      """Check that _cluster_nearest_neighbor preserves within-cluster voxels,
      projects voxels to the correct cluster, and handles singleton clusters.
      """
      shape = (9, 10, 11)
      labeled = np.zeros(shape)
      # cluster 1 is half the volume, cluster 2 is a single voxel
      labeled[:, 5:, :] = 1
      labeled[4, 2, 6] = 2
  
      labels_index = np.array([1, 1, 2])
      ijk = np.array(
          [
              [4, 7, 5],  # inside cluster 1
              [4, 2, 5],  # outside, close to 2
              [4, 3, 6],  # outside, close to 2
          ]
      )
      nbrs = _cluster_nearest_neighbor(ijk, labels_index, labeled)
      assert np.array_equal(
          nbrs, np.array([[4, 7, 5], [4, 5, 5], [4, 2, 6]])
      )
  
file_path: nilearn/nilearn/reporting/tests/test_reporting.py
imports: import nibabel
  import numpy
  import pytest
  from nilearn.image import get_data
  from nilearn.plotting import _set_mpl_backend
  from nilearn.reporting import get_clusters_table
  from nilearn.reporting.get_clusters_table import _cluster_nearest_neighbor, _local_max
label_desc: Use image node_id 2 for calling a global function with example usage: test_cluster_nearest_neighbor() without return types