code: def create_or_load_hparams(
      out_dir, default_hparams, hparams_path, save_hparams=True
  ):
      """Create hparams or load hparams from out_dir."""
      hparams = utils.load_hparams(out_dir)
      if not hparams:
          hparams = default_hparams
          hparams = utils.maybe_parse_standard_hparams(
              hparams, hparams_path
          )
      else:
          hparams = ensure_compatible_hparams(
              hparams, default_hparams, hparams_path
          )
      hparams = extend_hparams(hparams)
  
      # Save HParams
      if save_hparams:
          utils.save_hparams(out_dir, hparams)
          for metric in hparams.metrics:
              utils.save_hparams(
                  getattr(hparams, "best_" + metric + "_dir"), hparams
              )
  
      # Print HParams
      utils.print_hparams(hparams)
      return hparams
  
imports: from __future__ import print_function
  import argparse
  import os
  import random
  import sys
  import numpy
  import tensorflow
  from nlp_architect.utils import io
  from .None import inference
  from .None import train
  from .gnmt.utils import misc_utils, vocab_utils, evaluation_utils
label_desc: Use image node_id 11 for calling a global function with example usage: create_or_load_hparams(out_dir, default_hparams, hparams_path, save_hparams) and returns: hparams