code: def test_rel_filepaths(basedir, img):
      # Create a classification dataset
      images_dir = os.path.join(basedir, "source-images")
      dataset = _make_classification_dataset(img, images_dir)
  
      # Test `Dataset.to_dict` with and without relative paths
      rel_dir = basedir
      d_abs = dataset.to_dict()
      d_rel = dataset.to_dict(rel_dir=rel_dir)
      for sd_abs, sd_rel in zip(d_abs["samples"], d_rel["samples"]):
          assert sd_abs["filepath"] == os.path.join(
              rel_dir, sd_rel["filepath"]
          )
  
      # Test `Dataset.from_dict` with and without relative paths
      dataset1 = fo.Dataset.from_dict(
          d_abs, name=fo.get_default_dataset_name()
      )
      dataset2 = fo.Dataset.from_dict(
          d_rel, name=fo.get_default_dataset_name(), rel_dir=rel_dir
      )
      for s_abs, s_rel in zip(dataset1, dataset2):
          assert s_abs.filepath == s_rel.filepath
  
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 15 for calling a global function with example usage: test_rel_filepaths(basedir, img) without return types