def METHOD_NAME(
    label_id,
    image_url,
    labels,
    label_format,
    images_output_dir,
    annotations_output_dir,
):
    "Writes a Pascal VOC formatted image and label pair to disk."
    # Download image and save it
    response = requests.get(image_url, stream=True)
    response.raw.decode_content = True
    im = Image.open(response.raw)
    image_name = f"{label_id}.{im.format.lower()}"
    image_fqn = os.path.join(images_output_dir, image_name)
    im.save(image_fqn, format=im.format)
    # generate image annotation in Pascal VOC
    width, height = im.size
    xml_writer = PascalWriter(image_fqn, width, height)
    # remove classification labels (Skip, etc...)
    if not callable(getattr(labels, "keys", None)):
        # skip if no categories (e.g. "Skip")
        return
    # convert label to Pascal VOC format
    for category_name, wkt_data in labels.items():
        if label_format == "WKT":
            xml_writer = _add_pascal_object_from_wkt(
                xml_writer,
                img_height=height,
                wkt_data=wkt_data,
                label=category_name,
            )
        elif label_format == "XY":
            xml_writer = _add_pascal_object_from_xy(
                xml_writer,
                img_height=height,
                polygons=wkt_data,
                label=category_name,
            )
        else:
            e = UnknownFormatError(label_format=label_format)
            logging.exception(e.message)
            raise e
    # write Pascal VOC xml annotation for image
    xml_writer.save(os.path.join(annotations_output_dir, f"{label_id}.xml"))