code: def test_shape(self):
      expected_shape = (128, 128, 128)
      test_image = nib.Nifti1Image(
          np.random.randint(0, 2, size=[128, 128, 128]).astype(float),
          np.eye(4),
      )
      test_data = []
      with tempfile.TemporaryDirectory() as tempdir:
          for i in range(6):
              nib.save(
                  test_image,
                  os.path.join(tempdir, f"test_image{str(i)}.nii.gz"),
              )
              test_data.append(
                  {
                      "image": os.path.join(
                          tempdir, f"test_image{i}.nii.gz"
                      )
                  }
              )
  
          test_transform = Compose(
              [
                  LoadImaged(keys="image"),
                  SimulateDelayd(keys="image", delay_time=1e-7),
              ]
          )
  
          data_iterator = _Stream(test_data)
          with self.assertRaises(TypeError):  # Dataset doesn't work
              dataset = Dataset(
                  data=data_iterator, transform=test_transform
              )
              for _ in dataset:
                  pass
          dataset = IterableDataset(
              data=data_iterator, transform=test_transform
          )
          for d in dataset:
              self.assertTupleEqual(d["image"].shape, expected_shape)
  
          num_workers = 2 if sys.platform == "linux" else 0
          dataloader = DataLoader(
              dataset=dataset, batch_size=3, num_workers=num_workers
          )
          for d in dataloader:
              self.assertTupleEqual(
                  d["image"].shape[1:], expected_shape
              )
  
file_path: MONAI/tests/test_iterable_dataset.py
imports: from __future__ import annotations
  import os
  import sys
  import tempfile
  import unittest
  import nibabel
  import numpy
  from monai.data import DataLoader, Dataset, IterableDataset
  from monai.transforms import Compose, LoadImaged, SimulateDelayd
label_desc: Use image node_id 1 for calling the TestIterableDataset obj's underlying member method code with example usage: obj.test_shape() without return types