code: def test_contourf_transform_first(func):
      """Test the fast-path option for filled contours."""
      # Gridded data that needs to be wrapped
      x = np.arange(360)
      y = np.arange(-25, 26)
      xx, yy = np.meshgrid(x, y)
      z = xx + yy**2
  
      ax = plt.axes(projection=ccrs.PlateCarree())
      test_func = getattr(ax, func)
      # Can't handle just Z input with the transform_first
      with pytest.raises(
          ValueError, match="The X and Y arguments must be provided"
      ):
          test_func(
              z, transform=ccrs.PlateCarree(), transform_first=True
          )
      # X and Y must also be 2-dimensional
      with pytest.raises(
          ValueError, match="The X and Y arguments must be gridded"
      ):
          test_func(
              x,
              y,
              z,
              transform=ccrs.PlateCarree(),
              transform_first=True,
          )
  
      # When calculating the contour in projection-space the extent
      # will now be the extent of the transformed points (-179, 180, -25, 25)
      test_func(
          xx, yy, z, transform=ccrs.PlateCarree(), transform_first=True
      )
      assert_array_almost_equal(ax.get_extent(), (-179, 180, -25, 25))
  
      # The extent without the transform_first should be all the way out to -180
      test_func(
          xx, yy, z, transform=ccrs.PlateCarree(), transform_first=False
      )
      assert_array_almost_equal(ax.get_extent(), (-180, 180, -25, 25))
  
file_path: cartopy/lib/cartopy/tests/mpl/test_contour.py
imports: import matplotlib.pyplot
  import numpy
  from numpy.testing import assert_array_almost_equal
  import pytest
  import cartopy.crs
  from cartopy.tests.conftest import requires_scipy
label_desc: Use image node_id 6 for calling a global function with example usage: test_contourf_transform_first(func) without return types