code: def test_cluster_map_add_cluster():
      clusters = ClusterMap()
  
      list_of_cluster_objects = []
      list_of_indices = []
      for i in range(3):
          cluster = Cluster()
          list_of_cluster_objects.append(cluster)
          list_of_indices.append([])
  
          for id_data in range(2 * i):
              list_of_indices[-1].append(id_data)
              cluster.assign(id_data)
  
          clusters.add_cluster(cluster)
          assert_equal(type(cluster), Cluster)
          assert_equal(len(clusters), i + 1)
          assert_true(cluster == clusters[-1])
  
      assert_array_equal(
          list(itertools.chain(*clusters)),
          list(itertools.chain(*list_of_indices)),
      )
  
      # Test adding multiple clusters at once.
      clusters = ClusterMap()
      clusters.add_cluster(*list_of_cluster_objects)
      assert_array_equal(
          list(itertools.chain(*clusters)),
          list(itertools.chain(*list_of_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 11 for calling a global function with example usage: test_cluster_map_add_cluster() without return types