code: def test_backend_fallback_headful(tmp_path):
      pytest.importorskip("tkinter")
      env = {
          **os.environ,
          "MPLBACKEND": "",
          "MPLCONFIGDIR": str(tmp_path),
      }
      backend = subprocess.check_output(
          [
              sys.executable,
              "-c",
              "import matplotlib as mpl; "
              "sentinel = mpl.rcsetup._auto_backend_sentinel; "
              # Check that access on another instance does not resolve the sentinel.
              "assert mpl.RcParams({'backend': sentinel})['backend'] == sentinel; "
              "assert mpl.rcParams._get('backend') == sentinel; "
              "import matplotlib.pyplot; "
              "print(matplotlib.get_backend())",
          ],
          env=env,
          text=True,
      )
      # The actual backend will depend on what's installed, but at least tkagg is
      # present.
      assert backend.strip().lower() != "agg"
  
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 22 for calling a global function with example usage: test_backend_fallback_headful(tmp_path) without return types