code: def _parse_bdd_annotation(d, frame_size, extra_attrs):
      labels = {}
  
      #
      # Frame attributes
      #
      # @todo problems may occur if frame attributes have names "detections" or
      # "polylines", but we cross our fingers and proceeed
      #
      frame_labels = _parse_frame_labels(d.get("attributes", {}))
      labels.update(frame_labels)
  
      # Objects and polylines
      for label in d.get("labels", []):
          if "box2d" in label:
              if "detections" not in labels:
                  labels["detections"] = fol.Detections()
  
              detection = _parse_bdd_detection(
                  label, frame_size, extra_attrs
              )
              labels["detections"].detections.append(detection)
  
          if "poly2d" in label:
              if "polylines" not in labels:
                  labels["polylines"] = fol.Polylines()
  
              polylines = _parse_bdd_polylines(
                  label, frame_size, extra_attrs
              )
              labels["polylines"].polylines.extend(polylines)
  
      return labels
  
imports: from copy import deepcopy
  import logging
  import os
  import warnings
  import eta.core.serial
  import eta.core.utils
  import fiftyone
  import fiftyone.core.labels
  import fiftyone.core.metadata
  import fiftyone.core.storage
  import fiftyone.utils.data
label_desc: Use image node_id 7 for calling a global function with example usage: _parse_bdd_annotation(d, frame_size, extra_attrs) and returns: labels