code: def _check_events_file_uses_tab_separators(events_files):
      """Raise a ValueError if provided list of text based data files \
      (.csv, .tsv, etc) do not enforce \
      the :term:`BIDS` convention of using Tabs as separators.
  
      Only scans their first row.
      Does nothing if:
          - If the separator used is :term:`BIDS` compliant.
          - Paths are invalid.
          - File(s) are not text files.
  
      Does not flag comma-separated-values-files for compatibility reasons;
      this may change in future as commas are not :term:`BIDS` compliant.
  
      Parameters
      ----------
      events_files : str, List/Tuple[str]
          A single file's path or a collection of filepaths.
          Files are expected to be text files.
          Non-text files will raise ValueError.
  
      Returns
      -------
      None
  
      Raises
      ------
      ValueError:
          If value separators are not Tabs (or commas)
  
      """
      valid_separators = [",", "\t"]
      if not isinstance(events_files, (list, tuple)):
          events_files = [events_files]
      for events_file_ in events_files:
          if isinstance(events_file_, (pd.DataFrame)):
              continue
          try:
              with open(events_file_) as events_file_obj:
                  events_file_sample = events_file_obj.readline()
              """
              The following errors are not being handled here,
              as they are handled elsewhere in the calling code.
              Handling them here will beak the calling code,
              and refactoring that is not straightforward.
              """
          except OSError:  # if invalid filepath.
              pass
          else:
              try:
                  csv.Sniffer().sniff(
                      sample=events_file_sample,
                      delimiters=valid_separators,
                  )
              except csv.Error as e:
                  raise ValueError(
                      "The values in the events file "
                      "are not separated by tabs; "
                      "please enforce BIDS conventions",
                      events_file_,
                  ) from e
  
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 6 for calling a global function with example usage: _check_events_file_uses_tab_separators(events_files) without return types