code: def test_different_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 grids (different shapes)
      target_x_shape = (23, 45)
      target_y_shape = (23, 44)
      target_x = np.arange(
          reduce(operator.mul, target_x_shape), dtype=np.float64
      ).reshape(target_x_shape)
      target_y = np.arange(
          reduce(operator.mul, target_y_shape), dtype=np.float64
      ).reshape(target_y_shape)
      target_proj = ccrs.PlateCarree()
  
      # Attempt regrid
      with pytest.raises(ValueError):
          im_trans.regrid(
              data,
              source_x,
              source_y,
              source_cs,
              target_proj,
              target_x,
              target_y,
          )
  
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 2 for calling the TestRegrid obj's underlying member method code with example usage: obj.test_different_dims() without return types