code: def write(self, data):
          
          # 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)
docs: 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.