code: def test_add_channels():
      """Test tfr splitting / re-appending channel types."""
      data = np.zeros((6, 2, 3))
      times = np.array([0.1, 0.2, 0.3])
      freqs = np.array([0.10, 0.20])
      info = mne.create_info(
          [
              "MEG 001",
              "MEG 002",
              "MEG 003",
              "EEG 001",
              "EEG 002",
              "STIM 001",
          ],
          1000.0,
          ["mag", "mag", "mag", "eeg", "eeg", "stim"],
      )
      tfr = AverageTFR(
          info,
          data=data,
          times=times,
          freqs=freqs,
          nave=20,
          comment="test",
          method="crazy-tfr",
      )
      tfr_eeg = tfr.copy().pick(picks="eeg")
      tfr_meg = tfr.copy().pick(picks="meg")
      tfr_stim = tfr.copy().pick(picks="stim")
      tfr_eeg_meg = tfr.copy().pick(picks=["meg", "eeg"])
      tfr_new = tfr_meg.copy().add_channels([tfr_eeg, tfr_stim])
      assert all(
          ch in tfr_new.ch_names
          for ch in tfr_stim.ch_names + tfr_meg.ch_names
      )
      tfr_new = tfr_meg.copy().add_channels([tfr_eeg])
  
      have_all = all(
          ch in tfr_new.ch_names
          for ch in tfr.ch_names
          if ch != "STIM 001"
      )
      assert have_all
      assert_array_equal(tfr_new.data, tfr_eeg_meg.data)
      assert all(ch not in tfr_new.ch_names for ch in tfr_stim.ch_names)
  
      # Now test errors
      tfr_badsf = tfr_eeg.copy()
      with tfr_badsf.info._unlock():
          tfr_badsf.info["sfreq"] = 3.1415927
      tfr_eeg = tfr_eeg.crop(0.1, 0.1)
  
      pytest.raises(RuntimeError, tfr_meg.add_channels, [tfr_badsf])
      pytest.raises(ValueError, tfr_meg.add_channels, [tfr_eeg])
      pytest.raises(ValueError, tfr_meg.add_channels, [tfr_meg])
      pytest.raises(TypeError, tfr_meg.add_channels, tfr_badsf)
  
imports: import datetime
  import re
  from itertools import product
  from pathlib import Path
  import matplotlib.pyplot
  import numpy
  import pytest
  from numpy.testing import assert_allclose, assert_array_equal, assert_equal
  from scipy.signal import morlet2
  import mne
  from mne import Epochs, EpochsArray, Info, Transform, create_info, pick_types, read_events
  from mne.io import read_raw_fif
  from mne.tests.test_epochs import assert_metadata_equal
  from mne.time_frequency import tfr_array_morlet, tfr_array_multitaper
  from mne.time_frequency.tfr import AverageTFR, EpochsTFR, _compute_tfr, _make_dpss, combine_tfr, cwt, fwhm, morlet, read_tfrs, tfr_morlet, tfr_multitaper, write_tfrs
  from mne.utils import catch_logging, grand_average
  from mne.viz.utils import _fake_click, _fake_keypress, _fake_scroll
label_desc: Use image node_id 13 for calling a global function with example usage: test_add_channels() without return types