code: def test_colorbar_location():
      """
      Test that colorbar handling is as expected for various complicated
      cases...
      """
      # Remove this line when this test image is regenerated.
      plt.rcParams["pcolormesh.snap"] = False
  
      fig, axs = plt.subplots(4, 5, layout="constrained")
      for ax in axs.flat:
          pcm = example_pcolor(ax)
          ax.set_xlabel("")
          ax.set_ylabel("")
      fig.colorbar(pcm, ax=axs[:, 1], shrink=0.4)
      fig.colorbar(pcm, ax=axs[-1, :2], shrink=0.5, location="bottom")
      fig.colorbar(
          pcm, ax=axs[0, 2:], shrink=0.5, location="bottom", pad=0.05
      )
      fig.colorbar(pcm, ax=axs[-2, 3:], shrink=0.5, location="top")
      fig.colorbar(pcm, ax=axs[0, 0], shrink=0.5, location="left")
      fig.colorbar(pcm, ax=axs[1:3, 2], shrink=0.5, location="right")
  
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 28 for calling a global function with example usage: test_colorbar_location() without return types