code: def _parse_video_annotation_labels(
      annos, events, metadata, task=None
  ):
      if annos is not None:
          annos = annos.get("annotations", [])
      else:
          annos = []
  
      frame_numbers = None
      if task is not None:
          try:
              frame_numbers = _get_frame_numbers(task, metadata)
          except:
              pass
  
      if frame_numbers is None:
          frame_numbers = range(1, len(annos) + 1)
  
      if len(frame_numbers) != len(annos):
          logger.warning(
              "Unable to determine which frame numbers have labels. You may "
              "need to inspect the labels that are loaded..."
          )
  
      frame_size = (metadata.frame_width, metadata.frame_height)
  
      frames = defaultdict(dict)
  
      # Parse frame labels
      for frame_number, anno_dict in zip(frame_numbers, annos):
          frames[frame_number] = _parse_image_labels(
              anno_dict, frame_size
          )
  
      # Parse events
      if events is not None:
          events = events.get("events", [])
          _parse_video_playback_events(frames, events)
  
      return frames
  
imports: from collections import defaultdict
  from copy import deepcopy
  import logging
  import os
  from uuid import uuid4
  import warnings
  import numpy
  import eta.core.image
  import eta.core.serial
  import eta.core.utils
  import eta.core.web
  import fiftyone.core.labels
  import fiftyone.core.media
  import fiftyone.core.metadata
  import fiftyone.core.utils
  import fiftyone.core.validation
  import fiftyone.utils.image
label_desc: Use image node_id 27 for calling a global function with example usage: _parse_video_annotation_labels(annos, events, metadata, task) and returns: frames