code: def test_rgb_extent(rgb_image):
      """Test to ensure that when the extent is provided, plot_rgb stretches
      the image or applies the proper x and y lims. Also ensure that the
      correct bands are plotted an in the correct order when the rgb
      param is called and defined. Finally test that a provided title and
      figsize created a plot with the correct title and figsize."""
      a_rgb_image, ext = rgb_image
      ax = plot_rgb(
          a_rgb_image,
          extent=ext,
          rgb=(1, 2, 0),
          title="My Title",
          figsize=(5, 5),
      )
      # Get x and y lims to test extent
      plt_ext = ax.get_xlim() + ax.get_ylim()
  
      plt_array = ax.get_images()[0].get_array()
  
      assert ax.figure.bbox_inches.bounds[2:4] == (5, 5)
      assert ax.get_title() == "My Title"
      assert np.array_equal(
          plt_array[0], a_rgb_image.transpose([1, 2, 0])[1]
      )
      assert ext == plt_ext
      plt.close()
  
imports: import numpy
  import numpy.ma
  import matplotlib.pyplot
  import pytest
  import rasterio
  from rasterio.plot import plotting_extent
  from earthpy.plot import plot_rgb, _stretch_im
  from earthpy.io import path_to_example
label_desc: Use image node_id 4 for calling a global function with example usage: test_rgb_extent(rgb_image) without return types