code: def setdefault_config(config):
      """set default config"""
      # This function only sets up those most commonly used parameters
      # which may not change frequently.
  
      config.setdefault("tfenv", dict())
      tfconf = config["tfenv"]
      tfconf.setdefault("allow_soft_placement", True)
      tfconf.setdefault("log_device_placement", True)
      tfconf.setdefault("intra_op_parallelism_threads", 10)
      tfconf.setdefault("inter_op_parallelism_threads", 10)
      tfconf.setdefault("allow_growth", False)
      tfconf.setdefault("embedding_trainable", True)
      tfconf.setdefault("use_pretrained_embedding", False)
  
      model_conf = config["model"]
      optimizer_conf = model_conf["optimizer"]
      optimizer_conf.setdefault("dropout_keep_prob", 0.0)
  
      data_conf = config["data"]
      saver_conf = data_conf["saver"]
      saver_conf.setdefault("max_to_keep", 50)
      saver_conf.setdefault("checkpoint_every", 500)
      saver_conf.setdefault("evaluate_on_dev_every", 500)
      timestamp = str(int(time.time()))
      out_dir = os.path.abspath(
          os.path.join("/tmp", "tf_runs", timestamp)
      )
      saver_conf.setdefault("outdir", out_dir)
      saver_conf.setdefault("resume_model_path", out_dir)
      if not os.path.exists(out_dir):
          os.makedirs(out_dir)
      logging.info("Create temp output directory: {}\n".format(out_dir))
  
      data_conf.setdefault("outdir", out_dir)
      data_conf.setdefault("vocab", out_dir + "/vocab")
      data_conf.setdefault("label", out_dir + "/label")
  
      return config
  
file_path: delta/delta/utils/config.py
imports: from typing import List, Union
  import os
  import json
  import time
  from shutil import copyfile, SameFileError
  from pathlib import Path
  import yaml
  from absl import logging
label_desc: Use image node_id 7 for calling a global function with example usage: setdefault_config(config) and returns: config