code: def test_image_labels_datasets(basedir, img):
      # Create an image labels dataset
      images_dir = os.path.join(basedir, "source-images")
      dataset = _make_image_labels_dataset(img, images_dir)
  
      # FiftyOneImageLabelsDataset
      export_dir = os.path.join(basedir, "fiftyone-image-labels")
      dataset_type = fo.types.FiftyOneImageLabelsDataset
      dataset.export(export_dir=export_dir, dataset_type=dataset_type)
      dataset2 = fo.Dataset.from_dir(
          dataset_dir=export_dir, dataset_type=dataset_type
      )
  
      # BDDDataset
      export_dir = os.path.join(basedir, "bdd")
      dataset_type = fo.types.BDDDataset
      dataset.export(export_dir=export_dir, dataset_type=dataset_type)
      dataset2 = fo.Dataset.from_dir(
          dataset_dir=export_dir, dataset_type=dataset_type
      )
  
      # JSON
      json_path = os.path.join(basedir, "dataset.json")
      dataset.write_json(json_path, pretty_print=True)
      dataset2 = fo.Dataset.from_json(
          json_path, name=fo.get_default_dataset_name()
      )
  
imports: import random
  import os
  import numpy
  import pytest
  import eta.core.utils
  import fiftyone
  import fiftyone.utils.image
  import fiftyone.brain
  import fiftyone.zoo
  from fiftyone import ViewField
label_desc: Use image node_id 12 for calling a global function with example usage: test_image_labels_datasets(basedir, img) without return types