code: def load_and_parse_state_dict(
      filepath="./data/checkpoint-150000.pth.tar",
  ):
      checkpoint = torch.load(
          filepath, map_location=torch.device("cpu")
      )
      if "state_dict" in checkpoint:
          checkpoint = checkpoint["state_dict"]
      result = dict()
      for k, v in checkpoint.items():
          if k.startswith("module."):
              k = k[len("module.") :]
          result[k] = v
      return result
  
file_path: nni/examples/nas/legacy/oneshot/spos/network.py
imports: import os
  import pickle
  import re
  import torch
  import nni.retiarii.nn.pytorch
  from nni.retiarii.nn.pytorch import LayerChoice
  from nni.retiarii.serializer import model_wrapper
  from blocks import ShuffleNetBlock, ShuffleXceptionBlock
label_desc: Use image node_id 1 for calling a global function with example usage: load_and_parse_state_dict(filepath) and returns: result