code: def _check_confounds(confounds):
      """Check confounds type."""
      if confounds is not None:
          if not isinstance(confounds, pd.DataFrame):
              raise ValueError("confounds must be a pandas DataFrame")
          if "subject_label" not in confounds.columns:
              raise ValueError(
                  "confounds DataFrame must contain column 'subject_label'"
              )
          if len(confounds.columns) < 2:
              raise ValueError(
                  "confounds should contain at least 2 columns"
                  ' one called "subject_label" and the other'
                  " with a given confound"
              )
          # Make sure subject_label contain strings
          if not all(
              isinstance(_, str)
              for _ in confounds["subject_label"].tolist()
          ):
              raise ValueError(
                  "subject_label column must contain only strings"
              )
  
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 10 for calling a global function with example usage: _check_confounds(confounds) without return types