code: def test_nightly_doc_util(self):
      data_dir = "/tmp/dummy_dir"
  
      nightly_dict = {
          "dummy_dataset": {"": {"1.0.0": False}},
          "dummy_new_ds": True,
          "dummy_new_config": {
              "new_config": True,
              "old_config": {
                  "2.0.0": True,  # New versions
                  "1.0.0": False,
              },
          },
      }
      with mock.patch.object(
          doc_utils, "_load_nightly_dict", return_value=nightly_dict
      ):
          ndu = doc_utils.NightlyDocUtil(path="/tmp/some/patched/path")
  
      dummy_dataset = tfds.testing.DummyDataset(data_dir=data_dir)
      dummy_new_ds = DummyNewDs(data_dir=data_dir)
      dummy_new_config = DummyNewConfig(
          data_dir=data_dir, config="new_config"
      )
      dummy_new_version = DummyNewConfig(
          data_dir=data_dir, config="old_config"
      )
  
      # Only `dummy_new_ds` is a new builder
      self.assertFalse(ndu.is_builder_nightly(dummy_dataset))
      self.assertTrue(ndu.is_builder_nightly(dummy_new_ds))
      self.assertFalse(ndu.is_builder_nightly(dummy_new_config))
      self.assertFalse(ndu.is_builder_nightly(dummy_new_version))
  
      # Only `dummy_new_ds/new_config` is a new config
      self.assertFalse(ndu.is_config_nightly(dummy_dataset))
      self.assertFalse(ndu.is_config_nightly(dummy_new_ds))
      self.assertTrue(ndu.is_config_nightly(dummy_new_config))
      self.assertFalse(ndu.is_config_nightly(dummy_new_version))
  
      # Only `dummy_new_ds/new_version/2.0.0` is a new version
      self.assertFalse(ndu.is_version_nightly(dummy_dataset, "1.0.0"))
      self.assertFalse(ndu.is_version_nightly(dummy_new_ds, "x.x.x"))
      self.assertFalse(
          ndu.is_version_nightly(dummy_new_config, "x.x.x")
      )
      self.assertFalse(
          ndu.is_version_nightly(dummy_new_version, "1.0.0")
      )
      self.assertTrue(
          ndu.is_version_nightly(dummy_new_version, "2.0.0")
      )
  
      # Only `dummy_dataset` don't have a nightly version
      self.assertFalse(ndu.has_nightly(dummy_dataset))
      self.assertTrue(ndu.has_nightly(dummy_new_ds))
      self.assertTrue(ndu.has_nightly(dummy_new_config))
      self.assertTrue(ndu.has_nightly(dummy_new_version))
  
file_path: datasets/tensorflow_datasets/scripts/documentation/doc_utils_test.py
imports: from unittest import mock
  import tensorflow_datasets
  from tensorflow_datasets.scripts.documentation import doc_utils
label_desc: Use image node_id 3 for calling the DocumentNightlyDatasetsTest obj's underlying member method code with example usage: obj.test_nightly_doc_util() without return types