code: def data_fun(times):
      """Generate time-staggered sinusoids at harmonics of 10Hz."""
      global n
      n_samp = len(times)
      window = np.zeros(n_samp)
      start, stop = (
          int(ii * float(n_samp) / (2 * n_dipoles))
          for ii in (2 * n, 2 * n + 1)
      )
      window[start:stop] = 1.0
      n += 1
      data = 25e-9 * np.sin(2.0 * np.pi * 10.0 * n * times)
      data *= window
      return data
  
imports: import matplotlib.pyplot
  import numpy
  import mne
  from mne import Epochs, compute_covariance, find_events, make_ad_hoc_cov
  from mne.datasets import sample
  from mne.simulation import add_ecg, add_eog, add_noise, simulate_raw, simulate_sparse_stc
label_desc: Use image node_id 1 for calling a global function with example usage: data_fun(times) and returns: data