code: def test_masking_first_level_model(tmp_path):
      """
      Checks that using NiftiMasker when instantiating
      FirstLevelModel doesn't raise Error when calling
      generate_report().
      """
      shapes, rk = ((7, 7, 7, 5),), 3
      (
          mask,
          fmri_data,
          design_matrices,
      ) = write_fake_fmri_data_and_design(
          shapes, rk, file_path=tmp_path
      )
      masker = NiftiMasker(mask_img=mask)
      masker.fit(fmri_data)
      flm = FirstLevelModel(mask_img=masker).fit(
          fmri_data, design_matrices=design_matrices
      )
      contrast = np.eye(3)[1]
  
      report_flm = flm.generate_report(
          contrast,
          plot_type="glass",
          height_control=None,
          min_distance=15,
          alpha=0.01,
          threshold=2,
      )
  
      report_flm.get_iframe()
  
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 23 for calling a global function with example usage: test_masking_first_level_model(tmp_path) without return types