def convert_scale_export_to_import(inpath, outpath):
    """Converts a Scale AI JSON export generated by :meth:`export_to_scale`
    into the format expected by :meth:`import_from_scale`.

    The output JSON file will have the same format that is generated when
    performing a bulk export of a Scale AI project's labels.

    Args:
        inpath: the path to an JSON file generated (for example) by
            :meth:`export_to_scale`
        outpath: the path to write a JSON file containing the converted labels

    Returns:
        a dictionary mapping sample IDs to the task IDs that were generated for
        each sample
    """
    labels = etas.read_json(inpath)

    id_map = {}
    annos = []
    for sample_id, task_dict in labels.items():
        task_id = str(uuid4())
        id_map[sample_id] = task_id
        annos.append({"task_id": task_id, "response": task_dict["hypothesis"]})

    etas.write_json(annos, outpath)

    return id_map
Converts a Scale AI JSON export generated by :meth:`export_to_scale`
    into the format expected by :meth:`import_from_scale`.

    The output JSON file will have the same format that is generated when
    performing a bulk export of a Scale AI project's labels.

    Args:
        inpath: the path to an JSON file generated (for example) by
            :meth:`export_to_scale`
        outpath: the path to write a JSON file containing the converted labels

    Returns:
        a dictionary mapping sample IDs to the task IDs that were generated for
        each sample
    
fiftyone/utils/scale.py