Apply the given filtering criterion to a copy of this Query, using
        keyword expressions.
1680
def filter_by(self, **kwargs):
        
        query = self._copy()
        for field, value in kwargs.items():
            query.domain.append(
                (field, '=', value)
            )
        return query
396497
def allow_filtering(self):
        
        clone = copy.deepcopy(self)
        clone._allow_filtering = True
        return clone
744623
public static <T> void applyFilter(MultivaluedMap<String, String> queryParams,
                                       SpiQuery<T> query,
                                       InjectionManager manager) {
        List<String> wheres = queryParams.get(FILTER_PARAM_NAME);
        if (wheres != null && wheres.size() > 0) {
            EbeanExprInvoker invoker = new EbeanExprInvoker(query, manager);
            WhereExprApplier<T> applier = WhereExprApplier.create(query.where());
            for (String w : wheres) {
                QueryDSL.invoke(
                        w,
                        invoker,
                        applier
                );
            }
        }
    }
1022324
def count(self, *criterion, **kwargs):
        
        query = self._query(*criterion)
        query = self._filter(query, **kwargs)
        return query.count()
323788
def add_query(self, key_val={}):
        

        q = Q("match", **key_val)
        self.search = self.search.query(q)
        return self
1029413
def filter(self, table, mappings, filter_string):
        """"""
        q = filter_string.lower()
        return [mapping for mapping in mappings
                if q in mapping.ud.lower()]
43839
protected function applyFiltersTo()
    {
        $searchValue = request('search')['value'];

        if ($searchValue) {
            $this->queryHandler->applyFilters($this->columnManager->getSearchColumns(), $searchValue);
        }
    }
1088838
def _apply_filters(self):
        
        # apply filters
        filters = []
        for f in self._filters:
            filters.append('{}{}{}'.format(f['name'], f['operator'], f['value']))
        self.tcex.log.debug(u'filters: {}'.format(filters))

        if filters:
            self._request.add_payload('filters', ','.join(filters))
1168545
def apply_queryset_rules(self, qs):
        
        clauses = {
            'filter': [],
            'exclude': []}

        for rule in self.drip_model.queryset_rules.all():

            clause = clauses.get(rule.method_type, clauses['filter'])

            kwargs = rule.filter_kwargs(qs, now=self.now)
            clause.append(Q(**kwargs))

            qs = rule.apply_any_annotation(qs)

        if clauses['exclude']:
            qs = qs.exclude(functools.reduce(operator.or_, clauses['exclude']))
        qs = qs.filter(*clauses['filter'])

        return qs
919364
private static Map<String, String> attributeCriterionToFilters(AttributeCriterion criterion) {
		Map<String, String> filters = new LinkedHashMap<String, String>();
		String filter = criterion.getAttributeName() + " " + criterion.getOperator() + " ";
		if (criterion.getValue() != null
				&& ((criterion.getValue().contains("\"") || criterion.getValue().contains(" ") || !criterion.getValue()
						.matches("(\\.|\\-|[0-9])*")) || "LIKE".equalsIgnoreCase(criterion.getOperator()))
				&& ((!"DURING".equals(criterion.getOperator().toUpperCase())
						&& !"BEFORE".equals(criterion.getOperator().toUpperCase()) && !"AFTER".equals(criterion
						.getOperator().toUpperCase())))) {
			filter += "\'" + criterion.getValue().replaceAll("\\*", "%") + "\'";
		} else {
			filter += criterion.getValue();
		}
		filters.put(criterion.getServerLayerId(), filter);
		return filters;
	}
690372
public void applyAttributeFilter(AttributeScorer filter, int rank) {
		if (filter == null)
			return;
		if (rank >= this.getAttributesNum())
			return;
		// get the threshold
		double threshold = filter.getValueForRank(rank);
		// iterate on the attributes
		// and remove them if their LLR score is below the threshold
		Iterator termIter = this.tokenForm2index.keySet().iterator();
		List terms2remove = new ArrayList();
		while (termIter.hasNext()) {
			String term = (String) termIter.next();
			int[] index = this.tokenForm2index.get(term);
			// get the score
			// TODO what if we are getting -1
			if (filter.getScore(index[0]) < threshold)
				terms2remove.add(term);
		}
		for (int i = 0; i < terms2remove.size(); i++) {
			String term = (String) terms2remove.get(i);
			int[] index = this.tokenForm2index.remove(term);
			this.index2docfreq.remove(Integer.valueOf(index[0]));
		}
	}
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])
144380
private void applyFilters(List<TreeModelFilter<SQLPPTriplesMap>> filters) {
		FilteredModel model = (FilteredModel) mappingList.getModel();
		model.removeAllFilters();
		model.addFilters(filters);
	}
301072
def apply_filters(o)
      @filters.keys.find_all{|type| Splib.type_of?(o, type)}.each do |type|
        @filters[type].each_pair do |k,v|
          begin
            case k
            when :filters
              v.each{|f|o = f.filter(o)}
            when :procs
              v.each{|pr|o = pr.call(o)}
            end
          rescue ArgumentError
            # ignore this
          end
        end
      end
      o
    end
1104786
private <T, R> void applyPredicates(JoinerQuery<T, R> request, JPAQuery query, Set<Path<?>> usedAliases, List<JoinDescription> joins) {
        if (request.getWhere() != null) {
            Predicate where = predicateAliasResolver.resolvePredicate(request.getWhere(), joins, usedAliases);
            checkAliasesArePresent(where, usedAliases);
            query.where(where);
        }
        if (request.getGroupBy() != null) {
            Map<AnnotatedElement, List<JoinDescription>> grouped = joins.stream()
                    .collect(Collectors.groupingBy(j -> j.getOriginalAlias().getAnnotatedElement()));
            Path<?> grouping = predicateAliasResolver.resolvePath(request.getGroupBy(), grouped, usedAliases);
            checkAliasesArePresent(grouping, usedAliases);
            query.groupBy(grouping);
        }
        if (request.getHaving() != null) {
            Predicate having = predicateAliasResolver.resolvePredicate(request.getHaving(), joins, usedAliases);
            checkAliasesArePresent(having, usedAliases);
            query.having(having);
        }
    }
936649
public Object setSelectedSearch(Object criteria) {
		// filterField leegmaken
		if (getTableWidget().getTextFilterField() != null) {
			getTableWidget().getTextFilterField().setText("");
		}
		// if Referable == null, empty filterForm and execute filter
		if (criteria == null) {
			if (dataProvider.supportsFiltering()) {
				getFilterForm().getNewFormObjectCommand().execute();
			}
			executeFilter();
			return null;
		}
		List resultList = getList(criteria);
		if (dataProvider.supportsFiltering()) {
			// adapt filterForm to reflect referable criteria
			if ((resultList == null) || (resultList.size() > 0)) // fill in
																	// referable
			{
				getFilterForm().setFormObject(criteria);
			} else { // empty filterForm and execute
				getFilterForm().getNewFormObjectCommand().execute();
				executeFilter();
			}
		}
		if (resultList != null && resultList.size() == 1) {
			// return the detailObject
			// return loadEntityDetails(resultList.get(0));
			return loadSimpleEntity(resultList.get(0));
		}
		return resultList;
	}
322877
def filter(self, filter):
        
        new_query_set = self.clone()
        new_query_set.query.add_filter(filter)
        
        return new_query_set