code: def _make_classification_dataset(img, images_dir, num_samples=4):
      exts = [".jpg", ".png"]
  
      samples = []
      for idx in range(num_samples):
          filepath = os.path.join(
              images_dir, "%06d%s" % (idx, exts[idx % len(exts)])
          )
          foui.write(img, filepath)
  
          label = random.choice(["sun", "rain", "snow"])
          samples.append(
              fo.Sample(
                  filepath=filepath,
                  ground_truth=fo.Classification(label=label),
              )
          )
  
      dataset = fo.Dataset()
      dataset.add_samples(samples)
      return dataset
  
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 4 for calling a global function with example usage: _make_classification_dataset(img, images_dir, num_samples) and returns: dataset