class_docstr: Callable to generate specified data samples
code: def __init__(
      self,
      dims,
      epoch_size,
      dtype,
      exception_class=StopIteration,
      random_data=False,
      random_shape=False,
  ):
      self.dims = dims
      self.epoch_size = epoch_size
      self.dtype = dtype
      self.exception_class = exception_class
      self.ds = {}
      self.random_data = random_data
      self.random_shape = random_shape
      self.data_iterator = None
      self.iterator_data_samples = []
      if random_data and not random_shape:
          self.data_iterator = iter(
              RandomDataIterator(1, shape=dims, dtype=dtype)
          )
      if random_data and random_shape:
          self.data_iterator = iter(
              RandomlyShapedDataIterator(1, max_shape=dims, dtype=dtype)
          )
      if not random_data and random_shape:
          raise ValueError(
              "If random_shape is required the random_data is required to be True."
          )
  
imports: import numpy
  import nvidia.dali
  from nose.tools import with_setup
  from test_pool_utils import capture_processes, teardown_function, setup_function
  from test_utils import compare_pipelines, check_batch, RandomDataIterator, RandomlyShapedDataIterator
label_desc: Use image node_id 1 to create a new ExtCallback object  with example: obj = ExtCallback(dims, epoch_size, dtype, exception_class, random_data, random_shape)