code: def parse_gin(restore_dir):
      """Parse gin config from --gin_file, --gin_param, and the model directory."""
      # Enable parsing gin files on Google Cloud.
      gin.config.register_file_reader(
          tf.io.gfile.GFile, tf.io.gfile.exists
      )
      # Add user folders to the gin search path.
      for gin_search_path in [GIN_PATH] + FLAGS.gin_search_path:
          gin.add_config_file_search_path(gin_search_path)
  
      # Parse gin configs, later calls override earlier ones.
      with gin.unlock_config():
          # Optimization defaults.
          use_tpu = bool(FLAGS.tpu)
          opt_default = "base.gin" if not use_tpu else "base_tpu.gin"
          gin.parse_config_file(
              os.path.join("optimization", opt_default)
          )
          eval_default = "eval/basic.gin"
          gin.parse_config_file(eval_default)
  
          # Load operative_config if it exists (model has already trained).
          try:
              operative_config = train_util.get_latest_operative_config(
                  restore_dir
              )
              logging.info(
                  "Using operative config: %s", operative_config
              )
              operative_config = cloud.make_file_paths_local(
                  operative_config, GIN_PATH
              )
              gin.parse_config_file(operative_config, skip_unknown=True)
          except FileNotFoundError:
              logging.info(
                  "Operative config not found in %s", restore_dir
              )
  
          # User gin config and user hyperparameters from flags.
          gin_file = cloud.make_file_paths_local(
              FLAGS.gin_file, GIN_PATH
          )
          gin.parse_config_files_and_bindings(
              gin_file, FLAGS.gin_param, skip_unknown=True
          )
  
file_path: ddsp/ddsp/training/ddsp_run.py
imports: import os
  import time
  from absl import app
  from absl import flags
  from absl import logging
  from ddsp.training import cloud
  from ddsp.training import eval_util
  from ddsp.training import models
  from ddsp.training import train_util
  from ddsp.training import trainers
  import gin
  import pkg_resources
  import tensorflow
label_desc: Use image node_id 2 for calling a global function with example usage: parse_gin(restore_dir) without return types