// UnmarshalCheckpoint returns unmarshalled data
424685
func (cp *Data) UnmarshalCheckpoint(blob []byte) error {
	return json.Unmarshal(blob, cp)
}
1090811
func NewPointFromWKB(wkb []byte) *Point {
	p := &Point{}
	if err := p.unmarshalWKB(wkb); err != nil {
		return nil
	}

	return p
}
173262
func (a *AggregationValueMetric) UnmarshalJSON(data []byte) error {
	var aggs map[string]json.RawMessage
	if err := json.Unmarshal(data, &aggs); err != nil {
		return err
	}
	if v, ok := aggs["value"]; ok && v != nil {
		json.Unmarshal(v, &a.Value)
	}
	if v, ok := aggs["meta"]; ok && v != nil {
		json.Unmarshal(v, &a.Meta)
	}
	a.Aggregations = aggs
	return nil
}
444170
func (x *PaymentReconciliation) UnmarshalJSON(data []byte) (err error) {
	x2 := paymentReconciliation{}
	if err = json.Unmarshal(data, &x2); err == nil {
		if x2.Contained != nil {
			for i := range x2.Contained {
				x2.Contained[i] = MapToResource(x2.Contained[i], true)
			}
		}
		*x = PaymentReconciliation(x2)
		return x.checkResourceType()
	}
	return
}
204258
func (a *AggregationGeoCentroidMetric) UnmarshalJSON(data []byte) error {
	var aggs map[string]json.RawMessage
	if err := json.Unmarshal(data, &aggs); err != nil {
		return err
	}
	if v, ok := aggs["location"]; ok && v != nil {
		json.Unmarshal(v, &a.Location)
	}
	if v, ok := aggs["meta"]; ok && v != nil {
		json.Unmarshal(v, &a.Meta)
	}
	if v, ok := aggs["count"]; ok && v != nil {
		json.Unmarshal(v, &a.Count)
	}
	a.Aggregations = aggs
	return nil
}
1323856
func (m Map) UnmarshalText(text []byte) error {
	err := json.Unmarshal(text, &m)
	if err != nil {
		return errors.WithStack(err)
	}
	return nil
}
377307
func (cp *CPUManagerCheckpoint) MarshalCheckpoint() ([]byte, error) {
	// make sure checksum wasn't set before so it doesn't affect output checksum
	cp.Checksum = 0
	cp.Checksum = checksum.New(cp)
	return json.Marshal(*cp)
}
662753
func UnmarshalEnvelope(encoded []byte) (*cb.Envelope, error) {
	envelope := &cb.Envelope{}
	err := proto.Unmarshal(encoded, envelope)
	return envelope, errors.Wrap(err, "error unmarshaling Envelope")
}
56618
func (x *ReferralRequest) UnmarshalJSON(data []byte) (err error) {
	x2 := referralRequest{}
	if err = json.Unmarshal(data, &x2); err == nil {
		if x2.Contained != nil {
			for i := range x2.Contained {
				x2.Contained[i] = MapToResource(x2.Contained[i], true)
			}
		}
		*x = ReferralRequest(x2)
		return x.checkResourceType()
	}
	return
}
267280
func (enc *Encoding) UnmarshalFlag(value string) error {
	switch value {
	case "flickr":
		*enc = *FlickrEncoding
	case "ripple":
		*enc = *RippleEncoding
	case "bitcoin":
		*enc = *BitcoinEncoding
	default:
		return fmt.Errorf("unknown encoding: %s", value)
	}
	return nil
}
9266
func UnmarshalMap(m map[string]*dynamodb.AttributeValue, out interface{}) error {
	return NewDecoder().Decode(&dynamodb.AttributeValue{M: m}, out)
}
610449
func NewPointFromGeoHashInt64(hash int64, bits int) *Point {
	west, east, south, north := geoHashInt2ranges(hash, bits)
	return NewPoint((west+east)/2.0, (north+south)/2.0)
}
1217822
func (l *Line) UnmarshalJSON(data []byte) error {
	var points [][2]float64

	err := json.Unmarshal(data, &points)
	if err != nil {
		return err
	}

	if len(points) > 2 {
		return errors.New("geo: too many points to unmarshal into line")
	}

	if len(points) < 2 {
		return errors.New("geo: not enough points to unmarshal into line")
	}

	l.a = Point{points[0][0], points[0][1]}
	l.b = Point{points[1][0], points[1][1]}

	return nil
}
724089
func UnmarshalContext(vals map[string]interface{}) context.Context {
	contextUnmarshalFuncsMu.RLock()
	defer contextUnmarshalFuncsMu.RUnlock()

	ctx := context.Background()
	if vals == nil {
		return ctx
	}

	for _, f := range contextUnmarshalFuncs {
		ctx = f(ctx, vals)
	}

	return ctx
}
283012
func (v *CBGithub) UnmarshalJSON(data []byte) error {
	r := jlexer.Lexer{Data: data}
	easyjsonB0500db0DecodeGithubComFrancoispqtGojayBenchmarks4(&r, v)
	return r.Error()
}
624313
func (v *GeoLocation) UnmarshalJSON(data []byte) error {
	r := jlexer.Lexer{Data: data}
	easyjsonCce3d1beDecodeGithubComMailgunMailgunGoEvents4(&r, v)
	return r.Error()
}
155410
func (e *G1) Unmarshal(m []byte) ([]byte, error) {
	// Each value is a 256-bit number.
	const numBytes = 256 / 8
	if len(m) != 2*numBytes {
		return nil, errors.New("bn256: not enough data")
	}
	// Unmarshal the points and check their caps
	if e.p == nil {
		e.p = newCurvePoint(nil)
	}
	e.p.x.SetBytes(m[0*numBytes : 1*numBytes])
	if e.p.x.Cmp(P) >= 0 {
		return nil, errors.New("bn256: coordinate exceeds modulus")
	}
	e.p.y.SetBytes(m[1*numBytes : 2*numBytes])
	if e.p.y.Cmp(P) >= 0 {
		return nil, errors.New("bn256: coordinate exceeds modulus")
	}
	// Ensure the point is on the curve
	if e.p.x.Sign() == 0 && e.p.y.Sign() == 0 {
		// This is the point at infinity.
		e.p.y.SetInt64(1)
		e.p.z.SetInt64(0)
		e.p.t.SetInt64(0)
	} else {
		e.p.z.SetInt64(1)
		e.p.t.SetInt64(1)

		if !e.p.IsOnCurve() {
			return nil, errors.New("bn256: malformed point")
		}
	}
	return m[2*numBytes:], nil
}