def METHOD_NAME(labels: LabelCollection,
                        image_root: Union[Path, str],
                        ignore_existing_data=False,
                        max_workers=8) -> Dict[str, Any]:
    """
    Convert a Labelbox LabelCollection into an mscoco dataset.
    This function will only convert masks, polygons, and rectangles.
    Masks will be converted into individual instances.
    Use deserialize_panoptic to prevent masks from being split apart.
    Args:
        labels: A collection of labels to convert
        image_root: Where to save images to
        ignore_existing_data: Whether or not to raise an exception if images already exist.
            This exists only to support detectons panoptic fpn model which requires two mscoco payloads for the same images.
        max_workers : Number of workers to process dataset with. A value of 0 will process all data in the main process
    Returns:
        A dictionary containing labels in the coco object format.
    """
    image_root = create_path_if_not_exists(image_root, ignore_existing_data)
    return CocoInstanceDataset.from_common(labels=labels,
                                           image_root=image_root,
                                           max_workers=max_workers).dict()