code: def test_rotate2d():
      # Rotate an image in 2d on a square grid, should result in transposed image
      g = AffineTransform.from_params(
          "ij", "xy", np.diag([0.7, 0.5, 1])
      )
      g2 = AffineTransform.from_params(
          "ij", "xy", np.diag([0.5, 0.7, 1])
      )
      i = Image(np.ones((100, 100)), g)
      # This sets the image data by writing into the array
      i.get_fdata()[50:55, 40:55] = 3.0
      a = np.array([[0, 1, 0], [1, 0, 0], [0, 0, 1]], np.float64)
      ir = resample(i, g2, a, (100, 100))
      assert_array_almost_equal(ir.get_fdata().T, i.get_fdata())
  
imports: from itertools import product
  import numpy
  import pytest
  from numpy.testing import assert_array_almost_equal
  from nipy.algorithms.resample import resample, resample_img2img
  from nipy.core.api import AffineTransform, ArrayCoordMap, Image, vox2mni
  from nipy.core.reference import slices
  from nipy.io.api import load_image
  from nipy.testing import anatfile, funcfile
label_desc: Use image node_id 2 for calling a global function with example usage: test_rotate2d() without return types