code: def random_state(ccore_flag, kinitial, kmax, random_state):
      data = read_sample(SIMPLE_SAMPLES.SAMPLE_SIMPLE5)
  
      initial_centers = random_center_initializer(
          data, kinitial, random_state=random_state
      ).initialize()
      xmeans_instance1 = xmeans(
          data,
          initial_centers,
          kmax,
          ccore=ccore_flag,
          random_state=random_state,
      ).process()
      xmeans_instance2 = xmeans(
          data,
          initial_centers,
          kmax,
          ccore=ccore_flag,
          random_state=random_state,
      ).process()
  
      assertion.eq(
          xmeans_instance1.get_total_wce(),
          xmeans_instance2.get_total_wce(),
      )
      assertion.eq(
          xmeans_instance1.get_centers(), xmeans_instance2.get_centers()
      )
      assertion.eq(
          xmeans_instance1.get_clusters(),
          xmeans_instance2.get_clusters(),
      )
  
file_path: pyclustering/pyclustering/cluster/tests/xmeans_templates.py
imports: import numpy
  import random
  from pyclustering.cluster.xmeans import xmeans, splitting_type
  from pyclustering.cluster.center_initializer import random_center_initializer
  from pyclustering.samples.definitions import SIMPLE_SAMPLES
  from pyclustering.utils import read_sample, distance_metric, type_metric
  from pyclustering.tests.assertion import assertion
label_desc: Use image node_id 5 for calling the XmeansTestTemplates obj's underlying member method code with example usage: obj.random_state(ccore_flag, kinitial, kmax, random_state) without return types