code: def random_state(rows, cols, connections, random_state, ccore_flag):
      sample = read_sample(SIMPLE_SAMPLES.SAMPLE_SIMPLE1)
  
      params = som_parameters()
      params.random_state = random_state
  
      network_1 = som(rows, cols, connections, ccore=ccore_flag)
      steps_1 = network_1.train(sample, 100, True)
  
      network_2 = som(rows, cols, connections, ccore=ccore_flag)
      steps_2 = network_2.train(sample, 100, True)
  
      assert steps_1 == steps_2
      assert network_1.weights == network_2.weights
      assert network_1.capture_objects == network_2.capture_objects
      assert network_1.awards == network_2.awards
  
file_path: pyclustering/pyclustering/nnet/tests/som_templates.py
imports: import pickle
  import matplotlib
  from pyclustering.nnet.som import som, type_conn, som_parameters
  from pyclustering.utils import read_sample
  from pyclustering.samples.definitions import SIMPLE_SAMPLES
label_desc: Use image node_id 4 for calling the SomTestTemplates obj's underlying member method code with example usage: obj.random_state(rows, cols, connections, random_state, ccore_flag) without return types