code: def templateClustering(
      path,
      number_clusters,
      expected_length_clusters,
      solver,
      initial_neighbors,
      increase_persent,
      collect_dynamic_flag,
      ccore_flag,
  ):
      result_testing = False
  
      # If phases crosses each other because of random part of the network then we should try again.
      for _ in range(0, 6, 1):
          sample = read_sample(path)
          network = hsyncnet(
              sample,
              number_clusters,
              initial_type.EQUIPARTITION,
              initial_neighbors,
              increase_persent,
              ccore=ccore_flag,
          )
  
          analyser = network.process(
              order=0.997,
              solution=solver,
              collect_dynamic=collect_dynamic_flag,
          )
          clusters = analyser.allocate_clusters(0.1)
  
          if sum([len(cluster) for cluster in clusters]) != sum(
              expected_length_clusters
          ):
              continue
  
          if (
              sorted([len(cluster) for cluster in clusters])
              != expected_length_clusters
          ):
              if sorted(
                  [len(cluster) for cluster in clusters]
              ) != sorted(expected_length_clusters):
                  continue
  
          # Unit-test is passed
          result_testing = True
          break
  
      assert result_testing
  
imports: from pyclustering.nnet import initial_type, solve_type
  from pyclustering.utils import read_sample
  from pyclustering.cluster.hsyncnet import hsyncnet
label_desc: Use image node_id 1 for calling the HsyncnetTestTemplates obj's underlying member method code with example usage: obj.templateClustering(path, number_clusters, expected_length_clusters, solver, initial_neighbors, increase_persent, collect_dynamic_flag, ccore_flag) without return types