docstr: Test that streaming datasets return the correct number of batches, and that
  the length is also calculated correctly.
docstr_tok: ["Test","that","streaming","datasets","return","the","correct","number","of","batches",",","and","that","the","length","is","also","calculated","correctly","."]
code: def test_streaming_dataset(self):
      """
      Test that streaming datasets return the correct number of batches, and that
      the length is also calculated correctly.
      """
      config = get_test_task_config()
      dataset_config = {
          "name": "synthetic_image_streaming",
          "split": "train",
          "crop_size": 224,
          "class_ratio": 0.5,
          "num_samples": 2000,
          "length": 4000,
          "seed": 0,
          "batchsize_per_replica": 32,
          "use_shuffle": True,
      }
      expected_batches = 62
      config["dataset"]["train"] = dataset_config
      task = build_task(config)
      task.prepare()
      task.advance_phase()
      # test that the number of batches expected is correct
      self.assertEqual(task.num_batches_per_phase, expected_batches)
  
      # test that the data iterator returns the expected number of batches
      data_iterator = task.data_iterator
      self._test_number_of_batches(data_iterator, expected_batches)
  
      # test that the dataloader can be rebuilt
      task.build_dataloaders_for_current_phase()
      task.create_data_iterators()
      data_iterator = task.data_iterator
      self._test_number_of_batches(data_iterator, expected_batches)
  
imports: import unittest
  from classy_vision.tasks import build_task
  from test.generic.config_utils import get_test_task_config
label_desc: Use image node_id 2 for calling the TestDataloaderLimitWrapper obj's underlying member method code with example usage: obj.test_streaming_dataset() without return types