code: def test_eeglab_read_annotations():
      """Test annotations onsets are timestamps (+ validate some)."""
      annotations = read_annotations(raw_fname_mat)
      validation_samples = [
          0,
          1,
          2,
          3,
          5,
          7,
          11,
          13,
          17,
          19,
          23,
          29,
          31,
      ]
      expected_onset = np.array(
          [
              1.00,
              1.69,
              2.08,
              4.70,
              7.71,
              11.30,
              17.18,
              20.20,
              26.12,
              29.14,
              35.25,
              44.30,
              47.15,
          ]
      )
      assert annotations.orig_time is None
      assert_array_almost_equal(
          annotations.onset[validation_samples],
          expected_onset,
          decimal=2,
      )
  
      # test if event durations are imported correctly
      raw = read_raw_eeglab(
          raw_fname_event_duration, preload=True, montage_units="dm"
      )
      # file contains 3 annotations with 0.5 s (64 samples) duration each
      assert_allclose(raw.annotations.duration, np.ones(3) * 0.5)
  
imports: import os
  import shutil
  from copy import deepcopy
  import numpy
  import pytest
  from numpy.testing import assert_allclose, assert_array_almost_equal, assert_array_equal, assert_equal
  from scipy import io
  import mne
  from mne import read_epochs_eeglab, write_events
  from mne.annotations import events_from_annotations, read_annotations
  from mne.channels import read_custom_montage
  from mne.datasets import testing
  from mne.io import read_raw_eeglab
  from mne.io.eeglab._eeglab import _readmat
  from mne.io.eeglab.eeglab import _dol_to_lod, _get_montage_information
  from mne.io.tests.test_raw import _test_raw_reader
  from mne.utils import Bunch, _check_pymatreader_installed
label_desc: Use image node_id 7 for calling a global function with example usage: test_eeglab_read_annotations() without return types