code: def test_evoked_resample(tmp_path):
      """Test resampling evoked data."""
      # upsample, write it out, read it in
      ave = read_evokeds(fname, 0)
      orig_lp = ave.info["lowpass"]
      sfreq_normal = ave.info["sfreq"]
      ave.resample(2 * sfreq_normal, npad=100)
      assert ave.info["lowpass"] == orig_lp
      fname_temp = tmp_path / "evoked-ave.fif"
      write_evokeds(fname_temp, ave)
      ave_up = read_evokeds(fname_temp, 0)
  
      # compare it to the original
      ave_normal = read_evokeds(fname, 0)
  
      # and compare the original to the downsampled upsampled version
      ave_new = read_evokeds(fname_temp, 0)
      ave_new.resample(sfreq_normal, npad=100)
      assert ave.info["lowpass"] == orig_lp
  
      assert_array_almost_equal(ave_normal.data, ave_new.data, 2)
      assert_array_almost_equal(ave_normal.times, ave_new.times)
      assert_equal(ave_normal.nave, ave_new.nave)
      assert_equal(ave_normal._aspect_kind, ave_new._aspect_kind)
      assert_equal(ave_normal.kind, ave_new.kind)
      assert_equal(ave_normal.last, ave_new.last)
      assert_equal(ave_normal.first, ave_new.first)
  
      # for the above to work, the upsampling just about had to, but
      # we'll add a couple extra checks anyway
      assert len(ave_up.times) == 2 * len(ave_normal.times)
      assert ave_up.data.shape[1] == 2 * ave_normal.data.shape[1]
  
      ave_new.resample(50)
      assert ave_new.info["sfreq"] == 50.0
      assert ave_new.info["lowpass"] == 25.0
  
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 10 for calling a global function with example usage: test_evoked_resample(tmp_path) without return types