code: def _interpolate_blinks(raw, buffer, blink_annots, interpolate_gaze):
      """Interpolate eyetracking signals during blinks in-place."""
      logger.info("Interpolating missing data during blinks...")
      pre_buffer, post_buffer = buffer
      # iterate over each eyetrack channel and interpolate the blinks
      for ci, ch_info in enumerate(raw.info["chs"]):
          if interpolate_gaze:  # interpolate over all eyetrack channels
              if ch_info["kind"] != FIFF.FIFFV_EYETRACK_CH:
                  continue
          else:  # interpolate over pupil channels only
              if ch_info["coil_type"] != FIFF.FIFFV_COIL_EYETRACK_PUPIL:
                  continue
          # Create an empty boolean mask
          mask = np.zeros_like(raw.times, dtype=bool)
          for annot in blink_annots:
              if "ch_names" not in annot or not annot["ch_names"]:
                  msg = f"Blink annotation missing values for 'ch_names' key: {annot}"
                  raise ValueError(msg)
              start = annot["onset"] - pre_buffer
              end = annot["onset"] + annot["duration"] + post_buffer
              if ch_info["ch_name"] not in annot["ch_names"]:
                  continue  # skip if the channel is not in the blink annotation
              # Update the mask for times within the current blink period
              mask |= (raw.times >= start) & (raw.times <= end)
          blink_indices = np.where(mask)[0]
          non_blink_indices = np.where(~mask)[0]
  
          # Linear interpolation
          interpolated_samples = np.interp(
              raw.times[blink_indices],
              raw.times[non_blink_indices],
              raw._data[ci, non_blink_indices],
          )
          # Replace the samples at the blink_indices with the interpolated values
          raw._data[ci, blink_indices] = interpolated_samples
  
imports: import numpy
  from ..._fiff.constants import FIFF
  from ...io import BaseRaw
  from ...utils import _check_preload, _validate_type, logger, warn
label_desc: Use image node_id 2 for calling a global function with example usage: _interpolate_blinks(raw, buffer, blink_annots, interpolate_gaze) without return types