code: def test_list_dataset_variants_without_configs(
      mock_fs: testing.MockFs,
  ):
      data_dir = epath.Path("/a")
      dataset_dir = data_dir / "my_ds"
      # Version 1.0.0 doesn't have features.json, because it was generated with an
      # old version of TFDS.
      mock_fs.add_file(dataset_dir / "1.0.0" / "dataset_info.json")
      mock_fs.add_file(dataset_dir / "1.0.1" / "dataset_info.json")
      mock_fs.add_file(dataset_dir / "1.0.1" / "features.json")
  
      # List dirs including datasets generated by old TFDS versions.
      references = sorted(
          file_utils.list_dataset_variants(
              dataset_dir=dataset_dir,
              include_versions=True,
              include_old_tfds_version=True,
          )
      )
      assert references == [
          naming.DatasetReference(
              dataset_name="my_ds", version="1.0.0", data_dir=data_dir
          ),
          naming.DatasetReference(
              dataset_name="my_ds", version="1.0.1", data_dir=data_dir
          ),
      ]
  
      # List dirs excluding datasets generated by old TFDS versions.
      references = sorted(
          file_utils.list_dataset_variants(
              dataset_dir=dataset_dir,
              include_versions=True,
              include_old_tfds_version=False,
          )
      )
      assert references == [
          naming.DatasetReference(
              dataset_name="my_ds", version="1.0.1", data_dir=data_dir
          )
      ]
  
file_path: datasets/tensorflow_datasets/core/utils/file_utils_test.py
imports: import os
  import time
  from unittest import mock
  from absl.testing import flagsaver
  from etils import epath
  import pytest
  from tensorflow_datasets import testing
  from tensorflow_datasets.core import naming
  from tensorflow_datasets.core.utils import file_utils
  from tensorflow_datasets.core.utils import read_config
label_desc: Use image node_id 4 for calling a global function with example usage: test_list_dataset_variants_without_configs(mock_fs) without return types