code: def test_deprecation(monkeypatch):
      monkeypatch.setitem(
          mpl._deprecated_map,
          "patch.linewidth",
          (
              "0.0",
              "axes.linewidth",
              lambda old: 2 * old,
              lambda new: new / 2,
          ),
      )
      with pytest.warns(mpl.MatplotlibDeprecationWarning):
          assert (
              mpl.rcParams["patch.linewidth"]
              == mpl.rcParams["axes.linewidth"] / 2
          )
      with pytest.warns(mpl.MatplotlibDeprecationWarning):
          mpl.rcParams["patch.linewidth"] = 1
      assert mpl.rcParams["axes.linewidth"] == 2
  
      monkeypatch.setitem(
          mpl._deprecated_ignore_map,
          "patch.edgecolor",
          ("0.0", "axes.edgecolor"),
      )
      with pytest.warns(mpl.MatplotlibDeprecationWarning):
          assert (
              mpl.rcParams["patch.edgecolor"]
              == mpl.rcParams["axes.edgecolor"]
          )
      with pytest.warns(mpl.MatplotlibDeprecationWarning):
          mpl.rcParams["patch.edgecolor"] = "#abcd"
      assert mpl.rcParams["axes.edgecolor"] != "#abcd"
  
      monkeypatch.setitem(
          mpl._deprecated_ignore_map,
          "patch.force_edgecolor",
          ("0.0", None),
      )
      with pytest.warns(mpl.MatplotlibDeprecationWarning):
          assert mpl.rcParams["patch.force_edgecolor"] is None
  
      monkeypatch.setitem(
          mpl._deprecated_remain_as_none, "svg.hashsalt", ("0.0",)
      )
      with pytest.warns(mpl.MatplotlibDeprecationWarning):
          mpl.rcParams["svg.hashsalt"] = "foobar"
      assert mpl.rcParams["svg.hashsalt"] == "foobar"  # Doesn't warn.
      mpl.rcParams["svg.hashsalt"] = None  # Doesn't warn.
  
      mpl.rcParams.update(mpl.rcParams.copy())
  
imports: import copy
  import os
  import subprocess
  import sys
  from unittest import mock
  from cycler import cycler, Cycler
  import pytest
  import matplotlib
  from matplotlib import _api, _c_internal_utils
  import matplotlib.pyplot
  import matplotlib.colors
  import numpy
  from matplotlib.rcsetup import validate_bool, validate_color, validate_colorlist, _validate_color_or_linecolor, validate_cycler, validate_float, validate_fontstretch, validate_fontweight, validate_hatch, validate_hist_bins, validate_int, validate_markevery, validate_stringlist, validate_sketch, _validate_linestyle, _listify_validator
label_desc: Use image node_id 23 for calling a global function with example usage: test_deprecation(monkeypatch) without return types