code: def slm(tmp_path):
      """Generate a fitted second level model."""
      shapes = ((7, 7, 7, 1),)
      _, FUNCFILE, _ = write_fake_fmri_data_and_design(
          shapes, file_path=tmp_path
      )
      FUNCFILE = FUNCFILE[0]
      func_img = load(FUNCFILE)
      model = SecondLevelModel()
      Y = [func_img] * 2
      X = pd.DataFrame([[1]] * 2, columns=["intercept"])
      return model.fit(Y, design_matrix=X)
  
imports: import numpy
  import pandas
  import pytest
  from nibabel import load
  from nilearn._utils.data_gen import write_fake_fmri_data_and_design
  from nilearn.glm.first_level import FirstLevelModel
  from nilearn.glm.first_level.design_matrix import make_first_level_design_matrix
  from nilearn.glm.second_level import SecondLevelModel
  from nilearn.maskers import NiftiMasker
  from nilearn.reporting import glm_reporter
label_desc: Use image node_id 4 for calling a global function with example usage: slm(tmp_path) and returns: model