code: def test_constrained_layout6():
      """Test constrained_layout for nested gridspecs"""
      # Remove this line when this test image is regenerated.
      plt.rcParams["pcolormesh.snap"] = False
  
      fig = plt.figure(layout="constrained")
      gs = fig.add_gridspec(1, 2, figure=fig)
      gsl = gs[0].subgridspec(2, 2)
      gsr = gs[1].subgridspec(1, 2)
      axsl = []
      for gs in gsl:
          ax = fig.add_subplot(gs)
          axsl += [ax]
          example_plot(ax, fontsize=12)
      ax.set_xlabel("x-label\nMultiLine")
      axsr = []
      for gs in gsr:
          ax = fig.add_subplot(gs)
          axsr += [ax]
          pcm = example_pcolor(ax, fontsize=12)
  
      fig.colorbar(
          pcm,
          ax=axsr,
          pad=0.01,
          shrink=0.99,
          location="bottom",
          ticks=ticker.MaxNLocator(nbins=5),
      )
  
imports: import gc
  import numpy
  import pytest
  import matplotlib
  from matplotlib.testing.decorators import image_comparison
  import matplotlib.pyplot
  import matplotlib.transforms
  from matplotlib import gridspec, ticker
label_desc: Use image node_id 8 for calling a global function with example usage: test_constrained_layout6() without return types