code: def _make_eyelink_annots(df_dict, create_annots, apply_offsets):
      """Create Annotations for each df in raw_extras."""
      eye_ch_map = {
          "L": ("xpos_left", "ypos_left", "pupil_left"),
          "R": ("xpos_right", "ypos_right", "pupil_right"),
          "both": (
              "xpos_left",
              "ypos_left",
              "pupil_left",
              "xpos_right",
              "ypos_right",
              "pupil_right",
          ),
      }
      valid_descs = ["blinks", "saccades", "fixations", "messages"]
      msg = (
          "create_annotations must be True or a list containing one or"
          f" more of {valid_descs}."
      )
      wrong_type = msg + f" Got a {type(create_annots)} instead."
      if create_annots is True:
          descs = valid_descs
      else:
          if not isinstance(create_annots, list):
              raise TypeError(wrong_type)
          for desc in create_annots:
              if desc not in valid_descs:
                  raise ValueError(msg + f" Got '{desc}' instead")
          descs = create_annots
  
      annots = None
      for key, df in df_dict.items():
          eye_annot_cond = (
              key in ["blinks", "fixations", "saccades"]
          ) and (key in descs)
          if eye_annot_cond:
              onsets = df["time"]
              durations = df["duration"]
              # Create annotations for both eyes
              descriptions = key[
                  :-1
              ]  # i.e "blink", "fixation", "saccade"
              if key == "blinks":
                  descriptions = "BAD_" + descriptions
              ch_names = df["eye"].map(eye_ch_map).tolist()
              this_annot = Annotations(
                  onset=onsets,
                  duration=durations,
                  description=descriptions,
                  ch_names=ch_names,
              )
          elif (key in ["messages"]) and (key in descs):
              if apply_offsets:
                  # If df['offset] is all NaNs, time is not changed
                  onsets = df["time"] + df["offset"].fillna(0)
              else:
                  onsets = df["time"]
              durations = [0] * onsets
              descriptions = df["event_msg"]
              this_annot = Annotations(
                  onset=onsets,
                  duration=durations,
                  description=descriptions,
              )
          else:
              continue  # TODO make df and annotations for Buttons
          if not annots:
              annots = this_annot
          elif annots:
              annots += this_annot
      if not annots:
          warn(
              f"Annotations for {descs} were requested but none could be made."
          )
          return
      return annots
  
imports: import re
  from datetime import datetime, timedelta, timezone
  import numpy
  from ..._fiff.constants import FIFF
  from ..._fiff.meas_info import create_info
  from ...annotations import Annotations
  from ...utils import _check_pandas_installed, logger, warn
label_desc: Use image node_id 21 for calling a global function with example usage: _make_eyelink_annots(df_dict, create_annots, apply_offsets) and returns: annots