code: def template_clustering(
      sample_file_path,
      amount_clusters,
      initializer,
      show_animation=False,
  ):
      sample = read_sample(sample_file_path)
  
      observer = None
      if show_animation is True:
          observer = ema_observer()
  
      initial_means, initial_covariance = ema_initializer(
          sample, amount_clusters
      ).initialize(initializer)
      ema_instance = ema(
          sample,
          amount_clusters,
          initial_means,
          initial_covariance,
          observer=observer,
      )
      ema_instance.process()
  
      clusters = ema_instance.get_clusters()
      covariances = ema_instance.get_covariances()
      means = ema_instance.get_centers()
  
      cluster_length = [len(cluster) for cluster in clusters]
  
      print("Data '" + sample_file_path + "'")
      print(
          "Clusters: "
          + str(len(clusters))
          + ", Length:"
          + str(cluster_length)
      )
  
      if observer is True:
          ema_visualizer.show_clusters(
              observer.get_evolution_clusters()[0],
              sample,
              observer.get_evolution_covariances()[0],
              observer.get_evolution_means()[0],
          )
  
      ema_visualizer.show_clusters(clusters, sample, covariances, means)
  
      if show_animation is True:
          ema_visualizer.animate_cluster_allocation(sample, observer)
  
imports: from pyclustering.cluster.ema import ema, ema_initializer, ema_observer, ema_visualizer, ema_init_type
  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 a global function with example usage: template_clustering(sample_file_path, amount_clusters, initializer, show_animation) without return types