<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def set_result(self, result):
 """Set the result of the future to the provided result. Args: result (Any):
 The result """

        # Sanity check: A future can only complete once.
        if self.done():
            raise RuntimeError("set_result can only be called once.")

        # Set the result and trigger the future.
        self._result = result
        self._trigger()