code: def template_clustering(
      start_medoids, path, tolerance=0.25, show=True, **kwargs
  ):
      ccore = kwargs.get("ccore", True)
      data_type = kwargs.get("data_type", "points")
  
      original_data = read_sample(path)
      sample = original_data
      if data_type == "distance_matrix":
          sample = calculate_distance_matrix(sample)
  
      metric = distance_metric(
          type_metric.EUCLIDEAN_SQUARE, data=sample
      )
  
      kmedoids_instance = kmedoids(
          sample,
          start_medoids,
          tolerance,
          metric=metric,
          ccore=ccore,
          data_type=data_type,
      )
      (ticks, result) = timedcall(kmedoids_instance.process)
  
      clusters = kmedoids_instance.get_clusters()
      print("Iterations:", kmedoids_instance.get_iterations())
      print([len(cluster) for cluster in clusters])
      print(clusters)
      medoids = kmedoids_instance.get_medoids()
      print("Sample: ", path, "\t\tExecution time: ", ticks, "\n")
  
      if show is True:
          visualizer = cluster_visualizer(1)
          visualizer.append_clusters(clusters, original_data, 0)
          visualizer.append_cluster(
              [original_data[index] for index in start_medoids],
              marker="*",
              markersize=15,
          )
          visualizer.append_cluster(
              medoids, data=original_data, marker="*", markersize=15
          )
          visualizer.show()
  
      return original_data, clusters
  
imports: from pyclustering.samples.definitions import SIMPLE_SAMPLES, FCPS_SAMPLES
  from pyclustering.cluster import cluster_visualizer
  from pyclustering.cluster.kmedoids import kmedoids
  from pyclustering.utils import read_sample, calculate_distance_matrix
  from pyclustering.utils import timedcall, distance_metric, type_metric
label_desc: Use image node_id 1 for calling a global function with example usage: template_clustering(start_medoids, path, tolerance, show) and returns: original_data,  clusters