code: def test_cluster_map_centroid_getitem(rng):
      nb_clusters = 11
      indices = list(range(len(data)))
      rng.shuffle(indices)  # None trivial ordering
      advanced_indices = indices + [0, 1, 2, -1, -2, -3]
  
      cluster_map = ClusterMapCentroid()
      clusters = []
      for i in range(nb_clusters):
          centroid = np.zeros_like(features)
          cluster = ClusterCentroid(centroid)
          cluster.id = cluster_map.add_cluster(cluster)
          clusters.append(cluster)
  
      # Test indexing
      for i in advanced_indices:
          assert_true(cluster_map[i] == clusters[i])
  
      # Test advanced indexing
      assert_arrays_equal(
          cluster_map[advanced_indices],
          [clusters[i] for i in advanced_indices],
      )
  
      # Test index out of bounds
      assert_raises(IndexError, cluster_map.__getitem__, len(clusters))
      assert_raises(
          IndexError, cluster_map.__getitem__, -len(clusters) - 1
      )
  
      # Test slicing and negative indexing
      assert_true(cluster_map[-1] == clusters[-1])
      assert_array_equal(cluster_map[::2], clusters[::2])
      assert_arrays_equal(cluster_map[::-1], clusters[::-1])
      assert_arrays_equal(cluster_map[:-1], clusters[:-1])
      assert_arrays_equal(cluster_map[1:], clusters[1:])
  
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 26 for calling a global function with example usage: test_cluster_map_centroid_getitem(rng) without return types