class_docstr: !
  @brief Represents output dynamic of PCNN (pulse-coupled neural network).
class_docstr_tok: ["!","@","brief","Represents","output","dynamic","of","PCNN","(","pulse-coupled","neural","network",")","."]
docstr: !
  @brief Analyses output dynamic of network and allocates spikes on each iteration as a list of indexes of oscillators.
  @details Each allocated spike ensemble represents list of indexes of oscillators whose output is active.
  
  @return (list) Spike ensembles of oscillators.
docstr_tok: ["!","@","brief","Analyses","output","dynamic","of","network","and","allocates","spikes","on","each","iteration","as","a","list","of","indexes","of","oscillators",".","@","details","Each","allocated","spike","ensemble","represents","list","of","indexes","of","oscillators","whose","output","is","active",".","@","return","(","list",")","Spike","ensembles","of","oscillators","."]
code: def allocate_spike_ensembles(self):
      """!
      @brief Analyses output dynamic of network and allocates spikes on each iteration as a list of indexes of oscillators.
      @details Each allocated spike ensemble represents list of indexes of oscillators whose output is active.
  
      @return (list) Spike ensembles of oscillators.
  
      """
  
      if self.__ccore_pcnn_dynamic_pointer is not None:
          return wrapper.pcnn_dynamic_allocate_spike_ensembles(
              self.__ccore_pcnn_dynamic_pointer
          )
  
      spike_ensembles = []
      number_oscillators = len(self.__dynamic[0])
  
      for t in range(len(self.__dynamic)):
          spike_ensemble = []
  
          for index in range(number_oscillators):
              if self.__dynamic[t][index] == self.__OUTPUT_TRUE:
                  spike_ensemble.append(index)
  
          if len(spike_ensemble) > 0:
              spike_ensembles.append(spike_ensemble)
  
      return spike_ensembles
  
imports: import random
  import numpy
  import matplotlib.pyplot
  import matplotlib.animation
  from PIL import Image
  from pyclustering.nnet import *
  from pyclustering.core.wrapper import ccore_library
  import pyclustering.core.pcnn_wrapper
  from pyclustering.utils import draw_dynamics
label_desc: Use image node_id 7 for calling the pcnn_dynamic obj's underlying member method code with example usage: obj.allocate_spike_ensembles() and returns: spike_ensembles, wrapper