code: def test_eeglab_event_from_annot():
      """Test all forms of obtaining annotations."""
      raw_fname_mat = base_dir / "test_raw.set"
      raw_fname = raw_fname_mat
      event_id = {"rt": 1, "square": 2}
      raw1 = read_raw_eeglab(input_fname=raw_fname, preload=False)
  
      annotations = read_annotations(raw_fname)
      assert len(raw1.annotations) == 154
      raw1.set_annotations(annotations)
      events_b, _ = events_from_annotations(raw1, event_id=event_id)
      assert len(events_b) == 154
  
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 8 for calling a global function with example usage: test_eeglab_event_from_annot() without return types