<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def getpad(self):
 """Get pad value of DataBatch."""

        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