code: def test_classification_datasets(basedir, img):
      # Create a classification dataset
      images_dir = os.path.join(basedir, "source-images")
      dataset = _make_classification_dataset(img, images_dir)
  
      # FiftyOneImageClassificationDataset
      export_dir = os.path.join(
          basedir, "fiftyone-image-classification"
      )
      dataset_type = fo.types.FiftyOneImageClassificationDataset
      dataset.export(export_dir=export_dir, dataset_type=dataset_type)
      dataset2 = fo.Dataset.from_dir(
          dataset_dir=export_dir, dataset_type=dataset_type
      )
  
      # ImageClassificationDirectoryTree
      export_dir = os.path.join(
          basedir, "image-classification-dir-tree"
      )
      dataset_type = fo.types.ImageClassificationDirectoryTree
      dataset.export(export_dir=export_dir, dataset_type=dataset_type)
      dataset2 = fo.Dataset.from_dir(
          dataset_dir=export_dir, dataset_type=dataset_type
      )
  
      # TFImageClassificationDataset
      export_dir = os.path.join(basedir, "tf-image-classification")
      dataset_type = fo.types.TFImageClassificationDataset
      tmp_dir = os.path.join(
          basedir, "tf-image-classification-tmp-images"
      )
      dataset.export(
          export_dir=export_dir, dataset_type=dataset_type, num_shards=2
      )
      dataset2 = fo.Dataset.from_dir(
          dataset_dir=export_dir,
          dataset_type=dataset_type,
          images_dir=tmp_dir,
      )
  
      # 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 10 for calling a global function with example usage: test_classification_datasets(basedir, img) without return types