code: def load_state_dict_unsafe(model, state_dict):
      """
      Load state dict to provided model while ignore exceptions.
      """
  
      missing_keys = []
      unexpected_keys = []
      error_msgs = []
  
      # copy state_dict so _load_from_state_dict can modify it
      metadata = getattr(state_dict, "_metadata", None)
      state_dict = state_dict.copy()
      if metadata is not None:
          state_dict._metadata = metadata
  
      def load(module, prefix=""):
          local_metadata = (
              {} if metadata is None else metadata.get(prefix[:-1], {})
          )
          module._load_from_state_dict(
              state_dict,
              prefix,
              local_metadata,
              True,
              missing_keys,
              unexpected_keys,
              error_msgs,
          )
          for name, child in module._modules.items():
              if child is not None:
                  load(child, prefix + name + ".")
  
      load(model)
      load = None  # break load->load reference cycle
  
      return {
          "unexpected_keys": unexpected_keys,
          "missing_keys": missing_keys,
          "error_msgs": error_msgs,
      }
  
imports: import io
  import os
  import copy
  import math
  import json
  import numpy
  import pandas
  import matplotlib.pyplot
  import torch
  import torch.nn
  import torch.optim
  import torch.nn.functional
  from tqdm import tqdm
  from qlib.constant import EPS
  from qlib.log import get_module_logger
  from qlib.model.base import Model
  from qlib.contrib.data.dataset import MTSDatasetH
label_desc: Use image node_id 8 for calling a global function with example usage: load_state_dict_unsafe(model, state_dict) and returns: dict