code: def test_cluster_iter(rng):
      indices = list(range(len(data)))
      rng.shuffle(indices)  # None trivial ordering
  
      # Test without specifying refdata
      cluster = Cluster()
      cluster.assign(*indices)
      assert_array_equal(cluster.indices, indices)
      assert_array_equal(list(cluster), indices)
  
      # Test with specifying refdata in ClusterMap
      cluster.refdata = data
      assert_arrays_equal(list(cluster), [data[i] for i in 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 3 for calling a global function with example usage: test_cluster_iter(rng) without return types