code: def test_mock_non_registered_datasets(
      dummy_dataset: tfds.testing.DummyDataset,
      ds_name: str,
  ):
      # Without mocking, the dataset cannot be found
      with pytest.raises(tfds.core.registered.DatasetNotFoundError):
          # Do not test 'huggingface:dummy_dataset' to not have tests
          # access non-hermetic resources.
          tfds.builder("dummy_dataset")
  
      data_dir = dummy_dataset._data_dir_root
      # After mocking, the dataset is restored from the metadata files.
      with tfds.testing.mock_data(data_dir=data_dir, num_examples=15):
          builder = tfds.builder(ds_name)
          ds = builder.as_dataset(split="train")
          assert len(list(ds)) == 15
  
imports: import functools
  import pickle
  import numpy
  import pytest
  import tensorflow
  import tensorflow_datasets
label_desc: Use image node_id 15 for calling a global function with example usage: test_mock_non_registered_datasets(dummy_dataset, ds_name) without return types