code: def test_to_data_frame():
      """Test evoked Pandas exporter."""
      pytest.importorskip("pandas")
      ave = read_evokeds(fname, 0)
      # test index checking
      with pytest.raises(
          ValueError, match="options. Valid index options are"
      ):
          ave.to_data_frame(index=["foo", "bar"])
      with pytest.raises(
          ValueError, match='"qux" is not a valid option'
      ):
          ave.to_data_frame(index="qux")
      with pytest.raises(
          TypeError, match="index must be `None` or a string or"
      ):
          ave.to_data_frame(index=np.arange(400))
      # test setting index
      df = ave.to_data_frame(index="time")
      assert "time" not in df.columns
      assert "time" in df.index.names
      # test wide and long formats
      df_wide = ave.to_data_frame()
      assert all(np.isin(ave.ch_names, df_wide.columns))
      df_long = ave.to_data_frame(long_format=True)
      expected = ("time", "channel", "ch_type", "value")
      assert set(expected) == set(df_long.columns)
      assert set(ave.ch_names) == set(df_long["channel"])
      assert len(df_long) == ave.data.size
      del df_wide, df_long
      # test scalings
      df = ave.to_data_frame(index="time")
      assert (df.columns == ave.ch_names).all()
      assert_array_equal(df.values[:, 0], ave.data[0] * 1e13)
      assert_array_equal(df.values[:, 2], ave.data[2] * 1e15)
  
imports: import pickle
  from copy import deepcopy
  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 import fftpack
  from mne import Epochs, EpochsArray, combine_evoked, create_info, equalize_channels, pick_types, read_events, read_evokeds, write_evokeds
  from mne._fiff.constants import FIFF
  from mne.evoked import Evoked, EvokedArray, _get_peak
  from mne.io import read_raw_fif
  from mne.utils import grand_average
label_desc: Use image node_id 14 for calling a global function with example usage: test_to_data_frame() without return types