code: def templateTestSimulate(connections, ccore_flag, **kwargs):
      store_load = kwargs.get("store_load", False)
  
      sample = read_sample(SIMPLE_SAMPLES.SAMPLE_SIMPLE1)
  
      network = som(1, 2, connections, ccore=ccore_flag)
      network.train(sample, 100)
  
      if store_load:
          dump_network = pickle.dumps(network)
          network = pickle.loads(dump_network)
  
      expected_winners = [0, 1]
      for i in range(len(sample)):
          index_winner = network.simulate(sample[i])
          if (i == 0) and (index_winner == 1):
              expected_winners = [1, 0]
  
          if i < 5:
              assert expected_winners[0] == index_winner
          else:
              assert expected_winners[1] == index_winner
  
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 3 for calling the SomTestTemplates obj's underlying member method code with example usage: obj.templateTestSimulate(connections, ccore_flag) without return types