code: def fetch_config(args):
      """Return the config inside the .yaml file if present."""
      orion_file = args.get("config")
      local_config = {}
      if orion_file:
          log.debug(
              "Found orion configuration file at: %s",
              os.path.abspath(orion_file.name),
          )
          orion_file.seek(0)
          tmp_config = yaml.safe_load(orion_file)
  
          global_config = orion.core.config.to_dict()
  
          tmp_config = _convert_dashes(tmp_config, global_config)
  
          # Fix deprecations first because some names are shared by experiment and worker
          max_trials = tmp_config.pop("max_trials", None)
          if max_trials is not None:
              log.warning(
                  "(DEPRECATED) Option `max_trials` is deprecated "
                  "and will be removed in v0.3. Use instead the option"
                  "\nexperiment:\n  max_trials: %s",
                  max_trials,
              )
              local_config["experiment.max_trials"] = max_trials
  
          worker_trials = tmp_config.get("experiment", {}).pop(
              "worker_trials", None
          )
          if worker_trials is not None:
              log.warning(
                  "(DEPRECATED) Option `experiment.worker_trials` is deprecated "
                  "and will be removed in v0.3. Use instead the option"
                  "\nworker:\n  max_trials: %s",
                  worker_trials,
              )
              local_config["worker.max_trials"] = worker_trials
  
          worker_trials = tmp_config.pop("worker_trials", None)
          if worker_trials is not None:
              log.warning(
                  "(DEPRECATED) Option `worker_trials` is deprecated "
                  "and will be removed in v0.3. Use instead the option"
                  "\nworker:\n  max_trials: %s",
                  worker_trials,
              )
              local_config["worker.max_trials"] = worker_trials
  
          # TODO: Remove for v0.3
          producer = tmp_config.pop("producer", None)
          if producer is not None:
              log.warning(
                  "(DEPRECATED) Option `producer` is deprecated "
                  "and will be removed in v0.3. Use instead the option"
                  "\nexperiment:\n  strategy: %s",
                  producer["strategy"],
              )
              local_config["experiment.strategy"] = producer["strategy"]
  
          # TODO: Remove for v0.3
          producer = tmp_config.get("experiment", {}).pop(
              "producer", None
          )
          if producer is not None:
              log.warning(
                  "(DEPRECATED) Option `experiment.producer` is deprecated "
                  "and will be removed in v0.3. Use instead the option"
                  "\nexperiment:\n  strategy: %s",
                  producer["strategy"],
              )
              local_config["experiment.strategy"] = producer["strategy"]
  
          local_config = unflatten(local_config)
  
          backward_keys = ["storage", "experiment", "worker", "evc"]
          # For backward compatibility
          for key in backward_keys:
              subkeys = list(global_config[key].keys())
  
              # Arguments that are only supported locally
              if key == "experiment":
                  subkeys += ["name", "version", "user"]
              elif key == "evc":
                  subkeys += ["branch_from", "branch_to"]
  
              for subkey in subkeys:
                  # Backward compatibility
                  backward_value = tmp_config.pop(subkey, None)
                  if backward_value is not None:
                      log.warning(
                          "(DEPRECATED) Option `%s` and will be removed in v0.3. "
                          "Use instead the option"
                          "\n%s:\n  %s:\n    %s",
                          subkey,
                          key,
                          subkey,
                          yaml.dump(backward_value, indent=6),
                      )
                  value = tmp_config.get(key, {}).pop(
                      subkey, backward_value
                  )
                  if value is not None:
                      local_config.setdefault(key, {})
                      local_config[key][subkey] = value
  
          # Keep other keys parsed from config file
          for key in tmp_config.keys():
              if key not in backward_keys:
                  local_config[key] = tmp_config[key]
  
      return local_config
  
imports: import copy
  import getpass
  import hashlib
  import logging
  import os
  import git
  import yaml
  from numpy import inf
  import orion
  import orion.core
  from orion.core.io.orion_cmdline_parser import OrionCmdlineParser
  from orion.core.utils.flatten import unflatten
label_desc: Use image node_id 4 for calling a global function with example usage: fetch_config(args) and returns: local_config