code: def test_export_evokeds_to_mff(tmp_path, fmt, do_history):
      """Test exporting evoked dataset to MFF."""
      pytest.importorskip("mffpy", "0.5.7")
      pytest.importorskip("defusedxml")
      evoked = read_evokeds_mff(egi_evoked_fname)
      export_fname = tmp_path / "evoked.mff"
      history = [
          {
              "name": "Test Segmentation",
              "method": "Segmentation",
              "settings": ["Setting 1", "Setting 2"],
              "results": ["Result 1", "Result 2"],
          },
          {
              "name": "Test Averaging",
              "method": "Averaging",
              "settings": ["Setting 1", "Setting 2"],
              "results": ["Result 1", "Result 2"],
          },
      ]
      if do_history:
          export_evokeds_mff(export_fname, evoked, history=history)
      else:
          export_evokeds(export_fname, evoked, fmt=fmt)
      # Drop non-EEG channels
      evoked = [ave.drop_channels(["ECG", "EMG"]) for ave in evoked]
      evoked_exported = read_evokeds_mff(export_fname)
      assert len(evoked) == len(evoked_exported)
      for ave, ave_exported in zip(evoked, evoked_exported):
          # Compare infos
          assert object_diff(ave_exported.info, ave.info) == ""
          # Compare data
          assert_allclose(ave_exported.data, ave.data)
          # Compare properties
          assert ave_exported.nave == ave.nave
          assert ave_exported.kind == ave.kind
          assert ave_exported.comment == ave.comment
          assert_allclose(ave_exported.times, ave.times)
  
      # test overwrite
      with pytest.raises(
          FileExistsError, match="Destination file exists"
      ):
          if do_history:
              export_evokeds_mff(
                  export_fname, evoked, history=history, overwrite=False
              )
          else:
              export_evokeds(export_fname, evoked, overwrite=False)
  
      if do_history:
          export_evokeds_mff(
              export_fname, evoked, history=history, overwrite=True
          )
      else:
          export_evokeds(export_fname, evoked, overwrite=True)
  
      # test export from evoked directly
      evoked[0].export(export_fname, overwrite=True)
  
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 14 for calling a global function with example usage: test_export_evokeds_to_mff(tmp_path, fmt, do_history) without return types