code: def test_fetch_config_deprecated_max_trials(monkeypatch, config_file):
      """Verify fetch_config will overwrite deprecated value if also properly defined."""
  
      def mocked_config(file_object):
          return {"experiment": {"max_trials": 10}, "max_trials": 20}
  
      monkeypatch.setattr("yaml.safe_load", mocked_config)
  
      config = resolve_config.fetch_config({"config": config_file})
  
      assert config == {"experiment": {"max_trials": 10}}
  
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 18 for calling a global function with example usage: test_fetch_config_deprecated_max_trials(monkeypatch, config_file) and returns: dict