def generate_labeling_config(label_schema, media):
    """Generates a labeling config for a Label Studio project.

    Args:
        label_shema: dict defining each label type
        media: The media type to label

    Returns:
        a labeling config
    """
    assert media in ["image", "video"]
    possible_types = list(_LABEL_TYPES.keys()) + list(
        foua._RETURN_TYPES_MAP.keys()
    )

    # root view and media view
    root = etree.Element("View")
    etree.SubElement(root, media.capitalize(), name=media, value=f"${media}")

    for label_field, label_info in label_schema.items():
        assert label_info["type"] in possible_types
        parent_tag, child_tag, tag_kwargs = _ls_tags_from_type(
            label_info["type"]
        )
        label_view = etree.SubElement(
            root, parent_tag, name=label_field, toName=media, **tag_kwargs
        )
        if "classes" in label_info and label_info["classes"]:
            for one in label_info["classes"]:
                etree.SubElement(label_view, child_tag, value=one)

    config_str = etree.tostring(root, pretty_print=True).decode()
    return config_str
Generates a labeling config for a Label Studio project.

    Args:
        label_shema: dict defining each label type
        media: The media type to label

    Returns:
        a labeling config
    
fiftyone/utils/labelstudio.py