Hook for pre-processing of requests.
770970
def ProcessRequest(self, method_config, request):
        """"""
        if self.log_request:
            logging.info(
                'Calling method %s with %s: %s', method_config.method_id,
                method_config.request_type_name, request)
        return request
869177
function(options,done) {

    request(options, function (err, response, payload) {
        if (err) {
            console.log('api call error');
            console.log(err);
        }

        done(err, payload, parseRateLimits(response.headers));
    });
}
260546
def handle_request(self, request, *args, **kwargs):
        """"""
        paginator = self.get_paginator()
        # Call search first, it will reset page if search is changed
        search = self.get_search()
        page = self.get_page(paginator)
        items = self.get_items(paginator, page)
        return {
            'search': search,
            'page': page,
            'page_size': self.get_page_size(),
            'num_pages': paginator.num_pages,
            'sort': self.get_sort(),
            'current_fields': self.get_current_fields(),
            'fields': self.get_all_fields(),

            'items': items,
        }
754142
private function preprocess()
    {
        $this->do_action('afw_options_pre_process');
        Notifier::reset();
        State::set('errors', array());
        $this->update();
        $this->do_action('afw_options_post_process');
    }
1103589
def exec_before_request_actions(actions, **kwargs):
    
    groups = ("before", "before_" + flask.request.method.lower())
    return execute_actions(actions, limit_groups=groups, **kwargs)
488323
def before(self, context):
        ""
        run.before_each.execute(context)
        self._invoke(self._before, context)
735103
def request(req=None, method=None, requires_response=True):
    """"""
    if req is None:
        return functools.partial(request, method=method,
                                 requires_response=requires_response)

    @functools.wraps(req)
    def wrapper(self, *args, **kwargs):
        if self.lsp_ready:
            params = req(self, *args, **kwargs)
            if params is not None:
                self.emit_request(method, params, requires_response)
    return wrapper
986094
def _on_request(self, name, args):
        """"""
        if IS_PYTHON3:
            name = decode_if_bytes(name)
        handler = self._request_handlers.get(name, None)
        if not handler:
            msg = self._missing_handler_error(name, 'request')
            error(msg)
            raise ErrorResponse(msg)

        debug('calling request handler for "%s", args: "%s"', name, args)
        rv = handler(*args)
        debug("request handler for '%s %s' returns: %s", name, args, rv)
        return rv
1016826
def process_request(self, request_object):
        """"""
        resources = (request_object.entity_cls.query
                     .filter(**request_object.filters)
                     .offset((request_object.page - 1) * request_object.per_page)
                     .limit(request_object.per_page)
                     .order_by(request_object.order_by)
                     .all())
        return ResponseSuccess(Status.SUCCESS, resources)
706576
def _init_request_hooks(self):
        
        for method_type in ('pre', 'post'):
            for method in _METHODS:
                event = getattr(self.app, 'on_' + method_type + '_' + method)
                event_hook = getattr(hooks, method_type + '_' + method)
                event += event_hook
1204311
def pre(self, inputstring, **kwargs):
        """"""
        out = self.apply_procs(self.preprocs, kwargs, str(inputstring))
        logger.log_tag("skips", self.skips)
        return out
72716
def preload_pages():
    """"""
    try:
        _add_url_rule([page.url for page in Page.query.all()])
    except Exception:  # pragma: no cover
        current_app.logger.warn('Pages were not loaded.')
        raise
1105375
def process_request(self, request):
        
        if self._is_enabled():
            self._cache.set(self.guid_key, six.text_type(uuid4()))
            log_prefix = self._log_prefix(u"Before", request)
            self._cache.set(self.memory_data_key, self._memory_data(log_prefix))
591857
def process_response(self, request, response):
        """"""
        batcher = PrioritizedBatcher.global_instance()
        if batcher.is_started:
            # May not be started due to strange middleware behavior on first request.
            batcher.commit()

        return response
561768
async def pre_handle(self, request: Request, responder: 'Responder'):
        

        responder.send([lyr.Typing()])
        await responder.flush(request)
        responder.clear()

        await self.next(request, responder)
1311869
private boolean preHandle(HttpRequest request, HttpResponse response, RequestHandler handler) throws Exception {
        for (HandlerInterceptor interceptor : mInterceptorList) {
            if (interceptor.onIntercept(request, response, handler)) return true;
        }
        return false;
    }
231742
def pre_send(self, request_params):
        """"""
        for adapter in itervalues(self.adapters):
            adapter.max_retries = request_params.get('max_retries', 0)

        return request_params