code: def _grep_status(self, status_type):
          
          args = "qstat -f {}".format(self.id).split()
          res, _ = call(args)
          exit_status = [line for line in res.split('\n')
                  if 'exit_status' in line]
          try:
              _, __, code = exit_status[0].split()
          except IndexError:
              code = None
  
          if status_type == 'complete' and code == '0':
              return True
          elif status_type == 'error' and code != '0':
              return True
          else:
              return False
docs: Greps through the job's current status to see if
          it returned with the requested status.
          status_type: complete, error