code: def state(self):
      
      state = 'in progress'
      if self.is_complete:
        if self.failed:
          state = 'failed with error: %s' % str(self._fatal_error)
        elif self._errors:
          state = 'completed with some non-fatal errors'
        else:
          state = 'completed'
      return state
docs: Describe the state of a Job.
  
      Returns: A string describing the job's state.