code: def _fix_artifact(data, window, picks, first_samp, last_samp, mode):
      """Modify original data by using parameter data."""
      if mode == "linear":
          x = np.array([first_samp, last_samp])
          f = interp1d(x, data[:, (first_samp, last_samp)][picks])
          xnew = np.arange(first_samp, last_samp)
          interp_data = f(xnew)
          data[picks, first_samp:last_samp] = interp_data
      if mode == "window":
          data[picks, first_samp:last_samp] = (
              data[picks, first_samp:last_samp] * window[np.newaxis, :]
          )
  
file_path: mne-python/mne/preprocessing/stim.py
imports: import numpy
  from scipy.interpolate import interp1d
  from scipy.signal.windows import hann
  from .._fiff.pick import _picks_to_idx
  from ..epochs import BaseEpochs
  from ..event import find_events
  from ..evoked import Evoked
  from ..io import BaseRaw
  from ..utils import _check_option, _check_preload, fill_doc
label_desc: Use image node_id 2 for calling a global function with example usage: _fix_artifact(data, window, picks, first_samp, last_samp, mode) without return types