code: def test_to_state(self):
      if sys.version_info[0] >= 3:
          callback = PyCM()
          callback.to_state("test")
          out = {}
          callback._handlers[0]("cm", out)
          self.assertTrue("test" in out)
          self.assertTrue(out["test"] == "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 7 for calling the TestPyCM obj's underlying member method code with example usage: obj.test_to_state() without return types