{filter: {foo:bar}} -> {filter: {where: {foo: bar}}}
16772
function(query){

                if(query.filter) {
                    var clone = canReflect.serialize(query);
                    var filter = query.filter;
                    clone.filter = {};
                    clone.filter[prop] = filter;
                    return clone;
                } else {
                    return query;
                }
            }
939839
def _slice_where_conditions(self, wheres, offset, length):
        
        where_group = self.get_query().for_nested_where()
        where_group.wheres = wheres[offset : (offset + length)]

        return {"type": "nested", "query": where_group, "boolean": "and"}
25714
function filterEmbed(ret, attrs) {
  var params = {};
  attrs.split(/\s+/).forEach(function(param) {
    var parts = param.split('=');
    params[parts[0]] = parts[1].substring(1, parts[1].length - 1);
  });

  return ret.replace(/<!-- @@((?:\n?.)*?)-->/g, function(_, operator) {
    var parts = operator.split(/\s+/);

    if (parts[0] === 'var') {
      return params[parts[1]] || '';
    }

    return _;
  });
}
677879
def filter(predicate=nil, &block)
      pred = Yargi::Predicate.to_predicate(predicate, &block)
      extend_result(self.select{|e| pred===e})
    end
852550
function filter(mMap, fnFilter) {
			return Object.keys(mMap).filter(fnFilter).reduce(copyTo.bind(mMap), {});
		}
443912
def filter(cls, iterable, cond, *a, **kw):
    

    return cls(x for x in iterable if cond(x, *a, **kw))
1351636
def convert_coerce_type_and_add_to_where_block(coerce_type_block, where_block):
    """"""
    instanceof_filter = convert_coerce_type_to_instanceof_filter(coerce_type_block)

    if where_block:
        # There was already a Filter block -- we'll merge the two predicates together.
        return Filter(BinaryComposition(u'&&', instanceof_filter.predicate, where_block.predicate))
    else:
        return instanceof_filter
938837
def findWhere(self, attrs=None):
        
        return self._wrap(self._clean.where(attrs, True))
1305505
function parseFilter(model, filter) {
  let merged = null;
  if (util.isEmptyObject(model.def.filter)) {
    merged = filter;
  } else if (util.isEmptyObject(filter)) {
    merged = model.def.filter;
  } else {
    merged = { $and: [model.def.filter, filter] };
  }
  return builder.normFilter(model, merged);
}
722616
function(filterName, input, args) {
            var self            = this,
                hooks           = self.constructor.filters[filterName],
                output          = input,
                extensionName   = '';

            if (!hooks || h.isEmptyObject(hooks)) return output;

            args = args || [];

            for (extensionName in hooks) {
                args = h.arrayFromList(args);

                args.unshift(output);

                output = hooks[extensionName].apply(self, args);
            }

            return output;
        }
1177544
function _abstract_solr_filter_template(filters){
	
	var allbuf = new Array();
	for( var filter_key in filters ){

	    var filter_val = filters[filter_key];

	    // If the value looks like an array, iterate over it and
	    // collect.
	    if( filter_val &&
		filter_val != null &&
		typeof filter_val == 'object' &&
		filter_val.length ){

		    for( var i = 0; i < filter_val.length; i++ ){
			var minibuffer = new Array();
			var try_val = filter_val[i];
			if( typeof(try_val) != 'undefined' &&
			try_val != '' ){
			    minibuffer.push('fq=');
			    minibuffer.push(filter_key);
			    minibuffer.push(':');
			    minibuffer.push('"');
			    minibuffer.push(filter_val[i]);
			    minibuffer.push('"');
			    allbuf.push(minibuffer.join(''));
			}
		    }		    
		}else{
		    var minibuf = new Array();
		    if( typeof(filter_val) != 'undefined' &&
			filter_val != '' ){
			    minibuf.push('fq=');
			    minibuf.push(filter_key);
			    minibuf.push(':');
			    minibuf.push('"');
			    minibuf.push(filter_val);
			    minibuf.push('"');
			    allbuf.push(minibuf.join(''));
			}
		}
	}
	return allbuf.join('&');
    }
1132247
function (filter) {
    var obj = {}
    var val = this.__input

    this.each(function (property, key) {
      obj[key] = property.flatten ? property.flatten(filter) : property
    }, wrapFilter(filter))

    if (val !== void 0) {
      if (val instanceof Base) {
        val = {
          reference: val.path
        }
      }
      obj.val = val
    }

    // refactoring non standard keys
    var flattened = flatten(obj)
    for (var key in flattened) {
      if (key.indexOf('.val') > 0) {
        var newKey = key.split('.val')[0]
        flattened[newKey] = flattened[key]
        delete flattened[key]
      }
    }
    return flattened
  }
1156562
function splitFilter (a, b, predicate) {
  const aOut = [];
  const bOut = [];
  for (let index = 0; index < a.length; index++) {
    if (predicate(a[index], index, a, b)) {
      aOut.push(a[index]);
    } else {
      bOut.push(a[index]);
    }
  }
  return [aOut, bOut];
}
856483
def filter(self, *args):
    '''

    '''
    if len(args) == 1 and isinstance(args[0], Filter):
      filter = args[0]
    else:
      filter = Filter(*args)

    # ensure filter gets attr values the same way the rest of the query does.
    filter.object_getattr = self.object_getattr
    self.filters.append(filter)
    return self
1088946
function filterSelectors (predicate) {
  if (this._other) {
    const [a, b] = splitFilter(this.selectors, this._other.selectors, predicate);
    this.selectors = a;
    this._other.selectors = b;
  } else {
    this.selectors = this.selectors.filter(predicate);
  }
}
338967
function (filters, tpl) {
      for (var i = 0; i < filters.length; ++i) {
        tpl = filters[i](tpl)
      }
      return tpl
    }
647179
function _filter (node, expr, resultSet) {
        var
            selectedNodes,
            conditions,
            type,
            idx,
            condition;
        if (expr.and) {
            conditions = expr.and;
            type = 0;
        } else if (expr.or) {
            conditions = expr.or;
            type = 1;
        }
        for (idx = 0; idx < conditions.length; ++idx) {
            condition = conditions[idx];
            if (condition.and || condition.or) {
                selectedNodes = [];
                _filter(node, condition, selectedNodes);
            } else {
                selectedNodes = _select(node, condition);
            }
            if (0 === type && selectedNodes.length === 0) {
                return;
            }
            if (1 === type && selectedNodes.length !== 0) {
                resultSet.push(node);
                return;
            }
        }
        if (0 === type) {
            resultSet.push(node);
        }
    }