// interface Seqable members
7952
func (v *PVector) Seq() iseq.Seq {
	if cs := v.chunkedSeq(); cs != nil {
		// avoid the dreaded nil interface problem
		return cs
	}
	return nil
}
1228932
func (d *decodeState) valueInterface(data Slice) interface{} {
	switch data.Type() {
	case Array:
		return d.arrayInterface(data)
	case Object:
		return d.objectInterface(data)
	default:
		return d.literalInterface(data)
	}
}
1161134
func InterfaceToSliceOfStrings(v interface{}) []string {
	if v == nil {
		return nil
	}
	var sl []string
	switch reflect.TypeOf(v).Kind() {
	case reflect.Slice:
		s := reflect.ValueOf(v)
		sl = make([]string, s.Len(), s.Len())
		for i := 0; i < s.Len(); i++ {
			sl[i] = s.Index(i).Interface().(string)
		}
	case reflect.String:
		sl = append(sl, reflect.ValueOf(v).Interface().(string))
	default:
		return nil
	}
	return sl
}
1201104
func GetInterfaces() (Interfaces, error) {
	interfaces, err := net.Interfaces()
	if err != nil {
		Logln("Can't get interfaces.", err)
		return nil, err
	}
	var ifaces Interfaces
	for _, iface := range interfaces {
		ifaces = append(ifaces, Interface(iface))
	}
	return ifaces, nil
}
537095
func Implements(t TestingT, interfaceObject interface{}, object interface{}, msgAndArgs ...interface{}) bool {
	if h, ok := t.(tHelper); ok {
		h.Helper()
	}
	interfaceType := reflect.TypeOf(interfaceObject).Elem()

	if object == nil {
		return Fail(t, fmt.Sprintf("Cannot check if nil implements %v", interfaceType), msgAndArgs...)
	}
	if !reflect.TypeOf(object).Implements(interfaceType) {
		return Fail(t, fmt.Sprintf("%T must implement %v", object, interfaceType), msgAndArgs...)
	}

	return true
}
1065659
func isComparable(t reflect.Type) bool {
	switch t.Kind() {
	case reflect.Array:
		return isComparable(t.Elem())

	case reflect.Struct:
		for i := 0; i < t.NumField(); i++ {
			if !isComparable(t.Field(i).Type) {
				return false
			}
		}

		return true

	case reflect.Slice, reflect.Map, reflect.Func:
		return false
	}

	return true
}
816725
func (v List) GetAll() []interface{} {
	var interfaces []interface{}
	for _, value := range v {
		interfaces = append(interfaces, value.Get())
	}
	return interfaces
}
216011
func interfaceOf(v reflect.Value) interface{} {
	if v.Kind() == reflect.Ptr {
		return v.Elem().Interface()
	}

	return v.Interface()
}
82450
func indirectInterface(v reflect.Value) reflect.Value {
	if v.Kind() != reflect.Interface {
		return v
	}
	if v.IsNil() {
		return reflect.Value{}
	}
	return v.Elem()
}
683073
func (g *genDeepCopy) deepCopyableInterfaces(c *generator.Context, t *types.Type) ([]*types.Type, bool, error) {
	ts, err := g.deepCopyableInterfacesInner(c, t)
	if err != nil {
		return nil, false, err
	}

	set := map[string]*types.Type{}
	for _, t := range ts {
		set[t.String()] = t
	}

	result := []*types.Type{}
	for _, t := range set {
		result = append(result, t)
	}

	TypeSlice(result).Sort() // we need a stable sorting because it determines the order in generation

	nonPointerReceiver, err := extractNonPointerInterfaces(t)
	if err != nil {
		return nil, false, err
	}

	return result, nonPointerReceiver, nil
}
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
}
126490
func (c Context) Interface(key string, i interface{}) Context {
	c.l.context = enc.AppendInterface(enc.AppendKey(c.l.context, key), i)
	return c
}
486109
func decodeSlice(elemType reflect.Type, slice reflect.Value, input map[string]interface{}) error {
	var v reflect.Value
	if elemType.Kind() == reflect.Ptr {
		v = reflect.New(elemType.Elem())
	} else {
		v = reflect.New(elemType)
	}

	if !v.CanInterface() {
		return fmt.Errorf("can't interface %#v", v)
	}

	if err := decodeMap(input, v.Interface()); err != nil {
		return err
	}

	if elemType.Kind() == reflect.Struct {
		v = v.Elem()
	}
	slice.Set(reflect.Append(slice, v))

	return nil
}
174211
func initTableCommon(t *tableCommon, tblInfo *model.TableInfo, physicalTableID int64, cols []*table.Column, alloc autoid.Allocator) {
	t.tableID = tblInfo.ID
	t.physicalTableID = physicalTableID
	t.alloc = alloc
	t.meta = tblInfo
	t.Columns = cols
	t.publicColumns = t.Cols()
	t.writableColumns = t.WritableCols()
	t.writableIndices = t.WritableIndices()
	t.recordPrefix = tablecodec.GenTableRecordPrefix(physicalTableID)
	t.indexPrefix = tablecodec.GenTableIndexPrefix(physicalTableID)
}
1113788
func doTypeMembers(t Type, name string, fn func(*ast.Object), q *list.List) {
	// strip off single indirection
	// TODO: eliminate methods disallowed when indirected.
	if u, ok := t.Node.(*ast.StarExpr); ok {
		_, t = t.ctxt.exprType(u.X, false, t.Pkg)
	}
	if id, _ := t.Node.(*ast.Ident); id != nil && id.Obj != nil {
		if scope, ok := id.Obj.Type.(*ast.Scope); ok {
			doScope(scope, name, fn, t.Pkg)
		}
	}
	u := t.Underlying(true)
	switch n := u.Node.(type) {
	case *ast.StructType:
		t.ctxt.doStructMembers(n.Fields.List, t.Pkg, fn, q)

	case *ast.InterfaceType:
		t.ctxt.doInterfaceMembers(n.Methods.List, t.Pkg, fn)
	}
}
870448
func interfacesFor(version unversioned.GroupVersion) (*meta.VersionInterfaces, error) {
	switch version {
	case v1alpha1.SchemeGroupVersion:
		return &meta.VersionInterfaces{
			Codec:            v1alpha1.Codec,
			ObjectConvertor:  api.Scheme,
			MetadataAccessor: accessor,
		}, nil
	default:
		g, _ := latest.Group(metrics.GroupName)
		return nil, fmt.Errorf("unsupported storage version: %s (valid: %v)", version, g.GroupVersions)
	}
}