<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def write(self, data):
 """ Intercepted method for writing data. :param data: Data to write :returns: Whatever the original method returns :raises: Whatever the original method raises This method updates the internal digest object with with the new data and then proceeds to call the original write method. """

        # Intercept the write method (that's what @direct does) and both write
        # the data using the original write method (using proxiee(self).write)
        # and update the hash of the data written so far (using
        # proxy.state(self).digest).
        proxy.state(self).digest.update(data)
        return proxy.original(self).write(data)