code: def concatenate_events(events, first_samps, last_samps):
      """Concatenate event lists to be compatible with concatenate_raws.
  
      This is useful, for example, if you processed and/or changed
      events in raw files separately before combining them using
      :func:`mne.concatenate_raws`.
  
      Parameters
      ----------
      events : list of array
          List of :term:`events` arrays, typically each extracted from a
          corresponding raw file that is being concatenated.
      first_samps : list or array of int
          First sample numbers of the raw files concatenated.
      last_samps : list or array of int
          Last sample numbers of the raw files concatenated.
  
      Returns
      -------
      events : array
          The concatenated events.
  
      See Also
      --------
      mne.concatenate_raws
      """
      _validate_type(events, list, "events")
      if not (
          len(events) == len(last_samps)
          and len(events) == len(first_samps)
      ):
          raise ValueError(
              "events, first_samps, and last_samps must all have "
              "the same lengths"
          )
      first_samps = np.array(first_samps)
      last_samps = np.array(last_samps)
      n_samps = np.cumsum(last_samps - first_samps + 1)
      events_out = events[0]
      for e, f, n in zip(events[1:], first_samps[1:], n_samps[:-1]):
          # remove any skip since it doesn't exist in concatenated files
          e2 = e.copy()
          e2[:, 0] -= f
          # add offset due to previous files, plus original file offset
          e2[:, 0] += n + first_samps[0]
          events_out = np.concatenate((events_out, e2), axis=0)
  
      return events_out
  
imports: from collections.abc import Sequence
  from pathlib import Path
  import numpy
  from ._fiff.constants import FIFF
  from ._fiff.open import fiff_open
  from ._fiff.pick import pick_channels
  from ._fiff.tag import read_tag
  from ._fiff.tree import dir_tree_find
  from ._fiff.write import end_block, start_and_end_file, start_block, write_int
  from .utils import _check_fname, _check_integer_or_list, _check_on_missing, _check_option, _get_stim_channel, _on_missing, _pl, _validate_type, check_fname, fill_doc, logger, verbose, warn
label_desc: Use image node_id 15 for calling a global function with example usage: concatenate_events(events, first_samps, last_samps) and returns: events_out