code: def test_parse_annotation(tmp_path):
      """Test parsing the tal channel."""
      # test the parser
      annot = (
          b"+180\x14Lights off\x14Close door\x14\x00\x00\x00\x00\x00"
          b"+180\x14Lights off\x14\x00\x00\x00\x00\x00\x00\x00\x00"
          b"+180\x14Close door\x14\x00\x00\x00\x00\x00\x00\x00\x00"
          b"+3.14\x1504.20\x14nothing\x14\x00\x00\x00\x00"
          b"+1800.2\x1525.5\x14Apnea\x14\x00\x00\x00\x00\x00\x00\x00"
          b"+123\x14\x14\x00\x00\x00\x00\x00\x00\x00"
      )
      annot_file = tmp_path / "annotations.txt"
      with open(annot_file, "wb") as f:
          f.write(annot)
  
      annot = [a for a in bytes(annot)]
      annot[1::2] = [a * 256 for a in annot[1::2]]
      tal_channel_A = np.array(
          list(map(sum, zip(annot[0::2], annot[1::2]))), dtype=np.int64
      )
  
      with open(annot_file, "rb") as fid:
          # ch_data = np.fromfile(fid, dtype='<i2', count=len(annot))
          tal_channel_B = _read_ch(
              fid,
              subtype="EDF",
              dtype="<i2",
              samp=(len(annot) - 1) // 2,
              dtype_byte="This_parameter_is_not_used",
          )
  
      want_onset, want_duration, want_description = zip(
          *[
              [3.14, 4.2, "nothing"],
              [180.0, 0.0, "Lights off"],
              [180.0, 0.0, "Close door"],
              [180.0, 0.0, "Lights off"],
              [180.0, 0.0, "Close door"],
              [1800.2, 25.5, "Apnea"],
          ]
      )
      for tal_channel in [tal_channel_A, tal_channel_B]:
          annotations = _read_annotations_edf([tal_channel])
          assert_allclose(annotations.onset, want_onset)
          assert_allclose(annotations.duration, want_duration)
          assert_array_equal(annotations.description, want_description)
  
imports: import datetime
  from contextlib import nullcontext
  from functools import partial
  from pathlib import Path
  import numpy
  import pytest
  from numpy.testing import assert_allclose, assert_array_almost_equal, assert_array_equal, assert_equal
  from scipy.io import loadmat
  from mne import Annotations, pick_types
  from mne._fiff.pick import channel_indices_by_type, get_channel_type_constants
  from mne.annotations import _ndarray_ch_names, events_from_annotations, read_annotations
  from mne.datasets import testing
  from mne.io import edf, read_raw_bdf, read_raw_edf, read_raw_fif, read_raw_gdf
  from mne.io.edf.edf import _edf_str, _parse_prefilter_string, _read_annotations_edf, _read_ch, _read_edf_header, _read_header
  from mne.io.tests.test_raw import _test_raw_reader
  from mne.tests.test_annotations import _assert_annotations_equal
label_desc: Use image node_id 11 for calling a global function with example usage: test_parse_annotation(tmp_path) without return types