Returns true if request metric collection is applicable to the given
request; false otherwise.
18638
protected final boolean isRequestMetricsEnabled(AmazonWebServiceRequest req) {
        RequestMetricCollector c = req.getRequestMetricCollector(); // request level collector
        if (c != null && c.isEnabled()) {
            return true;
        }
        return isRMCEnabledAtClientOrSdkLevel();
    }
1257335
protected function isMetricValid($metric) {
        if (!isset($metric) || !is_array($metric) 
                || !isset($metric["influx"]) || !isset($metric["influx"]["tags"]) 
                || !isset($metric["mysql"]) || !isset($metric["mysql"]["query"])) {
                    return false;
        }
        return true;
    }
46775
public static function canBeUsedForRequest(Request $request)
    {
        $hasChunkParams = $request->has(static::KEY_CHUNK_NUMBER)
                          && $request->has(static::KEY_TOTAL_SIZE)
                          && $request->has(static::KEY_CHUNK_SIZE)
                          && $request->has(static::KEY_CHUNK_CURRENT_SIZE);

        return $hasChunkParams && self::checkChunkParams($request);
    }
1058852
public static boolean isHttpGetRequest(HttpServletRequest request) {
        boolean isSane = isSaneRequest(request);
        boolean isGet = isSane && request.getMethod().equals(HttpMethod.GET.toString());
        return isSane && isGet;
    }
1065756
def extension_supported(extension_name, request):
    
    for ext in list_extensions(request):
        if ext.name == extension_name:
            return True
    return False
430312
private boolean allMatch(final Request request) throws IOException {
        boolean success = true;
        for (final Pass pass : this.all) {
            if (!pass.enter(request).has()) {
                success = false;
                break;
            }
        }
        return success;
    }
915801
public static boolean isAjaxRequest(HttpServletRequest request) {
        String ajaxHeader = request.getHeader("X-Requested-With");
        return StringUtils.isNotBlank(ajaxHeader) && "XMLHttpRequest".equalsIgnoreCase(ajaxHeader);
    }
1105018
public static function canBeUsedForRequest(Request $request)
    {
        return $request->has(self::CHUNK_UUID_INDEX) && $request->has(self::CHUNK_TOTAL_INDEX) &&
            $request->has(self::CHUNK_INDEX);
    }
564578
public boolean matches(Request req) {
        if (!method.equals(req.getMethod())) return false;
        if (useRegexForPath) {
            if (!req.getPath().getPath().matches(basePath)) return false;
        } else {
            if (!basePath.equals(req.getPath().getPath())) return false;
        }
        if (!queries.keySet().containsAll(req.getQuery().keySet())) return false;
        if (!req.getNames().containsAll(headers.keySet())) return false;

        try {
            if (!isEmpty(bodyMustContain) && !req.getContent().contains(bodyMustContain))
                return false;
        } catch (IOException e) {
            return false;
        }

        for (Map.Entry<String, String> reqQuery : req.getQuery().entrySet()) {
            String respRegex = queries.get(reqQuery.getKey());
            if (!reqQuery.getValue().matches(respRegex)) return false;
        }
        for(Map.Entry<String, String> header : headers.entrySet()) {
            String headerValueRegex = header.getValue();
            if(!req.getValue(header.getKey()).matches(headerValueRegex)) return false;
        }
        return true;
    }
814030
public function isAcceptable(Request $request)
    {
        if ($request->isXmlHttpRequest()) {
            return true;
        }

        $acceptHeader = AcceptHeader::fromString($request->headers->get('Accept'));
        if ($acceptHeader->has('application/json')) {
            return true;
        }

        return false;
    }
819298
def _is_request_in_exclude_path(self, request):
        """"""
        if self._exclude_paths:
            for path in self._exclude_paths:
                if request.path.startswith(path):
                    return True
            return False
        else:
            return False
1128535
@Override
	protected boolean isAllowed(HttpServletRequest request) {
		HttpSession session = getRequest().getSession(false);
		
		if (session == null)
			return false;
		
		String sessionToken = (String) session.getAttribute(SESSION_ATTR_CSRF_TOKEN);
		String requestToken = request.getHeader(CSRF_HEADER);
			
		return Objects.equals(sessionToken, requestToken);
	}
83420
public static function canBeUsedForRequest(Request $request)
    {
        return $request->has(self::CHUNK_NUMBER_INDEX) && $request->has(self::TOTAL_CHUNKS_INDEX) &&
            $request->has(self::CHUNK_UUID_INDEX);
    }
832885
protected static boolean hasMetrics(CommunicationSummaryStatistics css) {
        if (css.getCount() > 0) {
            return true;
        }
        for (ConnectionStatistics cs : css.getOutbound().values()) {
            if (cs.getCount() > 0) {
                return true;
            }
            if (cs.getNode() != null) {
                if (hasMetrics(cs.getNode())) {
                    return true;
                }
            }
        }
        return false;
    }
963425
public static boolean doesParameterExist(final HttpServletRequest request, final String name) {
        val parameter = request.getParameter(name);
        if (StringUtils.isBlank(parameter)) {
            LOGGER.error("Missing request parameter: [{}]", name);
            return false;
        }
        LOGGER.debug("Found provided request parameter [{}]", name);
        return true;
    }
683956
public static function isPagingRequest(Request $request)
    {
        $matches = [];
        $found = preg_match('/page_[A-Za-z0-9_]+=(?!1\b)\d+/', $request->getRequestUri(), $matches);

        return (bool) $found;
    }
1037990
public boolean match(String destination, String metricName) {
        int[] matches = match(destination);
        if (matches == null || matches.length == 0) {
            return false;
        }
        for (int match : matches) {
            String candidateMetricName = proxyRules.get(match).getMetricSystemName();
            if (metricName.equals(candidateMetricName)) {
                return true;
            }
        }
        return false;
    }