<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def check_job(self, job_id):
 """Return the state and number of results of a query by job id. Parameters job_id : str The job id of the query to check. Returns ------- tuple (``bool``, ``int``) Whether or not the query has completed and the total number of rows included in the query table if it has completed (else 0) """


        query_reply = self.get_query_results(job_id, offset=0, limit=0)

        return (query_reply.get('jobComplete', False),
                int(query_reply.get('totalRows', 0)))