code: def shift_time_events(events, ids, tshift, sfreq):
      """Shift a set of :term:`events`.
  
      Parameters
      ----------
      %(events)s
      ids : ndarray of int | None
          The ids of events to shift.
      tshift : float
          Time-shift event. Use positive value tshift for forward shifting
          the event and negative value for backward shift.
      sfreq : float
          The sampling frequency of the data.
  
      Returns
      -------
      new_events : array of int, shape (n_new_events, 3)
          The new events.
      """
      events = events.copy()
      if ids is None:
          mask = slice(None)
      else:
          mask = np.isin(events[:, 2], ids)
      events[mask, 0] += int(tshift * sfreq)
  
      return events
  
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 13 for calling a global function with example usage: shift_time_events(events, ids, tshift, sfreq) and returns: events