code: def load_checkpoint_vars(path):
      """Load all variables from a checkpoint to a dict.
  
      Args:
          path(str): path to a checkpoint.
  
      Returns:
          dict: a name:value dict
      """
      if path.endswith(".npz"):
          ret = dict(np.load(path))
          ret = {get_op_tensor_name(k)[0]: v for k, v in ret.items()}
          return ret
      path = get_checkpoint_path(path)
      reader = tfv1.train.NewCheckpointReader(path)
      var_names = reader.get_variable_to_shape_map().keys()
      result = {}
      for n in var_names:
          result[n] = reader.get_tensor(n)
      return result
  
imports: import glob
  import operator
  import numpy
  import os
  import pprint
  import six
  import tensorflow
  from ..compat import tfv1
  from ..utils import logger
  from .common import get_op_tensor_name
label_desc: Use image node_id 6 for calling a global function with example usage: load_checkpoint_vars(path) and returns: result, ret