parameters: (self, result)
docstring: Mark the future done and set its result.
  
          If the future is already done when this method is called, raises
          InvalidStateError.
docstring_summary: Mark the future done and set its result.
docstring_tokens: Mark the future done and set its result .
function: def set_result(self, result):
          """Mark the future done and set its result.
  
          If the future is already done when this method is called, raises
          InvalidStateError.
          """
          if self._state != _PENDING:
              raise InvalidStateError('{}: {!r}'.format(self._state, self))
          self._result = result
          self._state = _FINISHED
          self.__schedule_callbacks()
function_tokens: def set_result ( self , result ) : if self . _state != _PENDING : raise InvalidStateError ( '{}: {!r}' . format ( self . _state , self ) ) self . _result = result self . _state = _FINISHED self . __schedule_callbacks ( )