code: def test_evoked_baseline(tmp_path):
      """Test evoked baseline."""
      evoked = read_evokeds(fname, condition=0, baseline=None)
  
      # Here we create a data_set with constant data.
      evoked = EvokedArray(
          np.ones_like(evoked.data), evoked.info, evoked.times[0]
      )
      assert evoked.baseline is None
  
      evoked_baselined = EvokedArray(
          np.ones_like(evoked.data),
          evoked.info,
          evoked.times[0],
          baseline=(None, 0),
      )
      assert_allclose(
          evoked_baselined.baseline, (evoked_baselined.tmin, 0)
      )
      del evoked_baselined
  
      # Mean baseline correction is applied, since the data is equal to its mean
      # the resulting data should be a matrix of zeroes.
      baseline = (None, None)
      evoked.apply_baseline(baseline)
      assert_allclose(evoked.baseline, (evoked.tmin, evoked.tmax))
      assert_allclose(evoked.data, np.zeros_like(evoked.data))
  
      # Test that the .baseline attribute changes if we apply a different
      # baseline now.
      baseline = (None, 0)
      evoked.apply_baseline(baseline)
      assert_allclose(evoked.baseline, (evoked.tmin, 0))
  
      # By default for our test file, no baseline should be set upon reading
      evoked = read_evokeds(fname, condition=0)
      assert evoked.baseline is None
  
      # Test that the .baseline attribute is set when we call read_evokeds()
      # with a `baseline` parameter.
      baseline = (-0.2, -0.1)
      evoked = read_evokeds(fname, condition=0, baseline=baseline)
      assert_allclose(evoked.baseline, baseline)
  
      # Test that the .baseline attribute survives an I/O roundtrip.
      evoked = read_evokeds(fname, condition=0)
      baseline = (-0.2, -0.1)
      evoked.apply_baseline(baseline)
      assert_allclose(evoked.baseline, baseline)
  
      tmp_fname = tmp_path / "test-ave.fif"
      evoked.save(tmp_fname)
      evoked_read = read_evokeds(tmp_fname, condition=0)
      assert_allclose(evoked_read.baseline, evoked.baseline)
  
      # We shouldn't be able to remove a baseline correction after it has been
      # applied.
      evoked = read_evokeds(fname, condition=0)
      baseline = (-0.2, -0.1)
      evoked.apply_baseline(baseline)
      with pytest.raises(
          ValueError, match="already been baseline-corrected"
      ):
          evoked.apply_baseline(None)
  
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 25 for calling a global function with example usage: test_evoked_baseline(tmp_path) without return types