<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def value(self, new_value):
 """Set the value of this measurement. Raises: AttributeError: if the new value isn't of the correct units. """

        if self.unit != units.Undefined and new_value.unit != self.unit:
            raise AttributeError("%s must be in %s" % (
                self.__class__, self.unit))
        self._value = new_value