// Generalized where function
7269
func generalizedWhere(funcName string, entries interface{}, key string, test func(interface{}) bool) (interface{}, error) {
	entriesVal, err := getArrayValues(funcName, entries)

	if err != nil {
		return nil, err
	}

	selection := make([]interface{}, 0)
	for i := 0; i < entriesVal.Len(); i++ {
		v := reflect.Indirect(entriesVal.Index(i)).Interface()

		value := deepGet(v, key)
		if test(value) {
			selection = append(selection, v)
		}
	}

	return selection, nil
}
954507
func generalizedWhereLabel(funcName string, containers Context, label string, test func(string, bool) bool) (Context, error) {
	selection := make([]*RuntimeContainer, 0)

	for i := 0; i < len(containers); i++ {
		container := containers[i]

		value, ok := container.Labels[label]
		if test(value, ok) {
			selection = append(selection, container)
		}
	}

	return selection, nil
}
874251
func (v *Value) WhereMSI(decider func(int, map[string]interface{}) bool) *Value {
	var selected []map[string]interface{}
	v.EachMSI(func(index int, val map[string]interface{}) bool {
		shouldSelect := decider(index, val)
		if !shouldSelect {
			selected = append(selected, val)
		}
		return true
	})
	return &Value{data: selected}
}
510761
func (me *DefaultAdapter) WhereSql(buf *SqlBuilder, where ExpressionList) error {
	if where != nil && len(where.Expressions()) > 0 {
		buf.Write(me.WhereFragment)
		return me.Literal(buf, where)
	}
	return nil
}
727979
func (b *DeleteBuilder) Where(expr BoolExpr) *DeleteBuilder {
	b.Delete.Where = &Where{
		Type: astWhere,
		Expr: unwrapBoolExpr(expr),
	}
	return b
}
1322442
func ByGoarch(s string) Filter {
	return func(a Artifact) bool {
		return a.Goarch == s
	}
}
119191
func (qb *TiDBQueryBuilder) Where(cond string) QueryBuilder {
	qb.Tokens = append(qb.Tokens, "WHERE", cond)
	return qb
}
436198
func generalizedGroupBy(funcName string, entries interface{}, getValue func(interface{}) (interface{}, error), addEntry func(map[string][]interface{}, interface{}, interface{})) (map[string][]interface{}, error) {
	entriesVal, err := getArrayValues(funcName, entries)

	if err != nil {
		return nil, err
	}

	groups := make(map[string][]interface{})
	for i := 0; i < entriesVal.Len(); i++ {
		v := reflect.Indirect(entriesVal.Index(i)).Interface()
		value, err := getValue(v)
		if err != nil {
			return nil, err
		}
		if value != nil {
			addEntry(groups, value, v)
		}
	}
	return groups, nil
}
187229
func (b *Builder) Where(cond Cond) *Builder {
	if b.cond.IsValid() {
		b.cond = b.cond.And(cond)
	} else {
		b.cond = cond
	}
	return b
}
503700
func (ns *Namespace) Where(seq, key interface{}, args ...interface{}) (interface{}, error) {
	seqv, isNil := indirect(reflect.ValueOf(seq))
	if isNil {
		return nil, errors.New("can't iterate over a nil value of type " + reflect.ValueOf(seq).Type().String())
	}

	mv, op, err := parseWhereArgs(args...)
	if err != nil {
		return nil, err
	}

	var path []string
	kv := reflect.ValueOf(key)
	if kv.Kind() == reflect.String {
		path = strings.Split(strings.Trim(kv.String(), "."), ".")
	}

	switch seqv.Kind() {
	case reflect.Array, reflect.Slice:
		return ns.checkWhereArray(seqv, kv, mv, path, op)
	case reflect.Map:
		return ns.checkWhereMap(seqv, kv, mv, path, op)
	default:
		return nil, fmt.Errorf("can't iterate over %v", seq)
	}
}
1016940
func (q Query) WhereIndexedT(predicateFn interface{}) Query {
	predicateGenericFunc, err := newGenericFunc(
		"WhereIndexedT", "predicateFn", predicateFn,
		simpleParamValidator(newElemTypeSlice(new(int), new(genericType)), newElemTypeSlice(new(bool))),
	)
	if err != nil {
		panic(err)
	}

	predicateFunc := func(index int, item interface{}) bool {
		return predicateGenericFunc.Call(index, item).(bool)
	}

	return q.WhereIndexed(predicateFunc)
}
783812
func (stmt UpdateStmt) Where(conds ...Clause) UpdateStmt {
	if len(conds) > 1 {
		// By default, multiple where clauses will be joined will AllOf
		stmt.cond = AllOf(conds...)
	} else if len(conds) == 1 {
		stmt.cond = conds[0]
	}
	return stmt
}
1136848
func (L *State) IsGoFunction(index int) bool {
	return C.clua_isgofunction(L.s, C.int(index)) != 0
}
1191739
func (g *GenScheme) Filter(c *generator.Context, t *types.Type) bool {
	ret := !g.schemeGenerated
	g.schemeGenerated = true
	return ret
}
1298113
func (q *Query) WhereInMulti(where string, values ...interface{}) *Query {
	return q.Where(where, types.InMulti(values...))
}
66001
func (statement *Statement) Where(query interface{}, args ...interface{}) *Statement {
	return statement.And(query, args...)
}
492735
func (ls *LState) Where(level int) string {
	return ls.where(level, false)
}