code: def template_clustering(
      radius, neighb, path, invisible_axes=False, ccore=True, show=True
  ):
      sample = read_sample(path)
  
      dbscan_instance = dbscan(sample, radius, neighb, ccore)
      (ticks, _) = timedcall(dbscan_instance.process)
  
      clusters = dbscan_instance.get_clusters()
      noise = dbscan_instance.get_noise()
  
      print([len(cluster) for cluster in clusters])
  
      if show:
          visualizer = cluster_visualizer()
          visualizer.append_clusters(clusters, sample)
          visualizer.append_cluster(noise, sample, marker="x")
          visualizer.show()
  
      print("Sample: ", path, "\t\tExecution time: ", ticks, "\n")
  
      return sample, clusters, noise
  
imports: import random
  from pyclustering.cluster import cluster_visualizer
  from pyclustering.cluster.dbscan import dbscan
  from pyclustering.utils import read_sample
  from pyclustering.utils import timedcall
  from pyclustering.samples.definitions import SIMPLE_SAMPLES, FCPS_SAMPLES
label_desc: Use image node_id 1 for calling a global function with example usage: template_clustering(radius, neighb, path, invisible_axes, ccore, show) and returns: sample,  clusters,  noise