class_docstr: !
  @brief Model of phase oscillatory network for pattern recognition that is based on the Kuramoto model.
  @details The model uses second-order and third-order modes of the Fourier components.
  
  Example:
  @code
      # Network size should be equal to size of pattern for learning.
      net = syncpr(size_network, 0.3, 0.3);
      
      # Train network using list of patterns (input images).
      net.train(image_samples);
      
      # Recognize image using 10 steps during 10 seconds of simulation.
      sync_output_dynamic = net.simulate(10, 10, pattern, solve_type.RK4, True);
      
      # Display output dynamic.
      syncpr_visualizer.show_output_dynamic(sync_output_dynamic);
      
      # Display evolution of recognition of the pattern.
      syncpr_visualizer.show_pattern(sync_output_dynamic, image_height, image_width);
  
  @endcode
class_docstr_tok: ["!","@","brief","Model","of","phase","oscillatory","network","for","pattern","recognition","that","is","based","on","the","Kuramoto","model",".","@","details","The","model","uses","second-order","and","third-order","modes","of","the","Fourier","components",".","Example",":","@","code","#","Network","size","should","be","equal","to","size","of","pattern","for","learning",".","net","=","syncpr","(","size_network",",","0.3",",","0.3",")",";","#","Train","network","using","list","of","patterns","(","input","images",")",".","net.train","(","image_samples",")",";","#","Recognize","image","using","10","steps","during","10","seconds","of","simulation",".","sync_output_dynamic","=","net.simulate","(","10",",","10",",","pattern",",","solve_type.RK4",",","True",")",";","#","Display","output","dynamic",".","syncpr_visualizer.show_output_dynamic","(","sync_output_dynamic",")",";","#","Display","evolution","of","recognition","of","the","pattern",".","syncpr_visualizer.show_pattern","(","sync_output_dynamic",",","image_height",",","image_width",")",";","@","endcode"]
docstr: !
  @brief Validates pattern.
  @details Throws exception if length of pattern is not equal to size of the network or if it consists feature with value that are not equal to [-1; 1].
  
  @param[in] pattern (list): Pattern for recognition represented by list of features that are equal to [-1; 1].
docstr_tok: ["!","@","brief","Validates","pattern",".","@","details","Throws","exception","if","length","of","pattern","is","not","equal","to","size","of","the","network","or","if","it","consists","feature","with","value","that","are","not","equal","to","[","-1",";","1","]",".","@","param","[","in","]","pattern","(","list",")",":","Pattern","for","recognition","represented","by","list","of","features","that","are","equal","to","[","-1",";","1","]","."]
code: def __validate_pattern(self, pattern):
      """!
      @brief Validates pattern.
      @details Throws exception if length of pattern is not equal to size of the network or if it consists feature with value that are not equal to [-1; 1].
  
      @param[in] pattern (list): Pattern for recognition represented by list of features that are equal to [-1; 1].
  
      """
      if len(pattern) != len(self):
          raise NameError(
              "Length of the pattern ('%d') should be equal to size of the network."
              % len(pattern)
          )
  
      for feature in pattern:
          if (feature != -1.0) and (feature != 1.0):
              raise NameError(
                  "Patten feature ('%s') should be distributed in [-1; 1]."
                  % feature
              )
  
imports: import math
  import cmath
  import numpy
  from pyclustering.nnet import solve_type, initial_type, conn_type, conn_represent
  from pyclustering.nnet.sync import sync_network, sync_dynamic, sync_visualizer
  import pyclustering.core.syncpr_wrapper
  from pyclustering.core.wrapper import ccore_library
  from PIL import Image
  import matplotlib.pyplot
  import matplotlib.animation
label_desc: Use image node_id 11 for calling the syncpr obj's underlying member method code with example usage: obj.__validate_pattern(pattern) without return types