code: def parse_model_state(file):
      state_dict = torch.load(file, map_location=device)
  
      if BUFFER_NAMES not in state_dict:
          raise ValueError(f"{file} is not a model state checkpoint")
      buffer_names = state_dict[BUFFER_NAMES]
      if debug:
          print("Found buffers:", buffer_names)
  
      # recover just the buffers while restoring them to fp32 if they were saved in fp16
      buffers = {
          k: v.float()
          for k, v in state_dict["module"].items()
          if k in buffer_names
      }
      param_shapes = state_dict[PARAM_SHAPES]
  
      ds_version = state_dict.get(DS_VERSION, None)
  
      return buffers, param_shapes, ds_version
  
imports: import argparse
  import torch
  import glob
  import math
  import os
  import re
  from collections import OrderedDict
  from deepspeed.utils import logger
  from deepspeed.checkpoint.constants import DS_VERSION, OPTIMIZER_STATE_DICT, SINGLE_PARTITION_OF_FP32_GROUPS, FP32_FLAT_GROUPS, ZERO_STAGE, PARTITION_COUNT, PARAM_SHAPES, BUFFER_NAMES
label_desc: Use image node_id 5 for calling a global function with example usage: parse_model_state(file) and returns: buffers,  param_shapes,  ds_version