Provides a hook whereby an alternate source can be provided for grabbing the requestId
421430
protected UUID getRequestIdFrom(Request request, Response response) {
        return optUuid(response.getHeader(OTHeaders.REQUEST_ID));
    }
1036775
def _request_get_helper(self, url, params=None):
        ''''''
        if not isinstance(params, dict):
            params = dict()

        if self.api_key:
            params['api_key'] = self.api_key
        return requests.get(url, params=params, timeout=60)
887799
def request_fetch(self, user, repo, request, pull=False, force=False): #pragma: no cover
        '''
        '''
        raise NotImplementedError
1216725
function setRequestId(id, cb) {
  var ns = getLoggerNamespace();
  ns.run(function() {
    ns.set('requestId', id);
    cb();
  });
}
1050769
def request(self, id, **kwargs):
        
        data = self.get('requests', id, **kwargs)
        return data
866212
def request_args(self):
        """"""
        args = flask.request.args
        data_raw = {}

        for field_name, field in self.args_schema.fields.items():
            alternate_field_name = field.load_from if MA2 else field.data_key

            if alternate_field_name and alternate_field_name in args:
                field_name = alternate_field_name
            elif field_name not in args:
                # getlist will return an empty list instead of raising a
                # KeyError for args that aren't present.
                continue

            value = args.getlist(field_name)
            if not self.is_list_field(field) and len(value) == 1:
                value = value[0]

            data_raw[field_name] = value

        return self.deserialize_args(data_raw)
216623
function get(req, res, next) {

  //Admin Fields And Data Sources Should Not Be Shown For App Requests
  var showAdminAndDataSources = !req.params.projectid;

  var getParams = {
    "_id": req.params.id,
    "showAdminFields": showAdminAndDataSources,
    includeDataSources: showAdminAndDataSources,
    //Data Source Caches are required for app requests
    expectDataSourceCache: !showAdminAndDataSources
  };

  logger.debug("Middleware: Get form: ", {getParams: getParams});

  forms.getForm(_.extend(req.connectionOptions, getParams), formsResultHandlers(constants.resultTypes.forms, req, next));
}
651398
private void handleRequest(long requestId, Object request, HandlerHolder handler) {
    @SuppressWarnings("unchecked")
    CompletableFuture<Object> responseFuture = handler.handler.apply(request);
    if (responseFuture != null) {
      responseFuture.whenComplete((response, error) -> {
        ThreadContext context = ThreadContext.currentContext();
        if (context == null) {
          this.context.executor().execute(() -> {
            if (error == null) {
              handleRequestSuccess(requestId, response, this.context);
            } else {
              handleRequestFailure(requestId, error, this.context);
            }
          });
        } else {
          if (error == null) {
            handleRequestSuccess(requestId, response, context);
          } else {
            handleRequestFailure(requestId, error, context);
          }
        }
      });
    }
  }
1322675
def hook(self, id_num):
        
        json = None
        if int(id_num) > 0:
            url = self._build_url('hooks', str(id_num), base_url=self._api)
            json = self._json(self._get(url), 200)
        return Hook(json, self) if json else None
1198280
function requestHandler(req, res, next) {
  const start = Date.now();
  let source;

  return Promise.try(() => {
    source = core.getPublicSource(req.params.src);
    return source.getHandler().getInfoAsync().then(info => [info, infoHeaders]);
  }).spread((data, dataHeaders) => {
    core.setResponseHeaders(res, source, dataHeaders);

    if (req.query && req.query.format) {
      const escapedText = JSON.stringify(data, null, ' ').replace(/&/g, '&amp;').replace(/</g, '&lt;');
      res.send(`<pre>${escapedText}</pre>`);
    } else {
      res.json(data);
    }

    const mx = util.format('req.%s.info', req.params.src);
    core.metrics.endTiming(mx, start);
  }).catch(err => core.reportRequestError(err, res)).catch(next);
}
363180
def fetch(cls, id, incident=None, endpoint=None, *args, **kwargs):
        """"""
        if incident is None and endpoint is None:
            raise InvalidArguments(incident, endpoint)

        if endpoint is None:
            iid = incident['id'] if isinstance(incident, Entity) else incident
            endpoint = 'incidents/{0}/alerts'.format(iid)

        return getattr(Entity, 'fetch').__func__(cls, id, endpoint=endpoint,
                                                 *args, **kwargs)
1090591
def request(self, source="candidate"):
        """"""
        node = new_ele("validate")
        if type(source) is str:
            src = util.datastore_or_url("source", source, self._assert)
        else:
            validated_element(source, ("config", qualify("config")))
            src = new_ele("source")
            src.append(source)
        node.append(src)
        return self._request(node)
548039
def _get_request(self, request_url, request_method, **params):
        
        if request_method == 'GET':
            if params:
                request_url += '&%s' % urlencode(params)
            request = Request(request_url)
        elif request_method == 'POST':
            request = Request(request_url, urlencode(params, doseq=1))
        return request
497014
private void addDatasourceIfNeeded(ServletRequest req)
            throws JspException
    {
        if (_match == null)
            return;

        for (int i = 0; i < _match.length; i++) {
            if (!_optionList.contains(_match[i])) {
                if (!_match[i].equals(NULL_VALUE))
                    addOption(req, _match[i], _match[i]);
            }
        }
    }
130236
def get_request_meta(request, key):
    
    value = request.META.get(key, request.META.get(key.replace('_', '-'), '')).strip()
    if value == '':
        return None
    return value
1061732
private void loadAuthenticationMethodTypes(ExtensionHook hook) {
		this.authenticationMethodTypes = new ArrayList<>();
		this.authenticationMethodTypes.add(new FormBasedAuthenticationMethodType());
		this.authenticationMethodTypes.add(new HttpAuthenticationMethodType());
		this.authenticationMethodTypes.add(new ManualAuthenticationMethodType());
		this.authenticationMethodTypes.add(new ScriptBasedAuthenticationMethodType());
		this.authenticationMethodTypes.add(new JsonBasedAuthenticationMethodType());

		for (AuthenticationMethodType a : authenticationMethodTypes) {
			a.hook(hook);
		}

		if (log.isInfoEnabled()) {
			log.info("Loaded authentication method types: " + authenticationMethodTypes);
		}
	}
799059
def source_get(method_name):
    

    def source_get(_value, context, **_params):
        method = getattr(context["model"].source, method_name)
        return _get(method, context["key"], (), {})

    return source_get