code: def _check_subjects(
      subjects, n_subjects, missing=None, on_missing="raise"
  ):
      """Check whether subjects are available.
  
      Parameters
      ----------
      subjects : list
          Subject numbers to be checked.
      n_subjects : int
          Number of subjects available.
      missing : list | None
          Subject numbers that are missing.
      on_missing : 'raise' | 'warn' | 'ignore'
          What to do if one or several subjects are not available. Valid keys
          are 'raise' | 'warn' | 'ignore'. Default is 'error'. If on_missing
          is 'warn' it will proceed but warn, if 'ignore' it will proceed
          silently.
      """
      valid_subjects = np.arange(n_subjects)
      if missing is not None:
          valid_subjects = np.setdiff1d(valid_subjects, missing)
      unknown_subjects = np.setdiff1d(subjects, valid_subjects)
      if unknown_subjects.size > 0:
          subjects_list = ", ".join([str(s) for s in unknown_subjects])
          msg = (
              f"This dataset contains subjects 0 to {n_subjects - 1} with "
              f"missing subjects {missing}. Unknown subjects: "
              f"{subjects_list}."
          )
          _on_missing(on_missing, msg)
  
file_path: mne-python/mne/datasets/sleep_physionet/_utils.py
imports: import os
  import os.path
  import numpy
  from ...utils import _check_pandas_installed, _on_missing, _TempDir, verbose
  from ..utils import _downloader_params, _get_path
label_desc: Use image node_id 5 for calling a global function with example usage: _check_subjects(subjects, n_subjects, missing, on_missing) without return types