code: def _apply(self, element, key=None):
          
          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
docs: Applies the operation to the element, executing any pre- and
          post-processor hooks if defined.