code: def test_export_raw_edf(tmp_path, input_path, warning_msg):
      """Test saving a Raw instance to EDF format."""
      raw = read_raw_fif(input_path)
  
      # only test with EEG channels
      raw.pick(picks=["eeg", "ecog", "seeg"]).load_data()
      temp_fname = tmp_path / "test.edf"
  
      with pytest.warns(RuntimeWarning, match=warning_msg):
          raw.export(temp_fname)
  
      if "epoc" in raw.ch_names:
          raw.drop_channels(["epoc"])
  
      raw_read = read_raw_edf(temp_fname, preload=True)
      assert raw.ch_names == raw_read.ch_names
      # only compare the original length, since extra zeros are appended
      orig_raw_len = len(raw)
  
      # assert data and times are not different
      # Due to the physical range of the data, reading and writing is
      # not lossless. For example, a physical min/max of -/+ 3200 uV
      # will result in a resolution of 0.09 uV. This resolution
      # though is acceptable for most EEG manufacturers.
      assert_array_almost_equal(
          raw.get_data(),
          raw_read.get_data()[:, :orig_raw_len],
          decimal=8,
      )
  
      # Due to the data record duration limitations of EDF files, one
      # cannot store arbitrary float sampling rate exactly. Usually this
      # results in two sampling rates that are off by very low number of
      # decimal points. This for practical purposes does not matter
      # but will result in an error when say the number of time points
      # is very very large.
      assert_allclose(
          raw.times, raw_read.times[:orig_raw_len], rtol=0, atol=1e-5
      )
  
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 11 for calling a global function with example usage: test_export_raw_edf(tmp_path, input_path, warning_msg) without return types