Make a filter on a property for use in a query.
496097
public static Filter.Builder makeFilter(String property, PropertyFilter.Operator operator,
      Value.Builder value) {
    return makeFilter(property, operator, value.build());
  }
315834
function filter(data, query) {
  var results = [];
  var push = true;

  // omit every result that doesn't pass _every_ filter
  data.forEach((val) => {
    var push = true;

    // if we fail a filter condition, then don't push
    // check if we're over the max price
    if (query.maxPrice > 0) {
      if (val.price.value > query.maxPrice) {
        push = false;
      }
    }

    // check if the city is included
    if (query.cities.length > 0) {
      if (!query.cities.includes(val.location.city)) {
        push = false;
      }
    }

    // check if the type is anywhere to be found
    var found = false;
    if (query.types.length > 0) {
      query.types.forEach((type) => {
        if (val.types.includes(type)) found = true;
      });
    } else {
      // assume it's found if there's no `query.types` on the request
      found = true;
    }
    if (!found) {
      push = false;
    }

    // if we found something, then push it to the results array
    if (push) {
      results.push(val);
    }
  });

  return results;
}
1362589
def filter(self, *query_filter):
        '''
        '''
        for query in query_filter:
            self.query.append(query)
        return self
747148
def apply(self, search, field, value):
        """"""
        if not isinstance(value, list):
            value = [x for x in value.strip().split(',') if x]

        filters = [Q('match', **{field: item}) for item in value]
        return search.query('bool', should=filters)
841573
def filter(self, table, vg_snapshots, filter_string):
        """"""
        query = filter_string.lower()
        return [vg_snapshot for vg_snapshot in vg_snapshots
                if query in vg_snapshot.name.lower()]
42045
def filter(self, table, keypairs, filter_string):
        """"""
        query = filter_string.lower()
        return [keypair for keypair in keypairs
                if query in keypair.name.lower()]
484664
def exclude(prop):
    ''''''
    if isinstance(prop, QueryableAttribute):
        prop = prop.property
    assert isinstance(prop, (Column, ColumnProperty, RelationshipProperty))
    _excluded.add(prop)
    if isinstance(prop, RelationshipProperty):
        # Also exclude columns that participate in this relationship
        for local in prop.local_columns:
            _excluded.add(local)
285365
def _build_filtered_query(self, f, operator):
        
        self._filtered = True
        if isinstance(f, Filter):
            filter_object = f
        else:
            filter_object = Filter(operator).filter(f)
        self._filter_dsl = filter_object
294715
def filter(self, table, domains, filter_string):
        """"""
        q = filter_string.lower()

        def comp(domain):
            if q in domain.name.lower():
                return True
            return False

        return filter(comp, domains)
28100
function createFilterFor(query) {
      var lowercaseQuery = query.toLowerCase();

      return function filterFn(state) {
        return (state.value.indexOf(lowercaseQuery) === 0);
      };

    }
379759
def make_filter(**tests):
    """"""
    tests = [AttrTest(k, v) for k, v in tests.items()]
    return Filter(tests)
928939
def filter(self, criteria: Q, offset: int = 0, limit: int = 10, order_by: list = ()):
        """"""

        if criteria.children:
            items = list(self._filter(criteria, self.conn['data'][self.schema_name]).values())
        else:
            items = list(self.conn['data'][self.schema_name].values())

        # Sort the filtered results based on the order_by clause
        for o_key in order_by:
            reverse = False
            if o_key.startswith('-'):
                reverse = True
                o_key = o_key[1:]
            items = sorted(items, key=itemgetter(o_key), reverse=reverse)

        result = ResultSet(
            offset=offset,
            limit=limit,
            total=len(items),
            items=items[offset: offset + limit])
        return result
614615
def _filter(self, query, **kwargs):
        
        query = self._auto_filter(query, **kwargs)
        return query
1047377
def get(cls, parent, name):
        """"""
        return cls.query.filter_by(parent=parent, name=name).one_or_none()
109688
def filter_like(self, **filters):
        ''' 
        '''
        Query = {}
        for name, value in filters.items():
            name = resolve_name(self.type, name)
            Query[name] = re_compile(value, IGNORECASE)
        self.filter(QueryExpression(Query))
        return self
237231
function filter(obj) {
    var result = {}, fieldDefine, value;
    for(var field in options) {
      fieldDefine = options[field];
      value = obj[field];
      if(!fieldDefine.private && value !== undefined) {
        result[field] = value;
      }
    }
    return result;
  }
137978
function createFilterFor(query) {
      var lowercaseQuery = query.toLowerCase();

      return function filterFn(vegetable) {
        return (vegetable._lowername.indexOf(lowercaseQuery) === 0) ||
            (vegetable._lowertype.indexOf(lowercaseQuery) === 0);
      };

    }