code: def test_surrogate_array_4d_shape():
      """Run the 4D datageneration; check the output shape and length"""
      shape = (5, 6, 7)
      out_shape = shape + (1,)
      imgs = surrogate_4d_dataset(shape)
      assert not np.any(
          np.asarray(imgs[0].shape) - np.asarray(out_shape)
      )
      n_sess = 3
      imgs = surrogate_4d_dataset(shape, n_sess=n_sess)
      assert imgs[0].shape == out_shape
      assert len(imgs) == n_sess
      n_scans = 5
      out_shape = shape + (n_scans,)
      imgs = surrogate_4d_dataset(shape, n_scans=n_scans)
      assert imgs[0].shape == (out_shape)
  
file_path: nipy/nipy/labs/utils/tests/test_simul_multisubject_fmri_dataset.py
imports: import numpy
  from nibabel import Nifti1Image
  from ..simul_multisubject_fmri_dataset import surrogate_2d_dataset, surrogate_3d_dataset, surrogate_4d_dataset
label_desc: Use image node_id 5 for calling a global function with example usage: test_surrogate_array_4d_shape() without return types