code: def generate_data_for_comparing_against_eeglab_infomax(
      ch_type, random_state
  ):
      """Generate data."""
      raw_fname = (
          testing_path
          / "MEG"
          / "sample"
          / "sample_audvis_trunc_raw.fif"
      )
  
      raw = read_raw_fif(raw_fname, preload=True)
  
      if ch_type == "eeg":
          picks = pick_types(
              raw.info, meg=False, eeg=True, exclude="bads"
          )
      else:
          picks = pick_types(
              raw.info, meg=ch_type, eeg=False, exclude="bads"
          )
  
      # select a small number of channels for the test
      number_of_channels_to_use = 5
      idx_perm = random_permutation(picks.shape[0], random_state)
      picks = picks[idx_perm[:number_of_channels_to_use]]
  
      raw.filter(
          1,
          45,
          picks=picks,
          filter_length="10s",
          l_trans_bandwidth=0.5,
          h_trans_bandwidth=0.5,
          phase="zero-double",
          fir_window="hann",
          fir_design="firwin2",
      )  # use the old way
      X = raw[picks, :][0][:, ::20]
  
      # Subtract the mean
      mean_X = X.mean(axis=1)
      X -= mean_X[:, None]
  
      # pre_whitening: z-score
      X /= np.std(X)
  
      T = X.shape[1]
      cov_X = np.dot(X, X.T) / T
  
      # Let's whiten the data
      U, D, _ = svd(cov_X)
      W = np.dot(U, U.T / np.sqrt(D)[:, None])
      Y = np.dot(W, X)
  
      return Y
  
file_path: mne-python/mne/preprocessing/tests/test_eeglab_infomax.py
imports: from pathlib import Path
  import numpy
  import pytest
  import scipy.io
  from numpy.testing import assert_almost_equal
  from scipy.linalg import pinv, svd
  from mne import pick_types
  from mne.datasets import testing
  from mne.io import read_raw_fif
  from mne.preprocessing.infomax_ import infomax
  from mne.utils import random_permutation
label_desc: Use image node_id 1 for calling a global function with example usage: generate_data_for_comparing_against_eeglab_infomax(ch_type, random_state) and returns: Y