code: def test_rank_deficiency():
      """Test adding noise from M/EEG float32 (I/O) cov with projectors."""
      # See gh-5940
      evoked = read_evokeds(ave_fname, 0, baseline=(None, 0))
      evoked.info["bads"] = ["MEG 2443"]
      with evoked.info._unlock():
          evoked.info["lowpass"] = 20  # fake for decim
      picks = pick_types(evoked.info, meg=True, eeg=False)
      picks = picks[::16]
      evoked.pick([evoked.ch_names[pick] for pick in picks])
      evoked.info.normalize_proj()
      cov = read_cov(cov_fname)
      cov["projs"] = []
      cov = regularize(cov, evoked.info, rank=None)
      cov = pick_channels_cov(cov, evoked.ch_names)
      evoked.data[:] = 0
      add_noise(evoked, cov, random_state=0)
      cov_new = compute_covariance(
          EpochsArray(evoked.data[np.newaxis], evoked.info),
          verbose="error",
      )
      assert cov["names"] == cov_new["names"]
      r = np.corrcoef(cov["data"].ravel(), cov_new["data"].ravel())[
          0, 1
      ]
      assert r > 0.98
  
file_path: mne-python/mne/simulation/tests/test_evoked.py
imports: from pathlib import Path
  import numpy
  import pytest
  from numpy.testing import assert_allclose, assert_array_almost_equal, assert_array_equal, assert_equal
  from mne import EpochsArray, compute_covariance, compute_raw_covariance, convert_forward_solution, pick_channels_cov, pick_types, pick_types_forward, read_cov, read_evokeds, read_forward_solution
  from mne.cov import regularize, whiten_evoked
  from mne.datasets import testing
  from mne.io import read_raw_fif
  from mne.simulation import add_noise, simulate_evoked, simulate_sparse_stc
  from mne.utils import catch_logging
label_desc: Use image node_id 3 for calling a global function with example usage: test_rank_deficiency() without return types