code: def map_state_dict(checkpoint: Dict, state_dict_name: str = None):
      if state_dict_name and state_dict_name in checkpoint:
          old_state_dict = checkpoint[state_dict_name]
      else:
          old_state_dict = checkpoint
  
      new_state_dict = OrderedDict()
      for k, v in old_state_dict.items():
          # strip `module.` prefix
          name = k[7:] if k.startswith("module") else k
          new_state_dict[name] = v
      return new_state_dict
  
imports: from collections import OrderedDict
  from typing import Dict
  import torch
label_desc: Use image node_id 1 for calling a global function with example usage: map_state_dict(checkpoint, state_dict_name) and returns: new_state_dict