code: def test_data_source_is_iterable():
      dataset_info = create_dataset_info()
      mock_data_source = mock.create_autospec(
          array_record_data_source.ArrayRecordDataSource,
          spec_set=True,
      )
      mock_data_source.__getitem__.return_value = [1, 2, 3]
      mock_data_source.__len__.return_value = 3
      with mock.patch.object(
          array_record_data_source,
          "ArrayRecordDataSource",
          return_value=mock_data_source,
      ), mock.patch.object(
          dataset_info.features,
          "deserialize_example_np",
          return_value="deserialized example",
      ) as deserialize_example_mock:
          data_source = array_record.ArrayRecordDataSource(
              dataset_info, split="train"
          )
          assert len(data_source) == 3
          for _ in data_source:
              continue
          assert mock_data_source.__getitem__.call_count == 3
          assert deserialize_example_mock.call_count == 3
          assert (
              mock_data_source.__getitem__.call_args_list[0].args[0]
              == 0
          )
          assert (
              mock_data_source.__getitem__.call_args_list[1].args[0]
              == 1
          )
          assert (
              mock_data_source.__getitem__.call_args_list[2].args[0]
              == 2
          )
  
file_path: datasets/tensorflow_datasets/core/data_sources/array_record_test.py
imports: from unittest import mock
  import pytest
  import tensorflow_datasets
  from tensorflow_datasets.core import dataset_info
  from tensorflow_datasets.core import decode
  from tensorflow_datasets.core import file_adapters
  from tensorflow_datasets.core import splits
  from tensorflow_datasets.core.data_sources import array_record
  from tensorflow_datasets.core.utils import shard_utils
  from tensorflow_datasets.core.utils.lazy_imports_utils import array_record_data_source
label_desc: Use image node_id 8 for calling a global function with example usage: test_data_source_is_iterable() without return types