code: def _check_first_level_contrast(
      second_level_input, first_level_contrast
  ):
      if (
          isinstance(second_level_input, list)
          and isinstance(second_level_input[0], FirstLevelModel)
          and first_level_contrast is None
      ):
          raise ValueError(
              "If second_level_input was a list of FirstLevelModel,"
              " then first_level_contrast is mandatory. "
              "It corresponds to the second_level_contrast argument "
              "of the compute_contrast method of FirstLevelModel."
          )
  
imports: import sys
  import time
  from warnings import warn
  import numpy
  import pandas
  from joblib import Memory
  from nibabel import Nifti1Image
  from sklearn.base import clone
  from nilearn._utils import fill_doc, stringify_path
  from nilearn._utils.niimg_conversions import check_niimg
  from nilearn.glm._base import BaseGLM
  from nilearn.glm.contrasts import compute_contrast, expression_to_contrast_vector
  from nilearn.glm.first_level import FirstLevelModel, run_glm
  from nilearn.glm.first_level.design_matrix import make_second_level_design_matrix
  from nilearn.glm.regression import RegressionResults, SimpleRegressionResults
  from nilearn.image import mean_img
  from nilearn.maskers import NiftiMasker
  from nilearn.mass_univariate import permuted_ols
label_desc: Use image node_id 11 for calling a global function with example usage: _check_first_level_contrast(second_level_input, first_level_contrast) without return types