code: def test_sample4d():
      a = np.random.rand(4, 5, 6, 7)
      c = _cspline_transform(a)
      x = np.mgrid[0:4, 0:5, 0:6, 0:7]
      b = np.zeros(a.shape)
      args = list(x)
      b = _cspline_sample4d(b, c, *args)
      assert_array_almost_equal(a, b)
      args = list(x) + ["nearest" for i in range(4)]
      b = _cspline_sample4d(b, c, *args)
      assert_array_almost_equal(a, b)
  
imports: import numpy
  from numpy.testing import assert_array_almost_equal
  from .._registration import _cspline_sample1d, _cspline_sample4d, _cspline_transform
label_desc: Use image node_id 2 for calling a global function with example usage: test_sample4d() without return types