Returns the filtered query expression
424934
def unsorted_query
      records = scope
      # Text Search
      if search_term
        escaped = Regexp.escape(search_term)
        regexp  = Regexp.new(escaped, Regexp::IGNORECASE)
        if search_columns.size == 1
          records = records.where(search_columns.first => regexp)
        else
          cols    = search_columns.collect { |col| {col => regexp} }
          records = records.where('$or' => cols)
        end
      end

      # Pagination
      if start && page_size
        records = records.skip(start).limit(page_size)
      end
      records
    end
246231
function getGroupQueryFilter(groupName) {
  log.trace('getGroupQueryFilter(%s)', groupName);
  var self = this;

  if (! groupName) return('(objectCategory=Group)');
  if (isDistinguishedName.call(self, groupName)) {
    return('(&(objectCategory=Group)(distinguishedName='+parseDistinguishedName(groupName)+'))');
  }
  return('(&(objectCategory=Group)(cn='+groupName+'))');
}
901265
function getUserQueryFilter(username) {
  log.trace('getUserQueryFilter(%s)', username);
  var self = this;

  if (! username) return('(objectCategory=User)');
  if (isDistinguishedName.call(self, username)) {
    return('(&(objectCategory=User)(distinguishedName='+parseDistinguishedName(username)+'))');
  }

  return('(&(objectCategory=User)(|(sAMAccountName='+username+')(userPrincipalName='+username+')))');
}
1288184
protected Query getTermQueryFilter(String field, String term) {

        return getMultiTermQueryFilter(field, term, Collections.singletonList(term));
    }
607421
def filter(cls, start_position="", max_results="", qb=None, **kwargs):
        
        return cls.where(build_where_clause(**kwargs),
                         start_position=start_position, max_results=max_results, qb=qb)
404920
def _search(self, search_terms, begins_with=None):
        

        kwargs = dict(
            ProjectionExpression='#id',
            ExpressionAttributeNames={"#id": "_id"})

        if len(search_terms) > 0:
            kwargs['FilterExpression'] = reduce(
                lambda x, y: x & y,
                [Attr('tags').contains(arg) for arg in search_terms])

        if begins_with:
            if 'FilterExpression' in kwargs:
                kwargs['FilterExpression'] = kwargs[
                    'FilterExpression'] & Key('_id').begins_with(begins_with)

            else:
                kwargs['FilterExpression'] = Key(
                    '_id').begins_with(begins_with)

        while True:
            res = self._table.scan(**kwargs)
            for r in res['Items']:
                yield r['_id']
            if 'LastEvaluatedKey' in res:
                kwargs['ExclusiveStartKey'] = res['LastEvaluatedKey']
            else:
                break
681996
def scan(cls, filter_builder=None, **scan_filter):
        
        scan_kwargs = {'scan_filter': build_condition(scan_filter)}
        if filter_builder:
            cls._build_filter_expression(filter_builder, scan_kwargs)
        return ResultSet(cls, 'scan', scan_kwargs)
16896
function querySearch (query) {
      return query ? self.states.filter(createFilterFor(query)) : self.states;
    }
775211
def filter(self, f, operator="and"):
        
        if self._filtered:
            self._filter_dsl.filter(f)
        else:
            self._build_filtered_query(f, operator)
        return self
1261766
String getFilterQuery() {

        String result = m_config.getFilterQuery();
        if (result == null) {
            result = "";
        }
        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(result) && !result.startsWith("&")) {
            result = "&" + result;
        }
        if (!result.contains(CommonParams.FL + "=")) {
            result += "&" + CommonParams.FL + "=" + getDefaultReturnFields();
        }
        I_CmsListDateRestriction dateRestriction = m_config.getDateRestriction();
        if (dateRestriction != null) {
            result += "&fq="
                + CmsSearchField.FIELD_INSTANCEDATE_CURRENT_TILL
                + "_"
                + getSearchLocale().toString()
                + "_dt:"
                + dateRestriction.getRange();

        }
        return result;
    }
1015699
def filter_query(self, query):
        

        for filter_class in list(self.filter_classes):
            query = filter_class().filter_query(self.request, query, self)

        return query
1029413
def filter(self, table, mappings, filter_string):
        """"""
        q = filter_string.lower()
        return [mapping for mapping in mappings
                if q in mapping.ud.lower()]
828025
function query(q) {
  var filter = Object.keys(q);
  var isValid;
  var valid;
  var val;

  return this.reduce((list, ps) => {
    isValid = filter.every(key => {
      val = q[key];
      valid = true;

      if (typeof val === 'string') {
        if (val.indexOf('<') > -1) {
          valid = ps[key] < cleanValue(val, '<');
        }

        if (valid && val.indexOf('>') > -1) {
          valid = ps[key] > cleanValue(val, '>');
        }

        if (valid && val.indexOf('~') > -1) {
          valid = ps[key].indexOf(q[key].replace('~', '')) > -1;
        }
      } else {
        valid = ps[key] === val;
      }

      return valid;
    });

    if (isValid) list.push(ps);

    return list;
  }, []);
}
1362589
def filter(self, *query_filter):
        '''
        '''
        for query in query_filter:
            self.query.append(query)
        return self
1373055
def query_decl(self, **kwargs):
        """"""
        return self.session.query(Decl).filter_by(**kwargs).all()
966233
def getExpressionLevels(
            self, threshold=0.0, names=[], startIndex=0, maxResults=0):
        
        rnaQuantificationId = self.getLocalId()
        with self._db as dataSource:
            expressionsReturned = dataSource.searchExpressionLevelsInDb(
                rnaQuantificationId,
                names=names,
                threshold=threshold,
                startIndex=startIndex,
                maxResults=maxResults)
            expressionLevels = [
                SqliteExpressionLevel(self, expressionEntry) for
                expressionEntry in expressionsReturned]
            return expressionLevels
583478
function searchFilter(mock) {
            if (!vm.searchUrl || !mock.expression) {
                return true;
            }

            return vm.searchUrl.match(mock.expression);
        }