code: def simulate_data(
      target, n_trials=100, n_channels=10, random_state=42
  ):
      """Simulate data according to an instantaneous mixin model.
  
      Data are simulated in the statistical source space, where one source is
      modulated according to a target variable, before being mixed with a
      random mixing matrix.
      """
      rs = np.random.RandomState(random_state)
  
      # generate a orthogonal mixin matrix
      mixing_mat = np.linalg.svd(rs.randn(n_channels, n_channels))[0]
  
      S = rs.randn(n_trials, n_channels, 50)
      S[:, 0] *= np.atleast_2d(np.sqrt(target)).T
      S[:, 1:] *= 0.01  # less noise
  
      X = np.dot(mixing_mat, S).transpose((1, 0, 2))
  
      return X, mixing_mat
  
file_path: mne-python/mne/decoding/tests/test_csp.py
imports: from pathlib import Path
  import numpy
  import pytest
  from numpy.testing import assert_array_almost_equal, assert_array_equal, assert_equal
  from mne import Epochs, io, pick_types, read_events
  from mne.decoding.csp import CSP, SPoC, _ajd_pham
label_desc: Use image node_id 1 for calling a global function with example usage: simulate_data(target, n_trials, n_channels, random_state) and returns: X,  mixing_mat