code: def save_hparams(out_dir, hparams):
      """Save hparams."""
      hparams_file = os.path.join(out_dir, "hparams")
      print_out("  saving hparams to %s" % hparams_file)
      with codecs.getwriter("utf-8")(
          tf.gfile.GFile(hparams_file, "wb")
      ) as f:
          f.write(hparams.to_json(indent=4, sort_keys=True))
  
imports: from __future__ import print_function
  import codecs
  import collections
  import json
  import math
  import os
  import sys
  import time
  from distutils import version
  import tensorflow
label_desc: Use image node_id 8 for calling a global function with example usage: save_hparams(out_dir, hparams) without return types