Return True if filter matches item.
4404
def match(self, item):
        
        val = getattr(item, self._name)
        if val is not None:
            for fileinfo in val:
                if fnmatch.fnmatchcase(fileinfo.path.lower(), self._value):
                    return True
            return False
528070
public boolean matchesFilter(String filter, int priValue, int secValue) {

        filter = filter.toLowerCase();
        return m_parameters[priValue].toLowerCase().contains(filter)
            || m_parameters[secValue].toLowerCase().contains(filter);
    }
714493
def _match(filtered, matcher):
    """"""

    def match_filtered_identities(x, ids, matcher):
        """Check if an identity matches a set of identities"""

        for y in ids:
            if x.uuid == y.uuid:
                return True
            if matcher.match_filtered_identities(x, y):
                return True
        return False

    # Find subsets of matches
    matched = []

    while filtered:
        candidates = []
        no_match = []

        x = filtered.pop(0)

        while matched:
            ids = matched.pop(0)

            if match_filtered_identities(x, ids, matcher):
                candidates += ids
            else:
                no_match.append(ids)

        candidates.append(x)

        # Generate the new list of matched subsets
        matched = [candidates] + no_match

    return matched
849632
def _pattern_match(self, item, pattern):
        """"""
        if pattern.endswith('*'):
            return item.startswith(pattern[:-1])
        else:
            return item == pattern
1134253
def _tag_matches(tags, filter):
        """"""
        for tag_name, tag_value in filter.items():
            # using _sentinel as I'm not sure that "None"
            # could be used, because it could be a valid
            # series_tags value : when a series has no such tag
            # then I think it's set to /null/None/.. TBC..
            series_tag_value = tags.get(tag_name, _sentinel)
            if series_tag_value != tag_value:
                return False

        return True
219088
public List<ESigItem> findItems(ESigFilter filter) {
        List<ESigItem> list = new ArrayList<ESigItem>();
        
        if (filter == null) {
            list.addAll(items);
        } else {
            for (ESigItem item : items) {
                if (filter.matches(item)) {
                    list.add(item);
                }
            }
        }
        
        return list;
    }
632586
public static boolean matchesFilter(String key, List<String> filters) {
		boolean rets = (null == filters);
		if (!rets) {
			for (Iterator<String> it = filters.iterator(); it.hasNext() && !rets;)
				rets = key.startsWith(it.next());
		}

		return rets;
	}
951424
def _matches(o, pattern):
    """"""
    if not len(o) == len(pattern):
        return False
    comps = zip(o,pattern)
    return all(isinstance(obj,kind) for obj,kind in comps)
710699
def Filter(self, match=None, **_):
    """"""
    arg = self.stack.pop(-1)

    # Filters can be specified as a comma separated list.
    for filter_name in match.group(1).split(","):
      filter_object = ConfigFilter.classes_by_name.get(filter_name)
      if filter_object is None:
        raise FilterError("Unknown filter function %r" % filter_name)

      if not filter_object.sensitive_arg:
        logging.debug("Applying filter %s for %s.", filter_name, arg)
      arg = filter_object().Filter(arg)
      precondition.AssertType(arg, Text)

    self.stack[-1] += arg
1186545
def match_filters(self, path):
        
        # indicate if all required filters were matched
        all_required_match = True

        # iterate over filters to match files
        for filt, ftype in self.__filters:

            # handle "Required" filters:
            if all_required_match and ftype == self.FilterType.Required and not filt.match(path):
                all_required_match = False

            # handle "Include" filters:
            elif ftype == self.FilterType.Include and filt.match(path):
                return True

            # handle "Exclude" filters:
            elif ftype == self.FilterType.Exclude and filt.match(path):
                return False

        # if got here it means we processed all filters, and no include/exclude filter was matched.
        # return if all required were matched
        return all_required_match
1061096
@SuppressWarnings({"unchecked"})
    public final boolean matches(Object item) {
        return item != null
                && expectedType.isInstance(item)
                && matchesSafely((T) item);
    }
592194
def filter(self, search):
        '''
        
        '''
        if not self._filters:
            return search
        filters = Q('match_all')
        for f in self._filters.values():
            filters &= f
        return search.filter(filters)
1052537
def custom_filter_tags(self, value, search):
        """"""
        if not isinstance(value, list):
            value = value.split(',')

        filters = [Q('match', **{'tags': item}) for item in value]
        search = search.query('bool', must=filters)

        return search
445523
def check_inclusions(item, included=[], excluded=[]):
    """"""
    if (len(included) == 0):
        if len(excluded) == 0 or item not in excluded:
            return True
        else:
            return False
    else:
        if item in included:
            return True
    return False
875794
def matching_attributes?(attribute, filter)
      attribute.to_s.downcase == filter.to_s.delete('_').downcase
    end
1229206
def _check_existence_by_collection(self, container, item_name):
        '''
        '''

        coll = container.get_collection()
        for item in coll:
            if item.name == item_name:
                return True
        return False
395718
def _match(self, doc, where):
        """"""
        assert isinstance(where, dict), "where is not a dictionary"
        assert isinstance(doc, dict), "doc is not a dictionary"
        try:
            return all([doc[k] == v for k, v in where.items()])
        except KeyError:
            return False