code: def test_shrinkage_correct():
      # Ensure that the shrinking is correct.
      # The expected result is calculated by R (pamr),
      # which is implemented by the author of the original paper.
      # (One need to modify the code to output the new centroid in pamr.predict)
  
      X = np.array([[0, 1], [1, 0], [1, 1], [2, 0], [6, 8]])
      y = np.array([1, 1, 2, 2, 2])
      clf = NearestCentroid(shrink_threshold=0.1)
      clf.fit(X, y)
      expected_result = np.array(
          [[0.7787310, 0.8545292], [2.814179, 2.763647]]
      )
      np.testing.assert_array_almost_equal(
          clf.centroids_, expected_result
      )
  
file_path: scikit-learn/sklearn/neighbors/tests/test_nearest_centroid.py
imports: import numpy
  import pytest
  from numpy.testing import assert_array_equal
  from sklearn import datasets
  from sklearn.neighbors import NearestCentroid
  from sklearn.utils.fixes import CSR_CONTAINERS
label_desc: Use image node_id 5 for calling a global function with example usage: test_shrinkage_correct() without return types