code: def test_array_dims(self):
      # Source data
      source_nx = 100
      source_ny = 100
      source_x = np.linspace(-180.0, 180.0, source_nx).astype(
          np.float64
      )
      source_y = np.linspace(-90, 90.0, source_ny).astype(np.float64)
      source_x, source_y = np.meshgrid(source_x, source_y)
      data = np.arange(source_nx * source_ny, dtype=np.int32).reshape(
          source_ny, source_nx
      )
      source_cs = ccrs.Geodetic()
  
      # Target grid
      target_nx = 23
      target_ny = 45
      target_proj = ccrs.PlateCarree()
      target_x, target_y, extent = im_trans.mesh_projection(
          target_proj, target_nx, target_ny
      )
  
      # Perform regrid
      new_array = im_trans.regrid(
          data,
          source_x,
          source_y,
          source_cs,
          target_proj,
          target_x,
          target_y,
      )
  
      # Check dimensions of return array
      assert new_array.shape == target_x.shape
      assert new_array.shape == target_y.shape
      assert new_array.shape == (target_ny, target_nx)
  
file_path: cartopy/lib/cartopy/tests/mpl/test_img_transform.py
imports: from functools import reduce
  import operator
  import matplotlib
  import matplotlib.pyplot
  import numpy
  import pytest
  from cartopy import config
  import cartopy.crs
  from cartopy.tests.conftest import _HAS_PYKDTREE_OR_SCIPY
  import cartopy.img_transform
label_desc: Use image node_id 1 for calling the TestRegrid obj's underlying member method code with example usage: obj.test_array_dims() without return types