code: def _simulate_erplike_mixed_data(n_epochs=100, n_channels=10):
      rng = np.random.RandomState(42)
      tmin, tmax = 0.0, 1.0
      sfreq = 100.0
      informative_ch_idx = 0
  
      y = rng.randint(0, 2, n_epochs)
      n_times = int((tmax - tmin) * sfreq)
      epoch_times = np.linspace(tmin, tmax, n_times)
  
      target_template = (
          1e-6 * (epoch_times - tmax) * np.sin(2 * np.pi * epoch_times)
      )
      nontarget_template = (
          0.7e-6
          * (epoch_times - tmax)
          * np.sin(2 * np.pi * (epoch_times - 0.1))
      )
  
      epoch_data = rng.randn(n_epochs, n_channels, n_times) * 5e-7
      epoch_data[y == 0, informative_ch_idx, :] += nontarget_template
      epoch_data[y == 1, informative_ch_idx, :] += target_template
  
      mixing_mat = _safe_svd(rng.randn(n_channels, n_channels))[0]
      mixed_epoch_data = np.dot(mixing_mat.T, epoch_data).transpose(
          (1, 0, 2)
      )
  
      events = np.zeros((n_epochs, 3), dtype=int)
      events[:, 0] = np.arange(0, n_epochs * n_times, n_times)
      events[:, 2] = y
  
      info = create_info(
          ch_names=[f"C{i:02d}" for i in range(n_channels)],
          ch_types=["eeg"] * n_channels,
          sfreq=sfreq,
      )
      epochs = EpochsArray(
          mixed_epoch_data,
          info,
          events,
          tmin=tmin,
          event_id={"nt": 0, "t": 1},
      )
  
      return epochs, mixing_mat
  
file_path: mne-python/mne/preprocessing/tests/test_xdawn.py
imports: from pathlib import Path
  import numpy
  import pytest
  from numpy.testing import assert_allclose, assert_array_almost_equal, assert_array_equal
  from scipy import stats
  from mne import Epochs, EpochsArray, compute_raw_covariance, create_info, pick_types, read_events
  from mne.decoding import Vectorizer
  from mne.fixes import _safe_svd
  from mne.io import read_raw_fif
  from mne.preprocessing.xdawn import Xdawn, _XdawnTransformer
label_desc: Use image node_id 8 for calling a global function with example usage: _simulate_erplike_mixed_data(n_epochs, n_channels) and returns: epochs,  mixing_mat