code: def test_cluster_centroid_attributes_and_constructor():
      centroid = np.zeros(features_shape)
      cluster = ClusterCentroid(centroid)
      assert_equal(type(cluster), ClusterCentroid)
  
      assert_equal(cluster.id, 0)
      assert_array_equal(cluster.indices, [])
      assert_array_equal(cluster.centroid, np.zeros(features_shape))
      assert_equal(len(cluster), 0)
  
      # Duplicate
      assert_true(cluster == ClusterCentroid(centroid))
      assert_false(cluster != ClusterCentroid(centroid))
      assert_false(cluster == ClusterCentroid(centroid + 1))
  
      # Invalid comparison
      assert_raises(TypeError, cluster.__cmp__, cluster)
  
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 6 for calling a global function with example usage: test_cluster_centroid_attributes_and_constructor() without return types