parameters: (self, pool, context_i, lead, batch_size, epoch_idx)
docstring: Schedule computing new batch from source callback by the parallel pool.
docstring_summary: Schedule computing new batch from source callback by the parallel pool.
docstring_tokens: Schedule computing new batch from source callback by the parallel pool .
function: 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)
function_tokens: def schedule_batch ( self , pool , context_i , lead , batch_size , epoch_idx ) : 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 )