code: def templateClusterAllocationOneDimensionData(ccore_flag):
      input_data = (
          [[random()] for _ in range(10)]
          + [[random() + 3] for _ in range(10)]
          + [[random() + 5] for _ in range(10)]
          + [[random() + 8] for _ in range(10)]
      )
  
      kmeans_instance = kmeans(
          input_data, [[0.0], [3.0], [5.0], [8.0]], 0.025, ccore_flag
      )
      kmeans_instance.process()
      clusters = kmeans_instance.get_clusters()
  
      assertion.eq(4, len(clusters))
      for cluster in clusters:
          assertion.eq(10, len(cluster))
  
file_path: pyclustering/pyclustering/cluster/tests/kmeans_templates.py
imports: from pyclustering.tests.assertion import assertion
  from pyclustering.cluster.encoder import type_encoding, cluster_encoder
  from pyclustering.cluster.kmeans import kmeans, kmeans_observer, kmeans_visualizer
  from pyclustering.utils import read_sample
  from pyclustering.utils.metric import distance_metric, type_metric
  from random import random
  import numpy
label_desc: Use image node_id 3 for calling the KmeansTestTemplates obj's underlying member method code with example usage: obj.templateClusterAllocationOneDimensionData(ccore_flag) without return types