code: def test_surrogate_array_3d_write():
      """Check that 3D version spits files when required"""
      from os import path
      from tempfile import mkdtemp
  
      write_path = path.join(mkdtemp(), "img.nii")
      shape = (5, 6, 7)
      data = surrogate_3d_dataset(
          shape=shape, out_image_file=write_path
      )
      assert path.isfile(write_path)
  
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 3 for calling a global function with example usage: test_surrogate_array_3d_write() without return types