def handle_hooks(self, hooks, hook_type, *args):
        if hook_type not in ['before', 'on_route']:
            hooks = reversed(hooks)

        for hook in hooks:
            result = getattr(hook, hook_type)(*args)
            # on_error hooks can choose to return a Response, which will
            # be used instead of the standard error pages.
            if hook_type == 'on_error' and isinstance(result, WebObResponse):
                return result
Processes hooks of the specified type.
dataset/ETHPy150Open pecan/pecan/pecan/core.py/PecanBase.handle_hooks