Applies the operation to the element, executing any pre- and
        post-processor hooks if defined.

def _apply(self, element, key=None):
        """
        Applies the operation to the element, executing any pre- and
        post-processor hooks if defined.
        """
        kwargs = {}
        for hook in self._preprocess_hooks:
            kwargs.update(hook(self, element))
        ret = self._process(element, key)
        for hook in self._postprocess_hooks:
            ret = hook(self, ret, **kwargs)
        return ret