code: def test_onesample_stat():
      dx, dy, dz = 3, 4, 2
      nvox = dx * dy * dz
      nsub = 12
      # Make surrogate data
      aux = np.arange(nvox)
      x = np.reshape(aux.repeat(nsub), [dx, dy, dz, nsub])
      # Gold standard
      y_target = np.inf * np.ones(nvox)
      y_target[0] = 0.0
      # Test: input C-contiguous, data owner, axis=3
      y = onesample.stat(x, axis=3).reshape(nvox)
      assert_array_equal(y, y_target)
      # Test: input F-contiguous, not owner, axis=0
      y = onesample.stat(x.T, axis=0).reshape(nvox)
      assert_array_equal(y, y_target)
      # Test: input C-contiguous, data owner, axis=0
      xT = x.T.copy()
      y = onesample.stat(xT, axis=0).reshape(nvox)
      assert_array_equal(y, y_target)
  
imports: import numpy
  from numpy.testing import assert_array_equal
  from ..None import onesample
label_desc: Use image node_id 1 for calling a global function with example usage: test_onesample_stat() without return types