code: def write_fake_fmri_data(shapes, rk=3, affine=np.eye(4)):
      mask_file, fmri_files, design_files = "mask.nii", [], []
      for i, shape in enumerate(shapes):
          fmri_files.append("fmri_run%d.nii" % i)
          data = 100 + np.random.randn(*shape)
          data[0] -= 10
          save(Nifti1Image(data, affine), fmri_files[-1])
          design_files.append("dmtx_%d.npz" % i)
          np.savez(design_files[-1], np.random.randn(shape[3], rk))
      save(
          Nifti1Image(
              (np.random.rand(*shape[:3]) > 0.5).astype(np.int8), affine
          ),
          mask_file,
      )
      return mask_file, fmri_files, design_files
  
imports: import numpy
  import pytest
  from nibabel import Nifti1Image, load, save
  from numpy.testing import assert_almost_equal, assert_array_almost_equal, assert_array_equal
  from nipy.io.nibcompat import get_affine
  from nipy.testing import funcfile
  from nipy.testing.decorators import if_example_data
  from ..glm import FMRILinearModel, GeneralLinearModel, data_scaling
label_desc: Use image node_id 1 for calling a global function with example usage: write_fake_fmri_data(shapes, rk, affine) and returns: mask_file,  fmri_files,  design_files