def download_annotations(self, results):
        """Downloads the annotations from the Labelbox server for the given
        results instance and parses them into the appropriate FiftyOne types.

        Args:
            results: a :class:`LabelboxAnnotationResults`

        Returns:
            the annotations dict
        """
        project_id = results.project_id
        frame_id_map = results.frame_id_map
        classes_as_attrs = results.config.classes_as_attrs
        label_schema = results.config.label_schema

        project = self._client.get_project(project_id)
        labels_json = self._download_project_labels(project=project)

        dataset = results.samples._root_dataset
        is_video = any(dataset._is_frame_field(f) for f in label_schema.keys())

        annotations = {}

        if classes_as_attrs:
            class_attr = "class_name"
        else:
            class_attr = False

        converter = self._LabelboxExportToFiftyOneConverter

        for d in labels_json:
            labelbox_id = converter._get_datarow_id(d)
            sample_id = converter._get_global_key(d)

            if sample_id is None:
                logger.warning(
                    "Skipping DataRow '%s' with no sample ID", labelbox_id
                )
                continue

            metadata = self._get_sample_metadata(project, sample_id)
            if metadata is None:
                logger.warning(
                    "Skipping sample '%s' with no metadata, likely due to not "
                    "finding a DataRow with a matching Global Key",
                    sample_id,
                )
                continue

            frame_size = (metadata["width"], metadata["height"])

            if is_video:
                frames = {}
                for frame_number, label_d in converter._iter_video_labels(
                    d, project_id
                ):
                    frame_id = frame_id_map[sample_id][frame_number]
                    labels_dict = converter._parse_image_labels(
                        label_d,
                        frame_size,
                        class_attr=class_attr,
                        headers=self._client.headers,
                    )
                    if not classes_as_attrs:
                        labels_dict = self._process_label_fields(
                            label_schema, labels_dict
                        )
                    frames[frame_id] = labels_dict

                self._add_video_labels_to_results(
                    annotations,
                    frames,
                    sample_id,
                    label_schema,
                )

            labels_dict = converter._parse_image_labels(
                converter._get_labels_dict(d, project_id),
                frame_size,
                class_attr=class_attr,
                headers=self._client.headers,
            )
            if not classes_as_attrs:
                labels_dict = self._process_label_fields(
                    label_schema, labels_dict
                )
            annotations = self._add_labels_to_results(
                annotations,
                labels_dict,
                sample_id,
                label_schema,
            )

        return annotations
Downloads the annotations from the Labelbox server for the given
        results instance and parses them into the appropriate FiftyOne types.

        Args:
            results: a :class:`LabelboxAnnotationResults`

        Returns:
            the annotations dict
        
fiftyone/utils/labelbox.py