<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def reset(self, newval):
        '''
        Resets the atom's value to `newval`, returning `newval`.

        :param newval: The new value to set.
        '''
        oldval = self._state.get()
        self._state.set(newval)
        self.notify_watches(oldval, newval)
        return newval