class_docstr: Tests member functions of ClassyDataset. Note, NotImplemented
  functions are mocked in TestDataset class.
class_docstr_tok: ["Tests","member","functions","of","ClassyDataset",".","Note",",","NotImplemented","functions","are","mocked","in","TestDataset","class","."]
code: def test_get_iterator(self):
      # Verifies that we can retrieve samples with iterators
      dl = self.dataset1.iterator(num_workers=0)
      assert isinstance(
          dl, DataLoader
      ), "Classy Iterator should return instance of PyTorch Dataloader"
      next(iter(dl))
  
      # We should be able to set num_workers to zero while also passing a mp context
      dl = self.dataset1.iterator(
          num_workers=0, multiprocessing_context=mp.get_context()
      )
      assert isinstance(
          dl, DataLoader
      ), "Classy Iterator should return instance of PyTorch Dataloader"
      next(iter(dl))
  
      dl = self.dataset1.iterator(num_workers=2)
      assert isinstance(
          dl, DataLoader
      ), "Classy Iterator should return instance of PyTorch Dataloader"
      it = iter(dl)
      next(it)
      # Because we use multiprocessing we delete the iterable to
      # shutdown workers
      del it
  
imports: import multiprocessing
  import unittest
  import unittest.mock
  import classy_vision.dataset.classy_dataset
  import torch
  from classy_vision.dataset import build_dataset, register_dataset
  from classy_vision.dataset.core import ListDataset
  from test.generic.utils import compare_batches, compare_samples
  from torch.utils.data import DataLoader
label_desc: Use image node_id 7 for calling the TestClassyDataset obj's underlying member method code with example usage: obj.test_get_iterator() without return types