code: def result(self):
      
  
      if self.__cancelled:
        raise Job.Cancelled
      elif self.__state in (Job.PENDING, Job.RUNNING):
        raise Job.InvalidState('job is {0}'.format(self.__state))
      elif self.__state == Job.ERROR:
        reraise(*self.__exception)
      elif self.__state == Job.SUCCESS:
        return self.__result
      else:
        raise RuntimeError('invalid job state {0!r}'.format(self.__state))
docs: The result of the jobs execution. Accessing this property while the job is
      pending or running will raise #InvalidState. If an exception occured during
      the jobs execution, it will be raised.
  
      # Raises
      InvalidState: If the job is not in state #FINISHED.
      Cancelled: If the job was cancelled.
      any: If an exception ocurred during the job's execution.