code: def test_calls(self):
      timer = TimerMetric("test")
      timer.batch_timer = MagicMock()
      timer.epoch_timer = MagicMock()
      timer.train_timer = MagicMock()
      timer.total_timer = MagicMock()
      timer.valid_timer = MagicMock()
  
      timer.on_start({})
      timer.on_start_training({})
      timer.on_start_epoch({})
      timer.on_sample({})
      timer.on_forward({})
      timer.on_criterion({})
      timer.on_backward({})
      timer.on_step_training({})
      timer.on_start_validation({})
      timer.on_sample_validation({})
      timer.on_forward_validation({})
      timer.on_criterion_validation({})
      timer.on_step_validation({})
      timer.on_end_training({})
      timer.on_end_validation({})
      timer.on_end_epoch({})
      timer.on_end({})
  
      self.assertTrue(timer.batch_timer.process.call_count == 11)
      self.assertTrue(timer.total_timer.process.call_count == 1)
      self.assertTrue(timer.epoch_timer.process.call_count == 1)
      self.assertTrue(timer.train_timer.process.call_count == 2)
      self.assertTrue(timer.valid_timer.process.call_count == 1)
  
file_path: torchbearer/tests/metrics/test_timer.py
imports: from unittest import TestCase
  from mock import Mock, MagicMock, patch
  import torchbearer
  from torchbearer.metrics.timer import TimerMetric, _TimerMetric
label_desc: Use image node_id 2 for calling the TestTimer obj's underlying member method code with example usage: obj.test_calls() without return types