docstr: Schedule computing new batch from source callback by the parallel pool.
docstr_tok: ["Schedule","computing","new","batch","from","source","callback","by","the","parallel","pool","."]
code: def schedule_batch(
      self, pool, context_i, lead, batch_size, epoch_idx
  ):
      """Schedule computing new batch from source callback by the parallel pool."""
      if self.batch:
          return pool.schedule_batch(
              context_i,
              _TaskArgs.make_batch(
                  self.callback_args(None, epoch_idx, lead=lead)
              ),
          )
      else:
          sample_range_start = self.current_sample + batch_size * lead
          sample_range_end = sample_range_start + batch_size
          iteration = self.current_iter + lead
          sample_range = _SampleRange(
              sample_range_start, sample_range_end, iteration, epoch_idx
          )
          work_batch = _TaskArgs.make_sample(sample_range)
          return pool.schedule_batch(context_i, work_batch)
  
imports: from nvidia.dali import backend
  from nvidia.dali import tensors
  from nvidia.dali import types
  from nvidia.dali._multiproc.messages import TaskArgs, SampleRange
  import nvidia.dali.types
  from nvidia.dali._utils.external_source_impl import get_callback_from_source, accepted_arg_count, SourceKind
label_desc: Use image node_id 7 for calling the _ExternalSourceGroup obj's underlying member method code with example usage: obj.schedule_batch(pool, context_i, lead, batch_size, epoch_idx) and returns: pool, pool