<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def to_json_payload(self, data_rows):
 """Returns the json payload """

        num_rows = len(data_rows)
        num_page = self.num_page
        num_rows_page = self.num_rows_page

        pages = num_rows / num_rows_page
        pages += divmod(num_rows, num_rows_page)[1] and 1 or 0
        start = (num_page - 1) * num_rows_page
        end = num_page * num_rows_page
        payload = {"page": num_page,
                   "total": pages,
                   "records": num_rows,
                   "rows": data_rows[start:end]}
        return json.dumps(payload)