code: def test_non_agg_renderer(monkeypatch, recwarn):
      unpatched_init = mpl.backend_bases.RendererBase.__init__
  
      def __init__(self, *args, **kwargs):
          # Check that we don't instantiate any other renderer than a pdf
          # renderer to perform pdf tight layout.
          assert isinstance(self, mpl.backends.backend_pdf.RendererPdf)
          unpatched_init(self, *args, **kwargs)
  
      monkeypatch.setattr(
          mpl.backend_bases.RendererBase, "__init__", __init__
      )
      fig, ax = plt.subplots()
      fig.tight_layout()
  
imports: import warnings
  import numpy
  from numpy.testing import assert_array_equal
  import pytest
  import matplotlib
  from matplotlib.testing.decorators import image_comparison
  import matplotlib.pyplot
  from matplotlib.offsetbox import AnchoredOffsetbox, DrawingArea
  from matplotlib.patches import Rectangle
label_desc: Use image node_id 21 for calling a global function with example usage: test_non_agg_renderer(monkeypatch, recwarn) without return types