code: def template_clustering(
      file,
      map_size,
      radius,
      sync_order=0.999,
      show_dyn=False,
      show_layer1=False,
      show_layer2=False,
      show_clusters=True,
  ):
      # Read sample
      sample = read_sample(file)
  
      # Create network
      network = syncsom(sample, map_size[0], map_size[1], radius)
  
      # Run processing
      (ticks, (dyn_time, dyn_phase)) = timedcall(
          network.process, show_dyn, sync_order
      )
      print("Sample: ", file, "\t\tExecution time: ", ticks, "\n")
  
      # Show dynamic of the last layer.
      if show_dyn is True:
          draw_dynamics(
              dyn_time,
              dyn_phase,
              x_title="Time",
              y_title="Phase",
              y_lim=[0, 3.14],
          )
  
      if show_clusters is True:
          clusters = network.get_som_clusters()
  
          visualizer = cluster_visualizer()
          visualizer.append_clusters(
              clusters, network.som_layer.weights
          )
          visualizer.show()
  
      # Show network stuff.
      if show_layer1 is True:
          network.show_som_layer()
  
      if show_layer2 is True:
          network.show_sync_layer()
  
      if show_clusters is True:
          clusters = network.get_clusters()
  
          visualizer = cluster_visualizer()
          visualizer.append_clusters(clusters, sample)
          visualizer.show()
  
imports: from random import random
  from pyclustering.cluster import cluster_visualizer
  from pyclustering.cluster.syncsom import syncsom
  from pyclustering.samples.definitions import SIMPLE_SAMPLES
  from pyclustering.samples.definitions import FCPS_SAMPLES
  from pyclustering.utils import read_sample, draw_dynamics
  from pyclustering.utils import timedcall
label_desc: Use image node_id 1 for calling a global function with example usage: template_clustering(file, map_size, radius, sync_order, show_dyn, show_layer1, show_layer2, show_clusters) without return types