Helper method checking if a ETag value list includes the current ETag.
973001
def etag_matches?(list, new_resource = request.post?)
      return !new_resource if list == '*'
      list.to_s.split(/\s*,\s*/).include? response['ETag']
    end
1071073
def has_reg(value):
    """"""
    try:
        SCons.Util.RegOpenKeyEx(SCons.Util.HKEY_LOCAL_MACHINE, value)
        ret = True
    except SCons.Util.WinError:
        ret = False
    return ret
159019
public static boolean isNotModified(Context context, long lastModified, String etag) {
        // First check etag. Important, if there is an If-None-Match header, we MUST not check the
        // If-Modified-Since header, regardless of whether If-None-Match matches or not. This is in
        // accordance with section 14.26 of RFC2616.

        final String browserEtag = context.header(HeaderNames.IF_NONE_MATCH);
        if (browserEtag != null) {
            // We check the given etag against the given one.
            // If the given one is null, that means that etags are disabled.
            return browserEtag.equals(etag);
        }

        // IF_NONE_MATCH not set, check IF_MODIFIED_SINCE
        final String ifModifiedSince = context.header(HeaderNames.IF_MODIFIED_SINCE);
        if (ifModifiedSince != null && lastModified > 0 && !ifModifiedSince.isEmpty()) {
            try {
                // We do a double check here because the time granularity is important here.
                // If the written date headers are still the same, we are unchanged (the granularity is the
                // second).
                return ifModifiedSince.equals(DateUtil.formatForHttpHeader(lastModified));
            } catch (IllegalArgumentException ex) {
                LoggerFactory.getLogger(CacheUtils.class)
                        .error("Cannot build the date string for {}", lastModified, ex);
                return true;
            }
        }
        return false;
    }
1102393
def is_filtered(self, relpath):
        """"""
        # Only include files under the parent_dir
        if relpath.startswith("../"):
            return True

        # Ignore files that we don't want timestamps from
        if self.timestamps_for is not None and type(self.timestamps_for) is list:
            match = False
            for line in self.timestamps_for:
                if fnmatch.fnmatch(relpath, line):
                    match = True
                    break
            if not match:
                return True

        # Matched is true by default if
        # * Have exclude
        # * No exclude and no include
        matched = self.exclude or not any([self.exclude, self.include])

        # Anything not matching exclude gets included
        if self.exclude:
            for line in self.exclude:
                if fnmatch.fnmatch(relpath, line):
                    matched = False

        # Anything matching include gets included
        if self.include:
            for line in self.include:
                if fnmatch.fnmatch(relpath, line):
                    matched = True
                    break

        return not matched
306326
def keys_are_valid(self, tag_value):
        """"""
        for key in ScheduleParser.raw_data(tag_value):
            if key not in ('on', 'off', 'tz'):
                return False
        return True
538894
def check(self, spec, data):
        '''
        '''
        path_eval = self.path_eval
        for keypath, specvalue in spec.items():
            if keypath.startswith('$'):
                optext = keypath
                checkable = data
                args = (optext, specvalue, checkable)
                generator = self.dispatch_operator(*args)
            else:
                try:
                    checkable = path_eval(data, keypath)
                except self.InvalidPath:
                    # The spec referenced an item or attribute that
                    # doesn't exist. Fail!
                    return False
                generator = self.dispatch_literal(specvalue, checkable)
            for result in generator:
                if not result:
                    return False
        return True
762426
def contains(self, key, value):
        
        self._add_condition(key, '$regex', self._quote(value))
        return self
554528
public static void checkIfMatch(final String ifMatch, final EntityTag etag) {
        if (ifMatch == null) {
            return;
        }
        final Set<String> items = stream(ifMatch.split(",")).map(String::trim).collect(toSet());
        if (items.contains("*")) {
            return;
        }
        try {
            if (etag.isWeak() || items.stream().map(EntityTag::valueOf).noneMatch(isEqual(etag))) {
                    throw new ClientErrorException(status(PRECONDITION_FAILED).build());
            }
        } catch (final IllegalArgumentException ex) {
            throw new BadRequestException(ex);
        }
    }
172852
public static boolean handleIfMatch(final String ifMatch, final ETag etag, boolean allowWeak) {
        return handleIfMatch(ifMatch, Collections.singletonList(etag), allowWeak);
    }
1116305
public boolean containsValue (int value) {
		K[] keyTable = this.keyTable;
		int[] valueTable = this.valueTable;
		for (int i = capacity + stashSize; i-- > 0;)
			if (keyTable[i] != null && valueTable[i] == value) return true;
		return false;
	}
976375
def check_cache(self, e_tag, match):
        """"""
        if e_tag != match:
            return False
        self.send_response(304)
        self.send_header("ETag", e_tag)
        self.send_header("Cache-Control",
                         "max-age={0}".format(self.server.max_age))
        self.end_headers()
        thread_local.size = 0
        return True
48529
def if_match(self):
        """"""
        match = True
        if_match = self.request.META.get('HTTP_IF_MATCH')
        if if_match:
            etag = self.etag()
            if etag != if_match:
                match = False
        return match
1169555
protected function needsCompile($out, &$etag)
    {
        if (! is_file($out)) {
            return true;
        }

        $mtime = filemtime($out);

        $metadataName = $this->metadataName($out);

        if (is_readable($metadataName)) {
            $metadata = unserialize(file_get_contents($metadataName));

            foreach ($metadata['imports'] as $import => $originalMtime) {
                $currentMtime = filemtime($import);

                if ($currentMtime !== $originalMtime || $currentMtime > $mtime) {
                    return true;
                }
            }

            $metaVars = crc32(serialize($this->scss->getVariables()));

            if ($metaVars !== $metadata['vars']) {
                return true;
            }

            $etag = $metadata['etag'];

            return false;
        }

        return true;
    }
829422
def _check_if_all_updated(self):
        """"""
        for g in self.toc.toc:
            if g not in self.values:
                return False
            for n in self.toc.toc[g]:
                if n not in self.values[g]:
                    return False

        return True
496996
public static boolean handleIfNoneMatch(final String ifNoneMatch, final List<ETag> etags, boolean allowWeak) {
        if (ifNoneMatch == null) {
            return true;
        }
        List<ETag> parts = parseETagList(ifNoneMatch);
        for (ETag part : parts) {
            if (part.getTag().equals("*")) {
                return false;
            }
            if (part.isWeak() && !allowWeak) {
                continue;
            }
            for (ETag tag : etags) {
                if (tag != null) {
                    if (tag.isWeak() && !allowWeak) {
                        continue;
                    }
                    if (tag.getTag().equals(part.getTag())) {
                        return false;
                    }
                }
            }
        }
        return true;
    }
307762
public boolean containsValue(Object val) {
        synchronized( this ) {
            for( V item : values() ) {
                if( item instanceof CachedItem ){
                    CachedItem ci = (CachedItem)item;

                    if( ci.isValidForCache() && ci.equals(val) ) {
                        return true;
                    }
                }
                else if( item.equals(val) ) {
                    return true;
                }
            }
        }
        return false;
    }
421520
def etag(self, href):
        
        if self and self._etag is None:
            self._etag = LoadElement(href, only_etag=True)
        return self._etag