class_docstr: Callable to generate specified data samples
code: def __call__(self, sample_info):
      if sample_info.idx_in_epoch >= self.epoch_size:
          raise self.exception_class
      if self.data_iterator:
          while (
              len(self.iterator_data_samples)
              <= sample_info.idx_in_epoch
          ):
              batch = self.data_iterator.next()
              self.iterator_data_samples.append(batch[0])
          return self.iterator_data_samples[sample_info.idx_in_epoch]
      if sample_info.idx_in_epoch not in self.ds:
          self.ds[sample_info.idx_in_epoch] = np.full(
              self.dims, sample_info.idx_in_epoch, dtype=self.dtype
          )
      return self.ds[sample_info.idx_in_epoch]
  
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 2 for calling the ExtCallback obj's underlying member method code with example usage: obj.__call__(sample_info) and returns: self, self