DEPRECATED - use request_context for most use cases
428484
def watch_context(keys, result, reqid, container, module = 'objectdb'):
    
    try:
        keys = [k for k,r in zip(keys, result) if r is not None]
        yield result
    finally:
        if keys:
            async def clearup():
                try:
                    await send_api(container, module, 'munwatch', {'keys': keys, 'requestid': reqid})
                except QuitException:
                    pass
            container.subroutine(clearup(), False)
300580
private void printInfoContexts(StringBuilder buf, String uri, boolean reduceDisplay, boolean allowCmd, long host, Node.VHostMapping vhost, Node node) {
        if (!reduceDisplay)
            buf.append("<h3>Contexts:</h3>");
        buf.append("<pre>");
        for (Context context : node.getContexts()) {
            if (context.getVhost() == vhost) {
                String status = "REMOVED";
                switch (context.getStatus()) {
                    case ENABLED:
                        status = "ENABLED";
                        break;
                    case DISABLED:
                        status = "DISABLED";
                        break;
                    case STOPPED:
                        status = "STOPPED";
                        break;
                }
                buf.append(context.getPath() + " , Status: " + status + " Request: " + context.getActiveRequests() + " ");
                if (allowCmd) {
                    contextCommandString(buf, uri, context.getStatus(), context.getPath(), vhost.getAliases(), node.getJvmRoute());
                }
                buf.append("\n");
            }
        }
        buf.append("</pre>");
    }
120216
def _resource_context(fn):
    
    return os.path.join(
        os.path.dirname(__file__),
        DES_DIR,
        fn
    )
353
def filtered_context(context):
    """"""

    ctx = Context(context.opt)
    for resource in context.resources():
        if resource.child:
            continue

        if resource.filtered():
            ctx.add(resource)

    return ctx
189304
def request(request_callback=None, **kwargs):
    

    if request_callback is None:
        return lambda fn: request(fn, **kwargs)
    else:
        return Request(request_callback, **kwargs).decorate_module(request_callback)
693859
def _legacy_request(self, method, table, **kwargs):
        

        warnings.warn("`%s` is deprecated and will be removed in a future release. "
                      "Please use `resource()` instead." % inspect.stack()[1][3], DeprecationWarning)

        return LegacyRequest(method,
                             table,
                             request_params=self.request_params,
                             raise_on_empty=self.raise_on_empty,
                             session=self.session,
                             instance=self.instance,
                             base_url=self.base_url,
                             **kwargs)
850155
def get_context(self):
        
        if not self.is_valid():
            raise ValueError("Cannot generate Context when form is invalid.")
        return dict(request=self.request, **self.cleaned_data)
943082
private void fillRequestContext(RequestContext context) {
        IdManager.makeSureMsgId(context);
        context.setNodeStatus(getSimpleStatus());
        context.setMessageType(MessageType.request);
        context.setSourceNodeId(nodeId);//this node id
    }
1239178
@Deprecated
    protected final void requirePOST() throws ServletException {
        StaplerRequest req = Stapler.getCurrentRequest();
        if (req==null)  return; // invoked outside the context of servlet
        String method = req.getMethod();
        if(!method.equalsIgnoreCase("POST"))
            throw new ServletException("Must be POST, Can't be "+method);
    }
1008792
def apply_to_request(context, rack_env:, for_type:)
      req = rails_req?(rack_env) ? rack_env : Rack::Request.new(rack_env)

      context.request = Context::Request.new unless context.request
      request = context.request

      request.socket = Context::Request::Socket.new(req)
      request.http_version = build_http_version rack_env
      request.method = req.request_method
      request.url = Context::Request::Url.new(req)

      request.body = should_capture_body?(for_type) ? get_body(req) : SKIPPED

      headers, env = get_headers_and_env(rack_env)
      request.headers = headers if config.capture_headers?
      request.env = env if config.capture_env?

      context
    end
775885
def get_context_data(self, **kwargs):
        """"""
        context = super().get_context_data(**kwargs)
        context.update({
            'title': self.get_title(),
            'ajax_url': self.get_ajax_url(),
            'download_url': self.get_download_url(),
            'create_url': self.get_create_url(),
        })
        return context
31053
def prepare(self, context):
		
		
		if __debug__:
			log.debug("Preparing request context.", extra=dict(request=id(context)))
		
		# Bridge in WebOb `Request` and `Response` objects.
		# Extensions shouldn't rely on these, using `environ` where possible instead.
		context.request = Request(context.environ)
		context.response = Response(request=context.request)
		
		# Record the initial path representing the point where a front-end web server bridged to us.
		context.environ['web.base'] = context.request.script_name
		
		# Track the remaining (unprocessed) path elements.
		context.request.remainder = context.request.path_info.split('/')
		if context.request.remainder and not context.request.remainder[0]:
			del context.request.remainder[0]
		
		# Track the "breadcrumb list" of dispatch through distinct controllers.
		context.path = Bread()
977278
function setContext(req, res, next) {
    currentContext = {req: req, res: res};
    next();
}
559898
@Deprecated
    protected void doPatch(ServiceRequestContext ctx, HttpRequest req, HttpResponseWriter res)
            throws Exception {
        res.respond(HttpStatus.METHOD_NOT_ALLOWED);
    }
1016362
def api_request(request, *args, **kwargs):
    
    plugin = pm.api_plugin_for_request(request)
    if plugin and plugin.request_class:
        req = plugin.request_class(*args, **kwargs)
    else:
        raise Exception("Invalid request type")
    return req
1216185
function getRawRequest(context, excludedPreLoaders) {
    excludedPreLoaders = excludedPreLoaders || /eslint-loader/;
    return loaderUtils.getRemainingRequest({
        resource: context.resource,
        loaderIndex: context.loaderIndex,
        loaders: context.loaders.filter(loader => !excludedPreLoaders.test(loader.path))
    });
}
584309
@Deprecated
    protected <R> BaseRequest<R> prepareRequest(BaseRequest<R> request, String orgToken, String requesterEmail, String product, String productVersion, String userKey,
                                                boolean aggregateModules, boolean preserveModuleStructure, String aggregateProjectName,
                                                String aggregateProjectToken, String logData, String scanComment, String productToken, Map<String, String> extraProperties) {
        request.setOrgToken(orgToken);
        request.setProduct(product);
        request.setProductVersion(productVersion);
        request.setRequesterEmail(requesterEmail);
        request.setUserKey(userKey);
        request.setAggregateModules(aggregateModules);
        request.setPreserveModuleStructure(preserveModuleStructure);
        request.setAggregateProjectName(aggregateProjectName);
        request.setAggregateProjectToken(aggregateProjectToken);
        request.setScanComment(scanComment);
        request.setLogData(logData);
        request.setProductToken(productToken);
        request.setExtraProperties(extraProperties);
        return prepareRequest(request);
    }