code: def test_fetch_config_global_local_coherence(
      monkeypatch, config_file
  ):
      """Verify fetch_config parses local config according to global config structure."""
  
      def mocked_config(file_object):
          return orion.core.config.to_dict()
  
      monkeypatch.setattr("yaml.safe_load", mocked_config)
  
      config = resolve_config.fetch_config({"config": config_file})
  
      # Test storage subconfig
      storage_config = config.pop("storage")
      database_config = storage_config.pop("database")
      assert (
          storage_config.pop("type") == orion.core.config.storage.type
      )
      assert storage_config == {}
  
      assert (
          database_config.pop("host")
          == orion.core.config.storage.database.host
      )
      assert (
          database_config.pop("name")
          == orion.core.config.storage.database.name
      )
      assert (
          database_config.pop("port")
          == orion.core.config.storage.database.port
      )
      assert (
          database_config.pop("type")
          == orion.core.config.storage.database.type
      )
  
      assert database_config == {}
  
      # Test experiment subconfig
      exp_config = config.pop("experiment")
      assert (
          exp_config.pop("max_trials")
          == orion.core.config.experiment.max_trials
      )
      assert (
          exp_config.pop("max_broken")
          == orion.core.config.experiment.max_broken
      )
      assert (
          exp_config.pop("working_dir")
          == orion.core.config.experiment.working_dir
      )
      assert (
          exp_config.pop("algorithm")
          == orion.core.config.experiment.algorithm
      )
      # TODO: Remove for v0.4
      assert (
          exp_config.pop("algorithms")
          == orion.core.config.experiment.algorithms
      )
      # TODO: Remove for v0.4
      assert (
          exp_config.pop("strategy")
          == orion.core.config.experiment.strategy
      )
  
      assert exp_config == {}
  
      # Test worker subconfig
      worker_config = config.pop("worker")
      assert (
          worker_config.pop("n_workers")
          == orion.core.config.worker.n_workers
      )
      assert (
          worker_config.pop("pool_size")
          == orion.core.config.worker.pool_size
      )
      assert (
          worker_config.pop("executor")
          == orion.core.config.worker.executor
      )
      assert (
          worker_config.pop("executor_configuration")
          == orion.core.config.worker.executor_configuration
      )
      assert (
          worker_config.pop("heartbeat")
          == orion.core.config.worker.heartbeat
      )
      assert (
          worker_config.pop("max_trials")
          == orion.core.config.worker.max_trials
      )
      assert (
          worker_config.pop("max_broken")
          == orion.core.config.worker.max_broken
      )
      assert (
          worker_config.pop("max_idle_time")
          == orion.core.config.worker.max_idle_time
      )
      assert (
          worker_config.pop("idle_timeout")
          == orion.core.config.worker.idle_timeout
      )
      assert (
          worker_config.pop("interrupt_signal_code")
          == orion.core.config.worker.interrupt_signal_code
      )
      assert (
          worker_config.pop("user_script_config")
          == orion.core.config.worker.user_script_config
      )
  
      assert worker_config == {}
  
      # Test evc subconfig
      evc_config = config.pop("evc")
      assert evc_config.pop("enable") is orion.core.config.evc.enable
      assert (
          evc_config.pop("auto_resolution")
          == orion.core.config.evc.auto_resolution
      )
      assert (
          evc_config.pop("manual_resolution")
          == orion.core.config.evc.manual_resolution
      )
      assert (
          evc_config.pop("non_monitored_arguments")
          == orion.core.config.evc.non_monitored_arguments
      )
      assert (
          evc_config.pop("ignore_code_changes")
          == orion.core.config.evc.ignore_code_changes
      )
      assert (
          evc_config.pop("algorithm_change")
          == orion.core.config.evc.algorithm_change
      )
      assert (
          evc_config.pop("orion_version_change")
          == orion.core.config.evc.orion_version_change
      )
      assert (
          evc_config.pop("code_change_type")
          == orion.core.config.evc.code_change_type
      )
      assert (
          evc_config.pop("cli_change_type")
          == orion.core.config.evc.cli_change_type
      )
      assert (
          evc_config.pop("config_change_type")
          == orion.core.config.evc.config_change_type
      )
  
      assert evc_config == {}
  
      # Test remaining config
      assert config.pop("debug") is False
      assert config.pop("frontends_uri") == []
  
      # Confirm that all fields were tested.
      assert config == {}
  
imports: import hashlib
  import logging
  import os
  import shutil
  import git
  import pytest
  import orion.core
  import orion.core.io.resolve_config
label_desc: Use image node_id 15 for calling a global function with example usage: test_fetch_config_global_local_coherence(monkeypatch, config_file) and returns: orion