code: def test_high_level_glm_with_paths(in_tmp_path):
      shapes, rk = ((5, 6, 4, 20), (5, 6, 4, 19)), 3
      mask_file, fmri_files, design_files = write_fake_fmri_data(
          shapes, rk
      )
      multi_session_model = FMRILinearModel(
          fmri_files, design_files, mask_file
      )
      multi_session_model.fit()
      (z_image,) = multi_session_model.contrast([np.eye(rk)[1]] * 2)
      assert_array_equal(
          get_affine(z_image), get_affine(load(mask_file))
      )
      assert z_image.get_fdata().std() < 3.0
      # Delete objects attached to files to avoid WindowsError when deleting
      # temporary directory
      del z_image, fmri_files, multi_session_model
  
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 3 for calling a global function with example usage: test_high_level_glm_with_paths(in_tmp_path) without return types