code: def interpolate_blinks(
      raw, buffer=0.05, match="BAD_blink", interpolate_gaze=False
  ):
      """Interpolate eyetracking signals during blinks.
  
      This function uses the timing of blink annotations to estimate missing
      data. Operates in place.
  
      Parameters
      ----------
      raw : instance of Raw
          The raw data with at least one ``'pupil'`` or ``'eyegaze'`` channel.
      buffer : float | array-like of float, shape ``(2,))``
          The time in seconds before and after a blink to consider invalid and
          include in the segment to be interpolated over. Default is ``0.05`` seconds
          (50 ms). If array-like, the first element is the time before the blink and the
          second element is the time after the blink to consider invalid, for example,
          ``(0.025, .1)``.
      match : str | list of str
          The description of annotations to interpolate over. If a list, the data within
          all annotations that match any of the strings in the list will be interpolated
          over. Defaults to ``'BAD_blink'``.
      interpolate_gaze : bool
          If False, only apply interpolation to ``'pupil channels'``. If True, interpolate
          over ``'eyegaze'`` channels as well. Defaults to False, because eye position can
          change in unpredictable ways during blinks.
  
      Returns
      -------
      self : instance of Raw
          Returns the modified instance.
  
      Notes
      -----
      .. versionadded:: 1.5
      """
      _check_preload(raw, "interpolate_blinks")
      _validate_type(raw, BaseRaw, "raw")
      _validate_type(buffer, (float, tuple, list, np.ndarray), "buffer")
      _validate_type(match, (str, tuple, list, np.ndarray), "match")
  
      # determine the buffer around blinks to include in the interpolation
      buffer = np.array(buffer, dtype=float)
      if buffer.size == 1:
          buffer = np.array([buffer, buffer])
  
      if isinstance(match, str):
          match = [match]
  
      # get the blink annotations
      blink_annots = [
          annot
          for annot in raw.annotations
          if annot["description"] in match
      ]
      if not blink_annots:
          warn(f"No annotations matching {match} found. Aborting.")
          return raw
      _interpolate_blinks(
          raw, buffer, blink_annots, interpolate_gaze=interpolate_gaze
      )
  
      # remove bad from the annotation description
      for desc in match:
          if desc.startswith("BAD_"):
              logger.info(f"Removing 'BAD_' from {desc}.")
              raw.annotations.rename({desc: desc.replace("BAD_", "")})
      return raw
  
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 1 for calling a global function with example usage: interpolate_blinks(raw, buffer, match, interpolate_gaze) and returns: raw, raw