code: def restore(self, fd: IO):
      states = torch.load(fd, map_location="cpu")
  
      unexpected_keys = set(states.keys()) - set(self.name_to_stateful)
      missing_keys = set(self.name_to_stateful) - set(states.keys())
      # Fix code below and remove pylint comment.
      # pylint: disable=consider-using-f-string
      if len(unexpected_keys) > 0:
          warnings.warn(
              "Unexpected key(s): {}.".format(
                  ", ".join('"{}"'.format(*unexpected_keys))
              )
          )
      if len(missing_keys) > 0:
          warnings.warn(
              "Missing key(s): {}.".format(
                  ", ".join('"{}"'.format(*missing_keys))
              )
          )
  
      for name, state in states.items():
          if name in self.name_to_stateful:
              self.name_to_stateful[name].load_state_dict(state)
  
imports: import warnings
  from typing import IO, Dict
  import torch
  from poutyne.framework.callbacks.lr_scheduler import ReduceLROnPlateau, _PyTorchLRSchedulerWrapper
  from poutyne.framework.callbacks.periodic import PeriodicSaveCallback
  from poutyne.utils import load_random_states, save_random_states
label_desc: Use image node_id 3 for calling the StateCheckpoint obj's underlying member method code with example usage: obj.restore(fd) without return types