code: def test_mock_data_source():
      with tfds.testing.mock_data(num_examples=10):
          data_source = tfds.data_source("imagenet2012")
          assert len(data_source["train"]) == 10
          assert isinstance(data_source["train"][0], dict)
  
          data_source = tfds.data_source("imagenet2012", split="train")
          assert len(data_source) == 10
          assert isinstance(data_source[0], dict)
  
          data_source = tfds.data_source(
              "imagenet2012", split="train[:50%]"
          )
          assert len(data_source) == 10
          assert isinstance(data_source[0], dict)
          assert isinstance(data_source[0]["image"], np.ndarray)
  
          # Without decoding the images
          decoders = {"image": tfds.decode.SkipDecoding()}
          data_source = tfds.data_source(
              "imagenet2012", split="train[:50%]", decoders=decoders
          )
          assert isinstance(data_source[0]["image"], bytes)
  
imports: import functools
  import pickle
  import numpy
  import pytest
  import tensorflow
  import tensorflow_datasets
label_desc: Use image node_id 19 for calling a global function with example usage: test_mock_data_source() without return types