code: def template_animated_clustering(
      file, radius, order, expected_cluster_amount, title_animation=None
  ):
      sample = read_sample(file)
      expected_result_obtained = False
  
      analyser = None
  
      while expected_result_obtained == False:
          network = syncnet(
              sample,
              radius,
              initial_phases=initial_type.RANDOM_GAUSSIAN,
              ccore=True,
          )
  
          analyser = network.process(order, solve_type.FAST, True)
          clusters = analyser.allocate_clusters(0.1)
  
          if len(clusters) == expected_cluster_amount:
              print("Expected result is obtained - start rendering...")
              expected_result_obtained = True
  
              visualizer = cluster_visualizer()
              visualizer.append_clusters(clusters, sample)
              visualizer.show()
  
          else:
              print(
                  "Expected result is NOT obtained - rendering is NOT started ( actual:",
                  len(clusters),
                  ")...",
              )
  
      syncnet_visualizer.animate_cluster_allocation(
          sample,
          analyser,
          tolerance=0.1,
          save_movie="clustering_animation.mp4",
          title=title_animation,
      )
  
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 21 for calling a global function with example usage: template_animated_clustering(file, radius, order, expected_cluster_amount, title_animation) without return types