code: def export_evokeds_mff(
      fname, evoked, history=None, *, overwrite=False, verbose=None
  ):
      """Export evoked dataset to MFF.
  
      %(export_warning)s
  
      Parameters
      ----------
      %(fname_export_params)s
      evoked : list of Evoked instances
          List of evoked datasets to export to one file. Note that the
          measurement info from the first evoked instance is used, so be sure
          that information matches.
      history : None (default) | list of dict
          Optional list of history entries (dictionaries) to be written to
          history.xml. This must adhere to the format described in
          mffpy.xml_files.History.content. If None, no history.xml will be
          written.
      %(overwrite)s
  
          .. versionadded:: 0.24.1
      %(verbose)s
  
      Notes
      -----
      .. versionadded:: 0.24
  
      %(export_warning_note_evoked)s
  
      Only EEG channels are written to the output file.
      ``info['device_info']['type']`` must be a valid MFF recording device
      (e.g. 'HydroCel GSN 256 1.0'). This field is automatically populated when
      using MFF read functions.
      """
      mffpy = _import_mffpy("Export evokeds to MFF.")
  
      info = evoked[0].info
      if np.round(info["sfreq"]) != info["sfreq"]:
          raise ValueError(
              "Sampling frequency must be a whole number. "
              f'sfreq: {info["sfreq"]}'
          )
      sampling_rate = int(info["sfreq"])
  
      # check for unapplied projectors
      if any(not proj["active"] for proj in evoked[0].info["projs"]):
          warn(
              "Evoked instance has unapplied projectors. Consider applying "
              "them before exporting with evoked.apply_proj()."
          )
  
      # Initialize writer
      # Future changes: conditions based on version or mffpy requirement if
      # https://github.com/BEL-Public/mffpy/pull/92 is merged and released.
      fname = str(_check_fname(fname, overwrite=overwrite))
      if op.exists(fname):
          os.remove(fname) if op.isfile(fname) else shutil.rmtree(fname)
      writer = mffpy.Writer(fname)
      current_time = datetime.datetime.now(datetime.timezone.utc)
      writer.addxml("fileInfo", recordTime=current_time)
      try:
          device = info["device_info"]["type"]
      except (TypeError, KeyError):
          raise ValueError(
              "No device type. Cannot determine sensor layout."
          )
      writer.add_coordinates_and_sensor_layout(device)
  
      # Add EEG data
      eeg_channels = pick_types(info, eeg=True, exclude=[])
      eeg_bin = mffpy.bin_writer.BinWriter(sampling_rate)
      for ave in evoked:
          # Signals are converted to µV
          block = (ave.data[eeg_channels] * 1e6).astype(np.float32)
          eeg_bin.add_block(block, offset_us=0)
      writer.addbin(eeg_bin)
  
      # Add categories
      categories_content = _categories_content_from_evokeds(evoked)
      writer.addxml("categories", categories=categories_content)
  
      # Add history
      if history:
          writer.addxml("historyEntries", entries=history)
  
      writer.write()
  
file_path: mne-python/mne/export/_egimff.py
imports: import datetime
  import os
  import os.path
  import shutil
  import numpy
  from .._fiff.pick import pick_channels, pick_types
  from ..io.egi.egimff import _import_mffpy
  from ..utils import _check_fname, verbose, warn
label_desc: Use image node_id 1 for calling a global function with example usage: export_evokeds_mff(fname, evoked, history) without return types