code: def test_cluster_map_remove_cluster():
      clusters = ClusterMap()
  
      cluster1 = Cluster(indices=[1])
      clusters.add_cluster(cluster1)
  
      cluster2 = Cluster(indices=[1, 2])
      clusters.add_cluster(cluster2)
  
      cluster3 = Cluster(indices=[1, 2, 3])
      clusters.add_cluster(cluster3)
  
      assert_equal(len(clusters), 3)
  
      clusters.remove_cluster(cluster2)
      assert_equal(len(clusters), 2)
      assert_array_equal(
          list(itertools.chain(*clusters)),
          list(itertools.chain(*[cluster1, cluster3])),
      )
      assert_equal(clusters[0], cluster1)
      assert_equal(clusters[1], cluster3)
  
      clusters.remove_cluster(cluster3)
      assert_equal(len(clusters), 1)
      assert_array_equal(
          list(itertools.chain(*clusters)), list(cluster1)
      )
      assert_equal(clusters[0], cluster1)
  
      clusters.remove_cluster(cluster1)
      assert_equal(len(clusters), 0)
      assert_array_equal(list(itertools.chain(*clusters)), [])
  
      # Test removing multiple clusters at once.
      clusters = ClusterMap()
      clusters.add_cluster(cluster1, cluster2, cluster3)
  
      clusters.remove_cluster(cluster3, cluster2)
      assert_equal(len(clusters), 1)
      assert_array_equal(
          list(itertools.chain(*clusters)), list(cluster1)
      )
      assert_equal(clusters[0], cluster1)
  
      clusters = ClusterMap()
      clusters.add_cluster(cluster2, cluster1, cluster3)
  
      clusters.remove_cluster(cluster1, cluster3, cluster2)
      assert_equal(len(clusters), 0)
      assert_array_equal(list(itertools.chain(*clusters)), [])
  
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 12 for calling a global function with example usage: test_cluster_map_remove_cluster() without return types