code: 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
  
imports: from collections import defaultdict
  from copy import deepcopy
  import logging
  import os
  from uuid import uuid4
  import warnings
  import numpy
  import eta.core.image
  import eta.core.serial
  import eta.core.utils
  import eta.core.web
  import fiftyone.core.labels
  import fiftyone.core.media
  import fiftyone.core.metadata
  import fiftyone.core.utils
  import fiftyone.core.validation
  import fiftyone.utils.image
label_desc: Use image node_id 3 for calling a global function with example usage: convert_scale_export_to_import(inpath, outpath) and returns: id_map