// ContainsCallExpr resolves the call expression name and type
/// or package and determines if it exists within the CallList
172617
func (c CallList) ContainsCallExpr(n ast.Node, ctx *Context, stripVendor bool) *ast.CallExpr {
	selector, ident, err := GetCallInfo(n, ctx)
	if err != nil {
		return nil
	}

	// Use only explicit path (optionally strip vendor path prefix) to reduce conflicts
	path, ok := GetImportPath(selector, ctx)
	if !ok {
		return nil
	}
	if stripVendor {
		if vendorIdx := strings.Index(path, vendorPath); vendorIdx >= 0 {
			path = path[vendorIdx+len(vendorPath):]
		}
	}
	if !c.Contains(path, ident) {
		return nil
	}

	return n.(*ast.CallExpr)
	/*
		// Try direct resolution
		if c.Contains(selector, ident) {
			log.Printf("c.Contains == true, %s, %s.", selector, ident)
			return n.(*ast.CallExpr)
		}
	*/

}
850805
func Contains(slice []string, lookup string) bool {
	for _, element := range slice {
		if element == lookup {
			return true
		}
	}
	return false
}
1246691
func contains(list interface{}, value string) bool {
	switch l := list.(type) {
	case []interface{}:
		for _, v := range l {
			if v == value {
				return true
			}
		}
	}
	return false
}
628165
func (set IdentifierSet) ContainsAll(i ...Identifier) bool {
	for _, v := range i {
		if !set.Contains(v) {
			return false
		}
	}
	return true
}
379226
func Contains(in interface{}, elem interface{}) bool {
	inValue := reflect.ValueOf(in)
	elemValue := reflect.ValueOf(elem)
	inType := inValue.Type()

	switch inType.Kind() {
	case reflect.String:
		return strings.Contains(inValue.String(), elemValue.String())
	case reflect.Map:
		for _, key := range inValue.MapKeys() {
			if equal(key.Interface(), elem) {
				return true
			}
		}
	case reflect.Slice, reflect.Array:
		for i := 0; i < inValue.Len(); i++ {
			if equal(inValue.Index(i).Interface(), elem) {
				return true
			}
		}
	default:
		panic(fmt.Sprintf("Type %s is not supported by Contains, supported types are String, Map, Slice, Array", inType.String()))
	}

	return false
}
1179261
func (a AuthTypes) Contains(t AuthType) bool {
	for _, v := range a {
		if v == t {
			return true
		}
	}
	return false
}
174913
func (c *BundlingChecker) contains(items []checkerItem) ([]*isolatedclient.PushState, error) {
	var digests []*service.HandlersEndpointsV1Digest
	for _, item := range items {
		digests = append(digests, &service.HandlersEndpointsV1Digest{
			Digest:     string(item.item.Digest),
			Size:       item.item.Size,
			IsIsolated: item.isolated,
		})
	}
	pushStates, err := c.svc.Contains(c.ctx, digests)
	if err != nil {
		return nil, fmt.Errorf("isolate Contains call failed: %v", err)
	}
	return pushStates, nil
}
587953
func (p *parser) parseSexpr() *ast.SubExpression {
	// OPEN_SEXPR
	tok := p.shift()

	result := ast.NewSubExpression(tok.Pos, tok.Line)

	// helperName param* hash?
	result.Expression = p.parseExpression(tok)

	// CLOSE_SEXPR
	tok = p.shift()
	if tok.Kind != lexer.TokenCloseSexpr {
		errExpected(lexer.TokenCloseSexpr, tok)
	}

	return result
}
970482
func (p plugins) Contains(item Plugin) (bool, int) {
	for idx, i := range p {
		if i.Name() == item.Name() && i.Version() == item.Version() && i.TypeName() == item.TypeName() {
			return true, idx
		}
	}
	return false, -1
}
683481
func ReferencesInExpr(expr hcl.Expression) ([]*addrs.Reference, tfdiags.Diagnostics) {
	if expr == nil {
		return nil, nil
	}
	traversals := expr.Variables()
	return References(traversals)
}
1259691
func (ps ProtocolSet) Contains(p Protocol) bool {
	for _, x := range ps {
		if x == p {
			return true
		}
	}
	return false
}
992860
func Contains(err error, msg string) bool {
	return len(GetAll(err, msg)) > 0
}
77561
func (i ContainsExpr) String() string {
	return fmt.Sprintf("contains(%v, %v)", i.Left, i.Right)
}
210423
func EvalExpr(node ast.Node) (val data.Value, err error) {
	state := &state{wr: ioutil.Discard}
	defer state.errRecover(&err)
	state.walk(node)
	return state.val, nil
}
740639
func (n EndpointSelector) HasKeyPrefix(prefix string) bool {
	for k := range n.MatchLabels {
		if strings.HasPrefix(k, prefix) {
			return true
		}
	}
	for _, v := range n.MatchExpressions {
		if strings.HasPrefix(v.Key, prefix) {
			return true
		}
	}
	return false
}
44136
func (as *accountSet) containsTx(tx *types.Transaction) bool {
	if addr, err := types.Sender(as.signer, tx); err == nil {
		return as.contains(addr)
	}
	return false
}
174565
func (p *Planner) planExpr(e *ast.Expr, iter planiter) error {

	if e.Negated {
		return p.planNot(e, iter)
	}

	if len(e.With) > 0 {
		return fmt.Errorf("with keyword not implemented")
	}

	if e.IsCall() {
		return p.planExprCall(e, iter)
	}

	return p.planExprTerm(e, iter)
}