code: def _export_split(
      split,
      split_dir,
      images_dir,
      fine_annos_dir,
      coarse_annos_dir,
      person_annos_dir,
  ):
      images_map = _parse_images(images_dir, split)
  
      if fine_annos_dir:
          fine_annos_map = _parse_fine_annos(fine_annos_dir, split)
      else:
          fine_annos_map = {}
  
      if coarse_annos_dir:
          coarse_annos_map = _parse_coarse_annos(
              coarse_annos_dir, split
          )
      else:
          coarse_annos_map = {}
  
      if person_annos_dir:
          person_annos_map = _parse_person_annos(
              person_annos_dir, split
          )
      else:
          person_annos_map = {}
  
      dataset = fod.Dataset()
      dataset.media_type = fom.IMAGE
  
      has_fine_annos = bool(fine_annos_map)
      has_coarse_annos = bool(coarse_annos_map)
      has_person_annos = bool(person_annos_map)
  
      if has_fine_annos:
          dataset.add_sample_field(
              "gt_fine",
              fof.EmbeddedDocumentField,
              embedded_doc_type=fol.Polylines,
          )
  
      if has_coarse_annos:
          dataset.add_sample_field(
              "gt_coarse",
              fof.EmbeddedDocumentField,
              embedded_doc_type=fol.Polylines,
          )
  
      if has_person_annos:
          dataset.add_sample_field(
              "gt_person",
              fof.EmbeddedDocumentField,
              embedded_doc_type=fol.Detections,
          )
  
      uuids = sorted(images_map.keys())
  
      logger.info("Finalizing split '%s'...", split)
      exporter = foud.LegacyFiftyOneDatasetExporter(split_dir)
      pb = fou.ProgressBar()
      with exporter, pb:
          exporter.log_collection(dataset)
          for uuid in pb(uuids):
              sample = fos.Sample(filepath=images_map[uuid])
  
              if has_fine_annos:
                  sample["gt_fine"] = fine_annos_map.get(uuid, None)
  
              if has_coarse_annos:
                  sample["gt_coarse"] = coarse_annos_map.get(uuid, None)
  
              if has_person_annos:
                  sample["gt_person"] = person_annos_map.get(uuid, None)
  
              exporter.export_sample(sample)
  
      dataset.delete()
  
imports: import logging
  import os
  import eta.core.serial
  import eta.core.utils
  import fiftyone.core.dataset
  import fiftyone.core.fields
  import fiftyone.core.labels
  import fiftyone.core.media
  import fiftyone.core.sample
  import fiftyone.core.utils
  import fiftyone.utils.data
  import fiftyone.types
label_desc: Use image node_id 5 for calling a global function with example usage: _export_split(split, split_dir, images_dir, fine_annos_dir, coarse_annos_dir, person_annos_dir) without return types