// interfaces Equivable, Hashable
439726
func (p *PVector) Equiv(o interface{}) bool {

	if p == o {
		return true
	}

	if ov, ok := o.(iseq.PVector); ok {
		if p.Count1() != ov.Count1() {
			return false
		}

		for i := 0; i < p.Count1(); i++ {
			if !sequtil.Equiv(p.Nth(i), ov.Nth(i)) {
				return false
			}
		}
		return true
	}

	// TODO: when we have Sequential, fix this
	if os, ok := o.(iseq.Seqable); ok {
		s := os.Seq()
		for i := 0; i < p.Count1(); i, s = i+1, s.Next() {
			if s == nil || !sequtil.Equiv(p.Nth(i), s.First()) {
				return false
			}
		}
		if s != nil {
			return false
		}

		return true
	}

	// TODO: handle built-in 'sequable' things such as arrays, slices, strings
	return false
}
816725
func (v List) GetAll() []interface{} {
	var interfaces []interface{}
	for _, value := range v {
		interfaces = append(interfaces, value.Get())
	}
	return interfaces
}
1349852
func StringsToInterfaces(strs ...string) []interface{} {
	ret := make([]interface{}, len(strs))
	for i := 0; i < len(strs); i++ {
		ret[i] = strs[i]
	}
	return ret
}
470420
func (j *JsonQuery) Interface(s ...string) (interface{}, error) {
	val, err := rquery(j.blob, s...)
	if err != nil {
		return nil, err
	}
	return val, nil
}
1347994
func Interface(expected, actual interface{}) *Result {
	if reflect.DeepEqual(expected, actual) {
		return nil
	}
	scs := spew.ConfigState{
		Indent:                  "  ",
		DisableMethods:          true,
		SortKeys:                true,
		DisablePointerAddresses: true,
		DisableCapacities:       true,
	}
	expString := scs.Sdump(expected)
	actString := scs.Sdump(actual)
	return Text(expString, actString)
}
814167
func CastInterfaceToInterfaceSlice(slice interface{}) ([]interface{}, error) {
	s := reflect.ValueOf(slice)
	if s.Kind() != reflect.Slice {
		return []interface{}{}, fmt.Errorf("Input is not a slice: %#v", slice)
	}

	ret := make([]interface{}, s.Len())

	for i := 0; i < s.Len(); i++ {
		ret[i] = s.Index(i).Interface()
	}

	return ret, nil
}
630401
func (c *VPCRouterDHCPServerConfig) InterfaceIndex() int {
	strIndex := strings.Replace(c.Interface, "eth", "", -1)
	index, err := strconv.Atoi(strIndex)
	if err != nil {
		return -1
	}
	return index
}
391525
func HeapInterface(sl interface{}, less interface{}) heap.Interface {
	ret := &sorter{
		sl:   addressableSlice(sl),
		less: reflect.ValueOf(less),
	}
	heap.Init(ret)
	return ret
}
1101240
func parseImplementsInterfaces(parser *Parser) ([]*ast.Named, error) {
	types := []*ast.Named{}
	if parser.Token.Value == "implements" {
		if err := advance(parser); err != nil {
			return nil, err
		}
		// optional leading ampersand
		skip(parser, lexer.AMP)
		for {
			ttype, err := parseNamed(parser)
			if err != nil {
				return types, err
			}
			types = append(types, ttype)
			if skipped, err := skip(parser, lexer.AMP); !skipped {
				break
			} else if err != nil {
				return types, err
			}
		}
	}
	return types, nil
}
503033
func equals(v1, v2 interface{}) bool {
	v1Type := jsonType(v1)
	if v1Type != jsonType(v2) {
		return false
	}
	switch v1Type {
	case "array":
		arr1, arr2 := v1.([]interface{}), v2.([]interface{})
		if len(arr1) != len(arr2) {
			return false
		}
		for i := range arr1 {
			if !equals(arr1[i], arr2[i]) {
				return false
			}
		}
		return true
	case "object":
		obj1, obj2 := v1.(map[string]interface{}), v2.(map[string]interface{})
		if len(obj1) != len(obj2) {
			return false
		}
		for k, v1 := range obj1 {
			if v2, ok := obj2[k]; ok {
				if !equals(v1, v2) {
					return false
				}
			} else {
				return false
			}
		}
		return true
	case "number":
		num1, _ := new(big.Float).SetString(string(v1.(json.Number)))
		num2, _ := new(big.Float).SetString(string(v2.(json.Number)))
		return num1.Cmp(num2) == 0
	default:
		return v1 == v2
	}
}
1349279
func (s *Set) HashEqual(raw interface{}) bool {
	other, ok := raw.(*Set)
	if !ok {
		return false
	}

	ks1 := make([]string, 0)
	ks2 := make([]string, 0)

	for k := range s.m {
		ks1 = append(ks1, k)
	}
	for k := range other.m {
		ks2 = append(ks2, k)
	}

	sort.Strings(ks1)
	sort.Strings(ks2)

	return reflect.DeepEqual(ks1, ks2)
}
163939
func (c *Config) EqualValues(other *Config) bool {
	return c.values.Equal(other.values)
}
1125664
func interfacesFor(version unversioned.GroupVersion) (*meta.VersionInterfaces, error) {
	switch version {
	case v1.SchemeGroupVersion:
		return &meta.VersionInterfaces{
			ObjectConvertor:  api.Scheme,
			MetadataAccessor: accessor,
		}, nil
	default:
		g, _ := registered.Group(autoscaling.GroupName)
		return nil, fmt.Errorf("unsupported storage version: %s (valid: %v)", version, g.GroupVersions)
	}
}
125520
func Uniq(list interface{}) ([]interface{}, error) {
	l, err := interfaceSlice(list)
	if err != nil {
		return nil, err
	}

	out := []interface{}{}
	for _, v := range l {
		if !Has(out, v) {
			out = append(out, v)
		}
	}
	return out, nil
}
310942
func resolveInterface(uses map[*ast.Ident]types.Object, iface *ast.InterfaceType) error {
	var rmi []int
	for i, m := range iface.Methods.List {
		if len(m.Names) > 0 {
			continue
		}
		newIface, err := exprInterfaceType(uses, m.Type)
		if err != nil {
			return err
		}
		iface.Methods.List = append(iface.Methods.List, newIface.Methods.List...)
		rmi = append(rmi, i)
	}

	// After adding the signatures, remove the embedded interface
	for i := len(rmi) - 1; i >= 0; i-- {
		iface.Methods.List = append(iface.Methods.List[:i], iface.Methods.List[i+1:]...)
	}

	return nil
}
938327
func (context *BaseContext) GetInterface(
	key string, defaultValue ...interface{}) interface{} {
	if value, ok := context.userData[key]; ok {
		return value
	}
	if len(defaultValue) > 0 {
		return defaultValue[0]
	}
	return nil
}
499319
func (b *BindObject) IsAssignable(to reflect.Type) bool {
	return equalTypes(b.Type, to)
}