code: def _process_config():
      # Loads configs
      config = utils.load_config(FLAGS.config_paths)
  
      # Parses YAML FLAGS
      FLAGS.model_hparams = yaml.load(FLAGS.model_hparams)
      FLAGS.data_hparams_train = yaml.load(FLAGS.data_hparams_train)
      FLAGS.data_hparams_eval = yaml.load(FLAGS.data_hparams_eval)
  
      # Merges
      final_config = {}
      for flag_key in dir(FLAGS):
          if flag_key in {
              "h",
              "help",
              "helpshort",
          }:  # Filters out help flags
              continue
          flag_value = getattr(FLAGS, flag_key)
          config_value = config.get(flag_key, None)
          if isinstance(flag_value, dict) and isinstance(
              config_value, dict
          ):
              final_config[flag_key] = utils.dict_patch(
                  config_value, flag_value
              )
          elif flag_key in config:
              final_config[flag_key] = config_value
          else:
              final_config[flag_key] = flag_value
  
      # Processes
      if final_config["model_dir"] is None:
          final_config["model_dir"] = tempfile.mkdtemp()
  
      if (
          final_config["save_checkpoints_steps"] is None
          and final_config["save_checkpoints_secs"] is None
      ):
          final_config["save_checkpoints_secs"] = 600
      if (
          final_config["save_checkpoints_steps"] == -1
          and final_config["save_checkpoints_secs"] == -1
      ):
          final_config["save_checkpoints_steps"] = None
          final_config["save_checkpoints_secs"] = None
  
      tf.logging.info("Final Config:\n%s", yaml.dump(final_config))
  
      return final_config
  
file_path: texar/bin/train.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  import tempfile
  import yaml
  import tensorflow
  from texar.tf import utils
  from texar.tf.run import Executor
label_desc: Use image node_id 1 for calling a global function with example usage: _process_config() and returns: final_config