code: def test_hdbscan_centers(algorithm):
      """
      Tests that HDBSCAN centers are calculated and stored properly, and are
      accurate to the data.
      """
      centers = [(0.0, 0.0), (3.0, 3.0)]
      H, _ = make_blobs(
          n_samples=1000,
          random_state=0,
          centers=centers,
          cluster_std=0.5,
      )
      hdb = HDBSCAN(store_centers="both").fit(H)
  
      for center, centroid, medoid in zip(
          centers, hdb.centroids_, hdb.medoids_
      ):
          assert_allclose(center, centroid, rtol=1, atol=0.05)
          assert_allclose(center, medoid, rtol=1, atol=0.05)
  
      # Ensure that nothing is done for noise
      hdb = HDBSCAN(
          algorithm=algorithm,
          store_centers="both",
          min_cluster_size=X.shape[0],
      ).fit(X)
      assert hdb.centroids_.shape[0] == 0
      assert hdb.medoids_.shape[0] == 0
  
imports: import numpy
  import pytest
  from scipy import stats
  from scipy.spatial import distance
  from sklearn.cluster import HDBSCAN
  from sklearn.cluster._hdbscan._tree import CONDENSED_dtype, _condense_tree, _do_labelling
  from sklearn.cluster._hdbscan.hdbscan import _OUTLIER_ENCODING
  from sklearn.datasets import make_blobs
  from sklearn.metrics import fowlkes_mallows_score
  from sklearn.metrics.pairwise import _VALID_METRICS, euclidean_distances
  from sklearn.neighbors import BallTree, KDTree
  from sklearn.preprocessing import StandardScaler
  from sklearn.utils import shuffle
  from sklearn.utils._testing import assert_allclose, assert_array_equal
  from sklearn.utils.fixes import CSC_CONTAINERS, CSR_CONTAINERS
label_desc: Use image node_id 15 for calling a global function with example usage: test_hdbscan_centers(algorithm) without return types