code: def config_replace(replacement_dict):
      """
      Provides a context manager to replace the ``cartopy.config['downloaders']``
      dict with the given dictionary. Great for testing purposes!
  
      """
      with contextlib.ExitStack() as stack:
          stack.callback(
              cartopy.config.__setitem__,
              "downloaders",
              cartopy.config["downloaders"],
          )
          cartopy.config["downloaders"] = replacement_dict
  
          yield
  
file_path: cartopy/lib/cartopy/tests/io/test_downloaders.py
imports: import contextlib
  from pathlib import Path
  from unittest import mock
  import pytest
  import cartopy
  import cartopy.io
  from cartopy.io.shapereader import NEShpDownloader
label_desc: Use image node_id 2 for calling a global function with example usage: config_replace(replacement_dict) without return types