<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _callback(self, mres):
 """ This is invoked as the row callback. If 'rows' is true, then we are a row callback, otherwise the request has ended and it's time to collect the other data """

        try:
            rows = self._process_payload(self.raw.rows)
            if rows:
                self.on_rows(rows)
            if self.raw.done:
                self.on_done()
        finally:
            if self.raw.done:
                self._clear()