code: def test_sample1d():
      a = np.random.rand(100)
      c = _cspline_transform(a)
      x = np.arange(100)
      b = np.zeros(100)
      b = _cspline_sample1d(b, c, x)
      assert_array_almost_equal(a, b)
      b = _cspline_sample1d(b, c, x, mode="nearest")
      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 1 for calling a global function with example usage: test_sample1d() without return types