code: def test_to_console(self, mock_print):
      if sys.version_info[0] >= 3:
          callback = PyCM()
          callback.to_console()
          callback._handlers[0]("cm", {})
          mock_print.assert_called_once_with("cm")
  
imports: import sys
  from unittest import TestCase
  from mock import MagicMock, patch, ANY
  import torchbearer
  from torchbearer.callbacks import PyCM
  import matplotlib.pyplot
label_desc: Use image node_id 8 for calling the TestPyCM obj's underlying member method code with example usage: obj.test_to_console(mock_print) without return types