code: def test_registered_logger_is_called(
      dummy_dataset: dataset_builder.DatasetBuilder,
  ):
      logger = mock.MagicMock()
      tfds_logging.register(logger)
  
      read_config = read_config_lib.ReadConfig(add_tfds_id=True)
      read_config.try_autocache = False
      read_config.num_parallel_calls_for_decode = 42
      ds = dummy_dataset.as_dataset(
          split="train",
          read_config=read_config,
          as_supervised=True,
      )
      # Logging doesn't change the result:
      assert ds.element_spec == (
          tf.TensorSpec(shape=(), dtype=tf.int64),
          tf.TensorSpec(shape=(), dtype=tf.int64),
      )
      # Logger was indeed called:
      assert logger.as_dataset.call_args_list == [
          mock.call(
              metadata=mock.ANY,
              name="dummy_dataset",
              config_name="",
              version="1.0.0",
              data_path=mock.ANY,
              split="train",
              batch_size=None,
              shuffle_files=None,
              read_config=read_config,
              as_supervised=True,
              decoders=None,
          )
      ]
  
file_path: datasets/tensorflow_datasets/core/dataset_builder_read_test.py
imports: from unittest import mock
  import pytest
  import tensorflow
  from tensorflow_datasets import testing
  from tensorflow_datasets.core import dataset_builder
  from tensorflow_datasets.core import dataset_utils
  from tensorflow_datasets.core import logging
  from tensorflow_datasets.core import utils
  from tensorflow_datasets.core.utils import read_config
label_desc: Use image node_id 3 for calling a global function with example usage: test_registered_logger_is_called(dummy_dataset) without return types