code: def iteration_listener(self, sender, **msg):
      msg = msg["iter_msg"]
      self.assertRegexpMatches(msg.to_console_string(), "mean")
      self.assertRegexpMatches(msg.to_console_string(), "var")
  
file_path: NiftyNet/tests/handler_console_test.py
imports: from __future__ import absolute_import, print_function
  import tensorflow
  from tests.application_driver_test import get_initialised_driver
  from niftynet.engine.application_iteration import IterationMessage
  from niftynet.engine.signal import SESS_STARTED, ITER_FINISHED
  from tests.niftynet_testcase import NiftyNetTestCase
label_desc: Use image node_id 2 for calling the EventConsoleTest obj's underlying member method code with example usage: obj.iteration_listener(sender) without return types