code: def getpad(self):
          
          if self.last_batch_handle == 'pad' and \
             self.cursor + self.batch_size > self.num_data:
              return self.cursor + self.batch_size - self.num_data
          # check the first batch
          elif self.last_batch_handle == 'roll_over' and \
              -self.batch_size < self.cursor < 0:
              return -self.cursor
          else:
              return 0
docs: Get pad value of DataBatch.