code: def template_clustering(
      file,
      radius,
      order,
      show_dyn=False,
      show_conn=False,
      show_clusters=True,
      ena_conn_weight=False,
      ccore_flag=True,
      tolerance=0.1,
  ):
      sample = read_sample(file)
      syncnet_instance = syncnet(
          sample,
          radius,
          enable_conn_weight=ena_conn_weight,
          ccore=ccore_flag,
      )
  
      (ticks, analyser) = timedcall(
          syncnet_instance.process, order, solve_type.FAST, show_dyn
      )
      print("Sample: ", file, "\t\tExecution time: ", ticks)
  
      if show_dyn == True:
          sync_visualizer.show_output_dynamic(analyser)
          sync_visualizer.animate(analyser)
          sync_visualizer.show_local_order_parameter(
              analyser, syncnet_instance
          )
          # sync_visualizer.animate_output_dynamic(analyser);
          # sync_visualizer.animate_correlation_matrix(analyser, colormap = 'hsv')
  
      if show_conn == True:
          syncnet_instance.show_network()
  
      if show_clusters == True:
          clusters = analyser.allocate_clusters(tolerance)
          print("Amount of allocated clusters: ", len(clusters))
          draw_clusters(sample, clusters)
  
      print("----------------------------\n")
      return (sample, clusters)
  
imports: from pyclustering.cluster import cluster_visualizer
  from pyclustering.cluster.syncnet import syncnet, syncnet_visualizer
  from pyclustering.nnet.sync import sync_visualizer
  from pyclustering.nnet import initial_type, solve_type
  from pyclustering.samples.definitions import SIMPLE_SAMPLES
  from pyclustering.samples.definitions import FCPS_SAMPLES
  from pyclustering.utils import draw_clusters
  from pyclustering.utils import read_sample
  from pyclustering.utils import timedcall
label_desc: Use image node_id 1 for calling a global function with example usage: template_clustering(file, radius, order, show_dyn, show_conn, show_clusters, ena_conn_weight, ccore_flag, tolerance) and returns: sample,  clusters