code: def test_rcparams(tmp_path):
      mpl.rc("text", usetex=False)
      mpl.rc("lines", linewidth=22)
  
      usetex = mpl.rcParams["text.usetex"]
      linewidth = mpl.rcParams["lines.linewidth"]
  
      rcpath = tmp_path / "test_rcparams.rc"
      rcpath.write_text("lines.linewidth: 33", encoding="utf-8")
  
      # test context given dictionary
      with mpl.rc_context(rc={"text.usetex": not usetex}):
          assert mpl.rcParams["text.usetex"] == (not usetex)
      assert mpl.rcParams["text.usetex"] == usetex
  
      # test context given filename (mpl.rc sets linewidth to 33)
      with mpl.rc_context(fname=rcpath):
          assert mpl.rcParams["lines.linewidth"] == 33
      assert mpl.rcParams["lines.linewidth"] == linewidth
  
      # test context given filename and dictionary
      with mpl.rc_context(fname=rcpath, rc={"lines.linewidth": 44}):
          assert mpl.rcParams["lines.linewidth"] == 44
      assert mpl.rcParams["lines.linewidth"] == linewidth
  
      # test context as decorator (and test reusability, by calling func twice)
      @mpl.rc_context({"lines.linewidth": 44})
      def func():
          assert mpl.rcParams["lines.linewidth"] == 44
  
      func()
      func()
  
      # test rc_file
      mpl.rc_file(rcpath)
      assert mpl.rcParams["lines.linewidth"] == 33
  
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 1 for calling a global function with example usage: test_rcparams(tmp_path) without return types