Return True if filter matches item.
178318
def match(self, item):
        
        result = self._value == getattr(item, self._name)
        #log.debug("%r for %r = %r, name %r, item %r" % (
        #    result, getattr(item, self._name), self._value, self._name, item))
        return result
1068067
def _match(self, p, value):
        
        if self._is_operator(p):
            return self._match_operator(p, value)
        else:
            try:
                if self._is_value_filter(p):
                    return self._match_value_filter(p, value)
                else:
                    return self._match_key_filter(p, value)
            except KeyError:
                if self._suppress_key_errors or self._suppress_exceptions:
                    return False
                else:
                    raise
            except TypeError:
                if self._suppress_exceptions:
                    return False
                else:
                    raise
253058
function containsSingleMatch(str, arr) {
  var filtered = arr.filter(function(e) { return e.indexOf(str) === 0 })
  return filtered.length === 1
}
132313
def ismatch(text, pattern):
    """"""

    if hasattr(pattern, 'search'):
        return pattern.search(text) is not None
    else:
        return pattern in text if Config.options.case_sensitive \
            else pattern.lower() in text.lower()
915491
def filter_that(self, criteria, data):
        '''
            
        '''
        import re
        prog = re.compile(criteria)

        return True if prog.match(data) else False
193508
public static boolean matches(Pattern patternMatcher, Collection<Filter> filters, Extension extension)
    {
        if (matches(patternMatcher, extension.getId().getId(), extension.getDescription(), extension.getSummary(),
            extension.getName(), ExtensionIdConverter.toStringList(extension.getExtensionFeatures()))) {
            for (Filter filter : filters) {
                if (!matches(filter, extension)) {
                    return false;
                }
            }

            return true;
        }

        return false;
    }
789249
def pattern_filter(items, whitelist=None, blacklist=None, key=None):
    
    key = key or __return_self
    if whitelist:
        whitelisted = _filter(items, whitelist, key)

        if blacklist:
            blacklisted = _filter(items, blacklist, key)
            # Remove any blacklisted items from the whitelisted ones.
            whitelisted.difference_update(blacklisted)

        return [item for item in items if key(item) in whitelisted]

    elif blacklist:
        blacklisted = _filter(items, blacklist, key)
        return [item for item in items if key(item) not in blacklisted]

    else:
        return items
256276
def is_uri_to_be_filtered(uri, filter_list):
    """"""
    match = False
    if filter_list:
        for uri_filter in filter_list:
            if re.search(uri_filter, uri, flags=re.IGNORECASE):
                match = True
        return match
781291
def matches(filter, message, valid_paths, rule_cache, config):
    

    if not filter['rules']:
        return False

    for rule in filter['rules']:
        fn = rule['fn']
        negated = rule['negated']
        arguments = rule['arguments']
        rule_cache_key = rule['cache_key']

        try:
            if rule_cache_key not in rule_cache:
                value = fn(config, message, **arguments)
                if negated:
                    value = not value
                rule_cache[rule_cache_key] =  value

            if not rule_cache[rule_cache_key]:
                return False
        except Exception as e:
            log.exception(e)
            # If something throws an exception then we do *not* have a match.
            return False

    # Then all rules matched on this filter..
    return True
1245712
public static boolean matches(Collection<Filter> filters, Extension extension)
    {
        if (filters != null) {
            for (Filter filter : filters) {
                if (!matches(filter, extension)) {
                    return false;
                }
            }
        }

        return true;
    }
1322754
public boolean matchesFilter(String filter) {

        filter = filter.toLowerCase();
        return m_title.toLowerCase().contains(filter) || m_path.toLowerCase().contains(filter);
    }
875794
def matching_attributes?(attribute, filter)
      attribute.to_s.downcase == filter.to_s.delete('_').downcase
    end
803911
def simple_filter(self, key, value):
        ""
        searched = {key: value}
        return set([k for k, v in self.data.items() if
                    intersect(searched, v) == searched])
133187
def is_supported(value, check_all=False, filters=None, iterate=False):
    """"""
    assert filters is not None
    if value is None:
        return True
    if not is_editable_type(value):
        return False
    elif not isinstance(value, filters):
        return False
    elif iterate:
        if isinstance(value, (list, tuple, set)):
            valid_count = 0
            for val in value:
                if is_supported(val, filters=filters, iterate=check_all):
                    valid_count += 1
                if not check_all:
                    break
            return valid_count > 0
        elif isinstance(value, dict):
            for key, val in list(value.items()):
                if not is_supported(key, filters=filters, iterate=check_all) \
                   or not is_supported(val, filters=filters,
                                       iterate=check_all):
                    return False
                if not check_all:
                    break
    return True
609734
def _is_process_filtered(self, process, key=None):
        """"""
        if key is None:
            key = self.filter_key
        try:
            # If the item process[key] is a list, convert it to a string
            # in order to match it with the current regular expression
            if isinstance(process[key], list):
                value = ' '.join(process[key])
            else:
                value = process[key]
        except KeyError:
            # If the key did not exist
            return False
        try:
            return self._filter_re.match(value) is None
        except (AttributeError, TypeError):
            # AttributeError
            # Filter processes crashs with a bad regular expression pattern (issue #665)
            # TypeError
            # Filter processes crashs if value is None (issue #1105)
            return False
639999
def match_paren(self, tokens, item):
        """"""
        match, = tokens
        return self.match(match, item)
826956
private function _check_filter($item, $filter): bool
  {
    if ( $filter ){
      if ( is_string($filter) ){
        return strtolower(substr(\is_array($item) ? $item['path'] : $item, - strlen($filter))) === strtolower($filter);
      }
      if ( is_callable($filter) ){
        return $filter($item);
      }
    }
    return true;
  }