code: def get_num_batches(self, instances: Iterable[Instance]) -> int:
          
          if is_lazy(instances) and self._instances_per_epoch is None:
              # Unable to compute num batches, so just return 1.
              return 1
          elif self._instances_per_epoch is not None:
              return math.ceil(self._instances_per_epoch / self._batch_size)
          else:
              # Not lazy, so can compute the list length.
              return math.ceil(len(ensure_list(instances)) / self._batch_size)
docs: Returns the number of batches that ``dataset`` will be split into; if you want to track
          progress through the batch with the generator produced by ``__call__``, this could be
          useful.