code: def simu_data(evoked, forward, noise_cov, n_dipoles, times, nave=1):
      """Simulate an evoked dataset with 2 sources.
  
      One source is put in each hemisphere.
      """
      # Generate the two dipoles data
      mu, sigma = 0.1, 0.005
      s1 = (
          1
          / (sigma * np.sqrt(2 * np.pi))
          * np.exp(-((times - mu) ** 2) / (2 * sigma**2))
      )
  
      mu, sigma = 0.075, 0.008
      s2 = (
          -1
          / (sigma * np.sqrt(2 * np.pi))
          * np.exp(-((times - mu) ** 2) / (2 * sigma**2))
      )
      data = np.array([s1, s2]) * 1e-9
  
      src = forward["src"]
      rng = np.random.RandomState(42)
  
      rndi = rng.randint(len(src[0]["vertno"]))
      lh_vertno = src[0]["vertno"][[rndi]]
  
      rndi = rng.randint(len(src[1]["vertno"]))
      rh_vertno = src[1]["vertno"][[rndi]]
  
      vertices = [lh_vertno, rh_vertno]
      tmin, tstep = times.min(), 1 / evoked.info["sfreq"]
      stc = mne.SourceEstimate(
          data, vertices=vertices, tmin=tmin, tstep=tstep
      )
  
      sim_evoked = mne.simulation.simulate_evoked(
          forward,
          stc,
          evoked.info,
          noise_cov,
          nave=nave,
          random_state=rng,
      )
  
      return sim_evoked, stc
  
file_path: mne-python/mne/beamformer/tests/test_rap_music.py
imports: import numpy
  import pytest
  from numpy.testing import assert_allclose
  from scipy import linalg
  import mne
  from mne.beamformer import rap_music, trap_music
  from mne.cov import regularize
  from mne.datasets import testing
  from mne.minimum_norm.tests.test_inverse import assert_var_exp_log
  from mne.utils import catch_logging
label_desc: Use image node_id 2 for calling a global function with example usage: simu_data(evoked, forward, noise_cov, n_dipoles, times, nave) and returns: sim_evoked,  stc