code: def test_config_hook_updates_config(ex):
      @ex.config
      def cfg():
          a = "hello"
  
      @ex.config_hook
      def hook(config, command_name, logger):
          config.update({"a": "me"})
          return config
  
      @ex.main
      def foo():
          pass
  
      r = ex.run()
      assert r.config["a"] == "me"
  
imports: from sacred import Ingredient
  from mock import patch
  import pytest
  import sys
  from sacred import cli_option
  from sacred import host_info_gatherer
  from sacred.experiment import Experiment
  from sacred.utils import apply_backspaces_and_linefeeds, ConfigAddedError, SacredError
label_desc: Use image node_id 17 for calling a global function with example usage: test_config_hook_updates_config(ex) and returns: config