code: def test_signal_func_stop_iteration(self):
      def stop_training_after_the_5th_epoch(network):
          if network.last_epoch == 5:
              raise StopTraining("Stopped training")
  
      network = train_network(
          epochs=10,
          batch_size=None,
          signals=stop_training_after_the_5th_epoch,
      )
  
      self.assertEqual(network.last_epoch, 5)
  
imports: from __future__ import unicode_literals
  from collections import namedtuple
  import numpy
  import progressbar
  from sklearn.datasets import make_classification
  from neupy import algorithms, layers
  from neupy.exceptions import StopTraining
  from neupy.algorithms.signals import format_time
  from base import BaseTestCase
  from helpers import catch_stdout
label_desc: Use image node_id 2 for calling the SignalsTestCase obj's underlying member method code with example usage: obj.test_signal_func_stop_iteration() without return types