code: def test_add_channels():
      """Test evoked splitting / re-appending channel types."""
      evoked = read_evokeds(fname, condition=0)
      hpi_coils = [
          {"event_bits": []},
          {"event_bits": np.array([256, 0, 256, 256])},
          {"event_bits": np.array([512, 0, 512, 512])},
      ]
      with evoked.info._unlock():
          evoked.info["hpi_subsystem"] = dict(
              hpi_coils=hpi_coils, ncoil=2
          )
      evoked_eeg = evoked.copy().pick(picks="eeg")
      evoked_meg = evoked.copy().pick(picks="meg")
      evoked_stim = evoked.copy().pick(picks="stim")
      evoked_eeg_meg = evoked.copy().pick(picks=["meg", "eeg"])
      evoked_new = evoked_meg.copy().add_channels(
          [evoked_eeg, evoked_stim]
      )
      assert all(
          ch in evoked_new.ch_names
          for ch in evoked_stim.ch_names + evoked_meg.ch_names
      )
      evoked_new = evoked_meg.copy().add_channels([evoked_eeg])
  
      assert (ch in evoked_new.ch_names for ch in evoked.ch_names)
      assert_array_equal(evoked_new.data, evoked_eeg_meg.data)
      assert all(
          ch not in evoked_new.ch_names for ch in evoked_stim.ch_names
      )
  
      # Now test errors
      evoked_badsf = evoked_eeg.copy()
      with evoked_badsf.info._unlock():
          evoked_badsf.info["sfreq"] = 3.1415927
      evoked_eeg = evoked_eeg.crop(-0.1, 0.1)
  
      pytest.raises(
          RuntimeError, evoked_meg.add_channels, [evoked_badsf]
      )
      pytest.raises(ValueError, evoked_meg.add_channels, [evoked_eeg])
      pytest.raises(ValueError, evoked_meg.add_channels, [evoked_meg])
      pytest.raises(TypeError, evoked_meg.add_channels, evoked_badsf)
  
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 24 for calling a global function with example usage: test_add_channels() without return types