def _grep_qstat(self, status_type='complete'):
        """ Greps qstat -e <job_id> for information from the queue.
        :paramsstatus_type: complete, queued, running, error, gone
        """
        args = "qstat -e {}".format(self.id).split()
        res, _ = call(args)
        if res == '': return False
        res = res.split('\n')[2].split()[4]

        if status_type == 'complete' and res == 'C':
            return True
        elif status_type == 'error' and (res == 'E' or res == 'C'):
            return True
        elif status_type == 'running' and res == 'R':
            return True
        elif status_type == 'queued' and res == 'Q':
            return True
        elif status_type == 'gone' and 'unknown job id' in str(res).lower():
            return True
        else:
            return False
def _grep_qstat ( self , status_type = 'complete' ) : args = "qstat -e {}" . format ( self . id ) . split ( ) res , _ = call ( args ) if res == '' : return False res = res . split ( '\n' ) [ 2 ] . split ( ) [ 4 ] if status_type == 'complete' and res == 'C' : return True elif status_type == 'error' and ( res == 'E' or res == 'C' ) : return True elif status_type == 'running' and res == 'R' : return True elif status_type == 'queued' and res == 'Q' : return True elif status_type == 'gone' and 'unknown job id' in str ( res ) . lower ( ) : return True else : return False
Greps qstat -e <job_id> for information from the queue.
        :paramsstatus_type: complete, queued, running, error, gone