code: def _check_bids_image_list(imgs, sub_label, filters):
      """Check input BIDS images.
  
      Check that:
          - some images were found
          - if more than one image was found, check that there is not more than
            one image for a given session / run combination.
  
      Parameters
      ----------
      imgs : :obj:`list` of :obj:`str` or None
          List of image fullpath filenames.
  
      sub_label : :obj:`str`
          Subject label as specified in the file names like _sub-<sub_label>_.
  
      filters : :obj:`list` of :obj:`tuple` (str, str)
          Filters of the form (field, label) used to select the files.
          See :func:`get_bids_files`.
  
      """
      if not imgs:
          raise ValueError(
              "No BOLD files found "
              f"for subject {sub_label} "
              f"for filter: {filters}"
          )
  
      if len(imgs) <= 1:
          return
  
      msg_start = (
          "Too many images found\n "
          f"for subject: '{sub_label}'\n"
          f"for filters: {filters}\n"
      )
      msg_end = (
          "Please specify it further by setting, "
          "for example, some required task_label, "
          "space_label or img_filters"
      )
  
      run_check_list: list = []
  
      for img_ in imgs:
          parsed_filename = parse_bids_filename(img_)
          session = parsed_filename.get("ses", None)
          run = parsed_filename.get("run", None)
  
          if session and run:
              if (session, run) in set(run_check_list):
                  raise ValueError(
                      f"{msg_start}"
                      f"for the same run {run} and session {session}. "
                      f"{msg_end}"
                  )
              run_check_list.append((session, run))
  
          elif session:
              if session in set(run_check_list):
                  raise ValueError(
                      f"{msg_start}"
                      f"for the same session {session}, "
                      "while no additional run specification present. "
                      f"{msg_end}"
                  )
              run_check_list.append(session)
  
          elif run:
              if run in set(run_check_list):
                  raise ValueError(
                      f"{msg_start}"
                      f"for the same run {run}. "
                      f"{msg_end}"
                  )
              run_check_list.append(run)
  
imports: from __future__ import annotations
  import csv
  import glob
  import os
  import sys
  import time
  from pathlib import Path
  from warnings import warn
  import numpy
  import pandas
  from joblib import Memory, Parallel, delayed
  from nibabel import Nifti1Image
  from sklearn.base import clone
  from sklearn.cluster import KMeans
  from nilearn._utils import fill_doc, stringify_path
  from nilearn._utils.niimg_conversions import check_niimg
  from nilearn._utils.param_validation import check_run_sample_masks
  from nilearn.glm._base import BaseGLM
  from nilearn.glm.contrasts import compute_fixed_effect_contrast, expression_to_contrast_vector
  from nilearn.glm.first_level.design_matrix import make_first_level_design_matrix
  from nilearn.glm.regression import ARModel, OLSModel, RegressionResults, SimpleRegressionResults
  from nilearn.image import get_data
  from nilearn.interfaces.bids import get_bids_files, parse_bids_filename
  from nilearn.interfaces.bids.query import infer_repetition_time_from_dataset, infer_slice_timing_start_time_from_dataset
  from nilearn.interfaces.bids.utils import bids_entities, check_bids_label
  from nilearn.interfaces.fmriprep.load_confounds import load_confounds
label_desc: Use image node_id 23 for calling a global function with example usage: _check_bids_image_list(imgs, sub_label, filters) without return types