code: def test_mesh_projection_extent(xmin, xmax, ymin, ymax):
      proj = ccrs.PlateCarree()
      nx = 4
      ny = 2
  
      target_x, target_y, extent = img_trans.mesh_projection(
          proj, nx, ny, x_extents=(xmin, xmax), y_extents=(ymin, ymax)
      )
  
      if xmin is None:
          xmin = proj.x_limits[0]
      if xmax is None:
          xmax = proj.x_limits[1]
      if ymin is None:
          ymin = proj.y_limits[0]
      if ymax is None:
          ymax = proj.y_limits[1]
      assert_array_equal(extent, [xmin, xmax, ymin, ymax])
      assert_array_equal(np.diff(target_x, axis=1), (xmax - xmin) / nx)
      assert_array_equal(np.diff(target_y, axis=0), (ymax - ymin) / ny)
  
file_path: cartopy/lib/cartopy/tests/test_img_transform.py
imports: import numpy
  from numpy.testing import assert_array_equal
  import pytest
  from cartopy.tests.conftest import _HAS_PYKDTREE_OR_SCIPY, requires_pykdtree, requires_scipy
  import cartopy.crs
  import cartopy.img_transform
label_desc: Use image node_id 1 for calling a global function with example usage: test_mesh_projection_extent(xmin, xmax, ymin, ymax) without return types