code: def templateClusterAllocation(
      self,
      path,
      cluster_sizes,
      number_clusters,
      iterations,
      maxneighbors,
  ):
      result_testing = False
  
      # it's randomized algorithm therefore attempts are required
      for _ in range(0, 5, 1):
          sample = read_sample(path)
  
          clarans_instance = clarans(
              sample, number_clusters, iterations, maxneighbors
          )
          clarans_instance.process()
          clusters = clarans_instance.get_clusters()
  
          obtained_cluster_sizes = [
              len(cluster) for cluster in clusters
          ]
  
          total_length = sum(obtained_cluster_sizes)
          if total_length != len(sample):
              continue
  
          cluster_sizes.sort()
          obtained_cluster_sizes.sort()
          if cluster_sizes != obtained_cluster_sizes:
              continue
  
          result_testing = True
          break
  
      assert result_testing == True
  
file_path: pyclustering/pyclustering/cluster/tests/unit/ut_clarans.py
imports: import unittest
  import matplotlib
  from pyclustering.samples.definitions import SIMPLE_SAMPLES
  from pyclustering.utils import read_sample
  from pyclustering.cluster.clarans import clarans
label_desc: Use image node_id 1 for calling the ClaransUnitTest obj's underlying member method code with example usage: obj.templateClusterAllocation(path, cluster_sizes, number_clusters, iterations, maxneighbors) without return types