code: def dump_session_params(path):
      """
      Dump value of all TRAINABLE + MODEL variables to a dict, and save as
      npz format (loadable by :func:`sessinit.SmartInit`).
  
      Args:
          path(str): the file name to save the parameters. Must ends with npz.
      """
      # save variables that are GLOBAL, and either TRAINABLE or MODEL
      var = tfv1.get_collection(tfv1.GraphKeys.TRAINABLE_VARIABLES)
      var.extend(tfv1.get_collection(tfv1.GraphKeys.MODEL_VARIABLES))
      # TODO dedup
      assert len(set(var)) == len(
          var
      ), "TRAINABLE and MODEL variables have duplication!"
      gvars = {k.name for k in tfv1.global_variables()}
      var = [v for v in var if v.name in gvars]
      result = {}
      for v in var:
          result[v.name] = v.eval()
      save_checkpoint_vars(result, path)
  
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 2 for calling a global function with example usage: dump_session_params(path) without return types