code: def template_dynamic_pcnn(
      num_osc,
      steps,
      stimulus=None,
      params=None,
      conn_type=conn_type.NONE,
      separate_representation=True,
      ccore_flag=True,
  ):
      net = pcnn_network(num_osc, params, conn_type, ccore=ccore_flag)
      dynamic = net.simulate(steps, stimulus)
  
      ensembles = dynamic.allocate_sync_ensembles()
      print(
          "Number of objects:",
          len(ensembles),
          "\nEnsembles:",
          ensembles,
      )
  
      pcnn_visualizer.show_output_dynamic(dynamic)
  
      return ensembles
  
file_path: pyclustering/pyclustering/nnet/examples/pcnn_examples.py
imports: from pyclustering.utils import draw_dynamics
  from pyclustering.utils import read_image, rgb2gray, draw_image_mask_segments
  from pyclustering.nnet.pcnn import pcnn_network, pcnn_parameters
  from pyclustering.nnet import *
  from pyclustering.samples.definitions import IMAGE_SIMPLE_SAMPLES
  from pyclustering.nnet.pcnn import pcnn_visualizer
label_desc: Use image node_id 1 for calling a global function with example usage: template_dynamic_pcnn(num_osc, steps, stimulus, params, conn_type, separate_representation, ccore_flag) and returns: ensembles