code: def process_before_request_hooks(self):
          
  
          hooks = []
  
          if self.resource:
              hooks.extend(self.resource.api.before_all_hooks)
              hooks.extend(self.resource.before_all_hooks)
  
          hooks.extend(self.before_all_hooks)
          hooks.extend(
              getattr(
                  self,
                  'before_{method}_hooks'.format(method=self.meth),
                  []
              )
          )
  
          for hook in chain(hooks):
              hook(self)
docs: Process the list of before_{method}_hooks and the before_all_hooks. The hooks
          will be processed in the following order
  
          1 - any before_all_hooks defined on the :class:`arrested.ArrestedAPI` object
          2 - any before_all_hooks defined on the :class:`arrested.Resource` object
          3 - any before_all_hooks defined on the :class:`arrested.Endpoint` object
          4 - any before_{method}_hooks defined on the :class:`arrested.Endpoint` object