<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get(self, timeout=None):
 """Get the value of the promise, waiting if necessary."""

        self.wait(timeout)
        if self._state==self.FULFILLED:
            return self.value
        else:
            raise ValueError("Calculation didn't yield a value")