code: def test_cluster_map_centroid_iter(rng):
      nb_clusters = 11
  
      cluster_map = ClusterMapCentroid()
      clusters = []
      for i in range(nb_clusters):
          new_centroid = np.zeros_like(features)
          new_cluster = ClusterCentroid(
              new_centroid, indices=rng.integers(0, len(data), size=10)
          )
          cluster_map.add_cluster(new_cluster)
          clusters.append(new_cluster)
  
      assert_true(
          all(
              [
                  c1 is c2
                  for c1, c2 in zip(cluster_map.clusters, clusters)
              ]
          )
      )
      assert_array_equal(cluster_map, clusters)
      assert_array_equal(cluster_map.clusters, clusters)
      assert_array_equal(
          cluster_map, [cluster.indices for cluster in clusters]
      )
  
      # Set refdata
      cluster_map.refdata = data
      for c1, c2 in zip(cluster_map, clusters):
          assert_arrays_equal(c1, [data[i] for i in c2.indices])
  
imports: import copy
  import itertools
  import numpy
  from numpy.testing import assert_array_equal, assert_raises, assert_equal
  from dipy.segment.clustering import Cluster, ClusterCentroid
  from dipy.segment.clustering import ClusterMap, ClusterMapCentroid
  from dipy.segment.clustering import Clustering
  from dipy.testing import assert_true, assert_false, assert_arrays_equal
  from dipy.testing.decorators import set_random_number_generator
label_desc: Use image node_id 25 for calling a global function with example usage: test_cluster_map_centroid_iter(rng) without return types