code: def test_state_dict(self):
      stopper = EarlyStopping(monitor="test_metric_1")
      stopper.wait = 10
      stopper.best = 20
      state = stopper.state_dict()
  
      stopper = EarlyStopping(monitor="test_metric_1")
      self.assertNotEqual(stopper.wait, 10)
  
      stopper.load_state_dict(state)
      self.assertEqual(stopper.wait, 10)
      self.assertEqual(stopper.best, 20)
  
imports: from unittest import TestCase
  from mock import MagicMock
  import torchbearer
  from torchbearer.callbacks import EarlyStopping
label_desc: Use image node_id 16 for calling the TestEarlyStopping obj's underlying member method code with example usage: obj.test_state_dict() without return types