// Deserialize back to map[interface{}]interface{}
2536
func (s GobSerializer) Deserialize(d []byte, ss *sessions.Session) error {
	dec := gob.NewDecoder(bytes.NewBuffer(d))
	return dec.Decode(&ss.Values)
}
141433
func Deserialize(p []byte) *processors.Processors {
	flatP := structs.GetRootAsProcessors(p, 0)
	procs := &processors.Processors{}
	flatCache := &structs.CacheInf{}
	procs.Timestamp = flatP.Timestamp()
	procs.Architecture = string(flatP.Architecture())
	procs.CPUs = flatP.CPUs()
	procs.Possible = string(flatP.Possible())
	procs.Present = string(flatP.Present())
	procs.Offline = string(flatP.Offline())
	procs.Online = string(flatP.Online())
	procs.Sockets = flatP.Sockets()
	procs.CoresPerSocket = flatP.CoresPerSocket()
	procs.ThreadsPerCore = flatP.ThreadsPerCore()
	procs.VendorID = string(flatP.VendorID())
	procs.CPUFamily = string(flatP.CPUFamily())
	procs.Model = string(flatP.Model())
	procs.ModelName = string(flatP.ModelName())
	procs.Stepping = string(flatP.Stepping())
	procs.Microcode = string(flatP.Microcode())
	procs.CPUMHz = flatP.CPUMHz()
	procs.MHzMin = flatP.MHzMin()
	procs.MHzMax = flatP.MHzMax()
	procs.BogoMIPS = flatP.BogoMIPS()
	procs.CacheSize = string(flatP.CacheSize())
	procs.CacheIDs = make([]string, 0, flatP.CacheLength())
	procs.Cache = make(map[string]string, flatP.CacheLength())
	for j := 0; j < flatP.CacheLength(); j++ {
		if !flatP.Cache(flatCache, j) {
			continue
		}
		procs.CacheIDs = append(procs.CacheIDs, string(flatCache.ID()))
		procs.Cache[procs.CacheIDs[j]] = string(flatCache.Size())
	}
	procs.Flags = make([]string, flatP.FlagsLength())
	for i := 0; i < len(procs.Flags); i++ {
		procs.Flags[i] = string(flatP.Flags(i))
	}
	procs.Bugs = make([]string, flatP.BugsLength())
	for i := 0; i < len(procs.Bugs); i++ {
		procs.Bugs[i] = string(flatP.Bugs(i))
	}
	procs.OpModes = make([]string, flatP.OpModesLength())
	for i := 0; i < len(procs.OpModes); i++ {
		procs.OpModes[i] = string(flatP.OpModes(i))
	}
	procs.Virtualization = string(flatP.Virtualization())
	procs.NumaNodes = flatP.NumaNodes()
	var n structs.Node
	procs.NumaNodeCPUs = make([]node.Node, flatP.NumaNodeCPUsLength())
	for i := 0; i < len(procs.NumaNodeCPUs); i++ {
		if !flatP.NumaNodeCPUs(&n, i) {
			continue
		}
		procs.NumaNodeCPUs[i].ID = n.ID()
		procs.NumaNodeCPUs[i].CPUList = string(n.CPUList())
	}
	return procs
}
673332
func Deserialize(p []byte) *freq.Frequency {
	ff := structs.GetRootAsFrequency(p, 0)
	l := ff.CPULength()
	f := &freq.Frequency{}
	fCPU := &structs.CPU{}
	cpu := freq.CPU{}
	f.Timestamp = ff.Timestamp()
	f.Sockets = ff.Sockets()
	for i := 0; i < l; i++ {
		if !ff.CPU(fCPU, i) {
			continue
		}
		cpu.Processor = fCPU.Processor()
		cpu.CPUMHz = fCPU.CPUMHz()
		cpu.PhysicalID = fCPU.PhysicalID()
		cpu.CoreID = fCPU.CoreID()
		cpu.APICID = fCPU.APICID()
		f.CPU = append(f.CPU, cpu)
	}
	return f
}
83880
func DeserializeKey(buf []byte) (*Key, error) {
	k := new(Key)
	if err := jsonutil.DecodeJSON(buf, k); err != nil {
		return nil, errwrap.Wrapf("deserialization failed: {{err}}", err)
	}
	return k, nil
}
554924
func Deserialize(p []byte) l.LoadAvg {
	flatLA := structs.GetRootAsLoadAvg(p, 0)
	var la l.LoadAvg
	la.Timestamp = flatLA.Timestamp()
	la.Minute = flatLA.Minute()
	la.Five = flatLA.Five()
	la.Fifteen = flatLA.Fifteen()
	la.Running = flatLA.Running()
	la.Total = flatLA.Total()
	la.PID = flatLA.PID()
	return la
}
1131503
func LinkDeserialize(hdr *unix.NlMsghdr, m []byte) (Link, error) {
	msg := nl.DeserializeIfInfomsg(m)

	attrs, err := nl.ParseRouteAttr(m[msg.Len():])
	if err != nil {
		return nil, err
	}

	base := LinkAttrs{Index: int(msg.Index), RawFlags: msg.Flags, Flags: linkFlags(msg.Flags), EncapType: msg.EncapType()}
	if msg.Flags&unix.IFF_PROMISC != 0 {
		base.Promisc = 1
	}
	var (
		link     Link
		stats32  []byte
		stats64  []byte
		linkType string
	)
	for _, attr := range attrs {
		switch attr.Attr.Type {
		case unix.IFLA_LINKINFO:
			infos, err := nl.ParseRouteAttr(attr.Value)
			if err != nil {
				return nil, err
			}
			for _, info := range infos {
				switch info.Attr.Type {
				case nl.IFLA_INFO_KIND:
					linkType = string(info.Value[:len(info.Value)-1])
					switch linkType {
					case "dummy":
						link = &Dummy{}
					case "ifb":
						link = &Ifb{}
					case "bridge":
						link = &Bridge{}
					case "vlan":
						link = &Vlan{}
					case "veth":
						link = &Veth{}
					case "vxlan":
						link = &Vxlan{}
					case "bond":
						link = &Bond{}
					case "ipvlan":
						link = &IPVlan{}
					case "macvlan":
						link = &Macvlan{}
					case "macvtap":
						link = &Macvtap{}
					case "gretap":
						link = &Gretap{}
					case "ip6gretap":
						link = &Gretap{}
					case "ipip":
						link = &Iptun{}
					case "sit":
						link = &Sittun{}
					case "gre":
						link = &Gretun{}
					case "ip6gre":
						link = &Gretun{}
					case "vti", "vti6":
						link = &Vti{}
					case "vrf":
						link = &Vrf{}
					case "gtp":
						link = &GTP{}
					case "xfrm":
						link = &Xfrmi{}
					default:
						link = &GenericLink{LinkType: linkType}
					}
				case nl.IFLA_INFO_DATA:
					data, err := nl.ParseRouteAttr(info.Value)
					if err != nil {
						return nil, err
					}
					switch linkType {
					case "vlan":
						parseVlanData(link, data)
					case "vxlan":
						parseVxlanData(link, data)
					case "bond":
						parseBondData(link, data)
					case "ipvlan":
						parseIPVlanData(link, data)
					case "macvlan":
						parseMacvlanData(link, data)
					case "macvtap":
						parseMacvtapData(link, data)
					case "gretap":
						parseGretapData(link, data)
					case "ip6gretap":
						parseGretapData(link, data)
					case "ipip":
						parseIptunData(link, data)
					case "sit":
						parseSittunData(link, data)
					case "gre":
						parseGretunData(link, data)
					case "ip6gre":
						parseGretunData(link, data)
					case "vti", "vti6":
						parseVtiData(link, data)
					case "vrf":
						parseVrfData(link, data)
					case "bridge":
						parseBridgeData(link, data)
					case "gtp":
						parseGTPData(link, data)
					case "xfrm":
						parseXfrmiData(link, data)
					}
				}
			}
		case unix.IFLA_ADDRESS:
			var nonzero bool
			for _, b := range attr.Value {
				if b != 0 {
					nonzero = true
				}
			}
			if nonzero {
				base.HardwareAddr = attr.Value[:]
			}
		case unix.IFLA_IFNAME:
			base.Name = string(attr.Value[:len(attr.Value)-1])
		case unix.IFLA_MTU:
			base.MTU = int(native.Uint32(attr.Value[0:4]))
		case unix.IFLA_LINK:
			base.ParentIndex = int(native.Uint32(attr.Value[0:4]))
		case unix.IFLA_MASTER:
			base.MasterIndex = int(native.Uint32(attr.Value[0:4]))
		case unix.IFLA_TXQLEN:
			base.TxQLen = int(native.Uint32(attr.Value[0:4]))
		case unix.IFLA_IFALIAS:
			base.Alias = string(attr.Value[:len(attr.Value)-1])
		case unix.IFLA_STATS:
			stats32 = attr.Value[:]
		case unix.IFLA_STATS64:
			stats64 = attr.Value[:]
		case unix.IFLA_XDP:
			xdp, err := parseLinkXdp(attr.Value[:])
			if err != nil {
				return nil, err
			}
			base.Xdp = xdp
		case unix.IFLA_PROTINFO | unix.NLA_F_NESTED:
			if hdr != nil && hdr.Type == unix.RTM_NEWLINK &&
				msg.Family == unix.AF_BRIDGE {
				attrs, err := nl.ParseRouteAttr(attr.Value[:])
				if err != nil {
					return nil, err
				}
				protinfo := parseProtinfo(attrs)
				base.Protinfo = &protinfo
			}
		case unix.IFLA_OPERSTATE:
			base.OperState = LinkOperState(uint8(attr.Value[0]))
		case unix.IFLA_LINK_NETNSID:
			base.NetNsID = int(native.Uint32(attr.Value[0:4]))
		case unix.IFLA_GSO_MAX_SIZE:
			base.GSOMaxSize = native.Uint32(attr.Value[0:4])
		case unix.IFLA_GSO_MAX_SEGS:
			base.GSOMaxSegs = native.Uint32(attr.Value[0:4])
		case unix.IFLA_VFINFO_LIST:
			data, err := nl.ParseRouteAttr(attr.Value)
			if err != nil {
				return nil, err
			}
			vfs, err := parseVfInfoList(data)
			if err != nil {
				return nil, err
			}
			base.Vfs = vfs
		}
	}

	if stats64 != nil {
		base.Statistics = parseLinkStats64(stats64)
	} else if stats32 != nil {
		base.Statistics = parseLinkStats32(stats32)
	}

	// Links that don't have IFLA_INFO_KIND are hardware devices
	if link == nil {
		link = &Device{}
	}
	*link.Attrs() = base

	return link, nil
}
445500
func DeserializeTemplate(b []byte) (Template, error) {
	tpl := new(FpdfTpl)
	dec := gob.NewDecoder(bytes.NewBuffer(b))
	err := dec.Decode(tpl)
	return tpl, err
}
568133
func Deserialize(p []byte) (*structs.DevUsage, error) {
	u := &structs.DevUsage{}
	err := json.Unmarshal(p, u)
	if err != nil {
		return nil, err
	}
	return u, nil
}
1276949
func Parse(in io.Reader) (*Set, error) {
	m := make(map[string]interface{})
	if err := json.NewDecoder(in).Decode(&m); err != nil {
		return nil, errors.Wrap(err, "failed to unmarshal JWK")
	}

	// We must change what the underlying structure that gets decoded
	// out of this JSON is based on parameters within the already parsed
	// JSON (m). In order to do this, we have to go through the tedious
	// task of parsing the contents of this map :/
	if _, ok := m["keys"]; ok {
		var set Set
		if err := set.ExtractMap(m); err != nil {
			return nil, errors.Wrap(err, `failed to extract from map`)
		}
		return &set, nil
	}

	k, err := constructKey(m)
	if err != nil {
		return nil, errors.Wrap(err, `failed to construct key from keys`)
	}
	return &Set{Keys: []Key{k}}, nil
}
346729
func (e NopEncoder) Deserialize(src []byte, dst interface{}) error {
	if dat, ok := dst.(*[]byte); ok {
		*dat = src
		return nil
	}
	return errValueNotBytePtr
}
536724
func Deserialize(p []byte) *up.Uptime {
	uF := structs.GetRootAsUptime(p, 0)
	var u up.Uptime
	u.Timestamp = uF.Timestamp()
	u.Uptime = uF.Uptime()
	return &u
}
855034
func (c *Cache) deserializeItem(blob []byte) (item *itemWithExp, err error) {
	if len(blob) < 9 {
		err = fmt.Errorf("the received buffer is too small")
		return
	}
	if blob[0] != formatVersionByte {
		err = fmt.Errorf("bad format version, expecting %d, got %d", formatVersionByte, blob[0])
		return
	}
	item = &itemWithExp{}
	deadline := binary.LittleEndian.Uint64(blob[1:])
	if deadline != 0 {
		item.exp = time.Unix(int64(deadline), 0)
	}
	item.val, err = c.Unmarshal(blob[9:])
	return
}
1124082
func Deserialize(p []byte) u.Uptime {
	flatUp := structs.GetRootAsUptime(p, 0)
	var up u.Uptime
	up.Timestamp = flatUp.Timestamp()
	up.Total = flatUp.Total()
	up.Idle = flatUp.Idle()
	return up
}
844102
func Deserialize(p []byte) (*util.CPUUtil, error) {
	ut := &util.CPUUtil{}
	err := json.Unmarshal(p, ut)
	if err != nil {
		return nil, err
	}
	return ut, nil
}
12062
func Deserialize(p []byte) *structs.DevInfo {
	devInfo := flat.GetRootAsDevInfo(p, 0)
	// get the # of interfaces
	dLen := devInfo.DeviceLength()
	info := &structs.DevInfo{Timestamp: devInfo.Timestamp(), Device: make([]structs.Device, dLen)}
	fDev := &flat.Device{}
	sDev := structs.Device{}
	for i := 0; i < dLen; i++ {
		if devInfo.Device(fDev, i) {
			sDev.Name = string(fDev.Name())
			sDev.RBytes = fDev.RBytes()
			sDev.RPackets = fDev.RPackets()
			sDev.RErrs = fDev.RErrs()
			sDev.RDrop = fDev.RDrop()
			sDev.RFIFO = fDev.RFIFO()
			sDev.RFrame = fDev.RFrame()
			sDev.RCompressed = fDev.RCompressed()
			sDev.RMulticast = fDev.RMulticast()
			sDev.TBytes = fDev.TBytes()
			sDev.TPackets = fDev.TPackets()
			sDev.TErrs = fDev.TErrs()
			sDev.TDrop = fDev.TDrop()
			sDev.TFIFO = fDev.TFIFO()
			sDev.TColls = fDev.TColls()
			sDev.TCarrier = fDev.TCarrier()
			sDev.TCompressed = fDev.TCompressed()
		}
		info.Device[i] = sDev
	}
	return info
}
968750
func decode(input interface{}, config *mapstructure.DecoderConfig) error {
	decoder, err := mapstructure.NewDecoder(config)
	if err != nil {
		return err
	}
	return decoder.Decode(input)
}
1232923
func Deserialize(p []byte) (up u.Uptime, err error) {
	err = json.Unmarshal(p, &up)
	if err != nil {
		return up, err
	}
	return up, nil
}