code: def test_export_edf_annotations(tmp_path):
      """Test that exporting EDF preserves annotations."""
      raw = _create_raw_for_edf_tests()
      annotations = Annotations(
          onset=[0.01, 0.05, 0.90, 1.05],
          duration=[0, 1, 0, 0],
          description=["test1", "test2", "test3", "test4"],
          ch_names=[["0"], ["0", "1"], [], ["1"]],
      )
      raw.set_annotations(annotations)
  
      # export
      temp_fname = tmp_path / "test.edf"
      raw.export(temp_fname)
  
      # read in the file
      raw_read = read_raw_edf(temp_fname, preload=True)
      assert_array_equal(
          raw.annotations.onset, raw_read.annotations.onset
      )
      assert_array_equal(
          raw.annotations.duration, raw_read.annotations.duration
      )
      assert_array_equal(
          raw.annotations.description, raw_read.annotations.description
      )
      assert_array_equal(
          raw.annotations.ch_names, raw_read.annotations.ch_names
      )
  
imports: from contextlib import nullcontext
  from datetime import datetime, timezone
  from pathlib import Path
  import numpy
  import pytest
  from numpy.testing import assert_allclose, assert_array_almost_equal, assert_array_equal
  from mne import Annotations, Epochs, create_info, read_epochs_eeglab, read_evokeds, read_evokeds_mff
  from mne.datasets import misc, testing
  from mne.export import export_evokeds, export_evokeds_mff
  from mne.fixes import _compare_version
  from mne.io import RawArray, read_raw_brainvision, read_raw_edf, read_raw_eeglab, read_raw_fif
  from mne.tests.test_epochs import _get_data
  from mne.utils import _check_edfio_installed, _record_warnings, _resource_path, object_diff
label_desc: Use image node_id 5 for calling a global function with example usage: test_export_edf_annotations(tmp_path) without return types