code: def create_hparams(
      hparams_set,
      hparams_overrides_str="",
      data_dir=None,
      problem_name=None,
      hparams_path=None,
  ):
      """Create HParams with data_dir and problem hparams, if kwargs provided."""
      hparams = registry.hparams(hparams_set)
      if hparams_path and tf.gfile.Exists(hparams_path):
          hparams = create_hparams_from_json(hparams_path, hparams)
      if data_dir:
          hparams.add_hparam("data_dir", data_dir)
      if hparams_overrides_str:
          tf.logging.info(
              "Overriding hparams in %s with %s",
              hparams_set,
              hparams_overrides_str,
          )
          hparams = hparams.parse(hparams_overrides_str)
      if problem_name:
          add_problem_hparams(hparams, problem_name)
      return hparams
  
file_path: tensor2tensor/tensor2tensor/utils/hparams_lib.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import json
  from tensor2tensor.data_generators import problem
  from tensor2tensor.utils import hparam
  from tensor2tensor.utils import registry
  import tensorflow.compat.v1
label_desc: Use image node_id 2 for calling a global function with example usage: create_hparams(hparams_set, hparams_overrides_str, data_dir, problem_name, hparams_path) and returns: hparams