code: def _check_latencies(latencies):
      if (latencies < -1).any():
          raise ValueError(
              "At least one event sample index is negative. Please"
              " check if EEG.event.sample values are correct."
          )
      if (latencies == -1).any():
          warn(
              "At least one event has a sample index of -1. This usually is "
              "a consequence of how eeglab handles event latency after "
              "resampling - especially when you had a boundary event at the "
              "beginning of the file. Please make sure that the events at "
              "the very beginning of your EEGLAB file can be safely dropped "
              "(e.g., because they are boundary events)."
          )
  
imports: import os.path
  from os import PathLike
  from pathlib import Path
  import numpy
  from mne.utils.check import _check_option
  from ..._fiff._digitization import _ensure_fiducials_head
  from ..._fiff.constants import FIFF
  from ..._fiff.meas_info import create_info
  from ..._fiff.pick import _PICK_TYPES_KEYS
  from ..._fiff.utils import _find_channels, _read_segments_file
  from ...annotations import Annotations, read_annotations
  from ...channels import make_dig_montage
  from ...defaults import DEFAULTS
  from ...epochs import BaseEpochs
  from ...event import read_events
  from ...utils import Bunch, _check_fname, _check_head_radius, fill_doc, logger, verbose, warn
  from ..base import BaseRaw
  from ._eeglab import _readmat
label_desc: Use image node_id 12 for calling a global function with example usage: _check_latencies(latencies) without return types