code: def templateDataClustering(
      self,
      sample_path,
      amount_clusters,
      expected_clusters_sizes,
      init_type=ema_init_type.KMEANS_INITIALIZATION,
  ):
      testing_result = False
      attempts = 10
  
      for _ in range(attempts):
          sample = read_sample(sample_path)
  
          means, variances = None, None
          if init_type is not ema_init_type.KMEANS_INITIALIZATION:
              means, variances = ema_initializer(
                  sample, amount_clusters
              ).initialize(init_type)
  
          ema_instance = ema(sample, amount_clusters, means, variances)
          ema_instance.process()
  
          clusters = ema_instance.get_clusters()
          centers = ema_instance.get_centers()
          covariances = ema_instance.get_covariances()
          probabilities = ema_instance.get_probabilities()
  
          assert len(centers) == len(clusters)
          assert len(covariances) == len(clusters)
          assert len(probabilities) == len(clusters)
  
          for cluster_probability in probabilities:
              assert len(cluster_probability) == len(sample)
  
          for index_point in range(len(sample)):
              total_probability = 0.0
              for cluster_probability in probabilities:
                  total_probability += cluster_probability[index_point]
  
              assert abs(total_probability - 1.0) <= 0.00001
  
          obtained_cluster_sizes = [
              len(cluster) for cluster in clusters
          ]
          if len(sample) != sum(obtained_cluster_sizes):
              continue
  
          if expected_clusters_sizes is not None:
              obtained_cluster_sizes.sort()
              expected_clusters_sizes.sort()
              if obtained_cluster_sizes != expected_clusters_sizes:
                  continue
  
          testing_result = True
          break
  
      assert testing_result is True
  
imports: import unittest
  import matplotlib
  from pyclustering.cluster.ema import ema, ema_observer, ema_initializer, ema_init_type, ema_visualizer
  from pyclustering.utils import read_sample
  from pyclustering.samples.definitions import SIMPLE_SAMPLES, FCPS_SAMPLES, FAMOUS_SAMPLES
label_desc: Use image node_id 1 for calling the EmaUnitTest obj's underlying member method code with example usage: obj.templateDataClustering(sample_path, amount_clusters, expected_clusters_sizes, init_type) without return types