// EncodePresenceStatsResult ...
19207
func (e *JSONEncoder) EncodePresenceStats(res *PresenceStatsResult) ([]byte, error) {
	return json.Marshal(res)
}
1308122
func (ctx *facadeContext) ModelPresence(modelUUID string) facade.ModelPresence {
	if ctx.r.shared.featureEnabled(feature.OldPresence) {
		// Used in common/presence.go to determine which code path to follow.
		return nil
	}
	return ctx.r.shared.presence.Connections().ForModel(modelUUID)
}
128035
func (p *PilosaKeyMapper) MapResult(field string, res interface{}) (mappedRes interface{}, err error) {
	log.Printf("mapping result: '%#v'", res)
	defer func() {
		log.Printf("mapped result: '%#v'", mappedRes)
	}()
	switch result := res.(type) {
	case uint64:
		// Count
		mappedRes = result
	case []interface{}:
		return p.mapSliceInterfaceResult(field, result)
	case map[string]interface{}:
		// Bitmap/Intersect/Difference/Union
		return p.mapBitmapResult(field, result)
	case bool:
		// SetBit/ClearBit
		mappedRes = result
	default:
		// Range? SetRowAttrs?
		mappedRes = result
	}
	return mappedRes, nil
}
1218103
func EncodeVarint(out io.Writer, n int) error {
	return EncodeUvarint(out, (n<<1)^(n>>31))
}
915047
func (gc *GenericChannelAspect) GetStats() interface{} {
	gc.gcdLock.RLock()
	defer gc.gcdLock.RUnlock()

	var mod bytes.Buffer
	enc := gob.NewEncoder(&mod)
	dec := gob.NewDecoder(&mod)

	err := enc.Encode(gc.Gcd)
	if err != nil {
		return err
	}

	var cpy map[string]GenericChannelData
	err = dec.Decode(&cpy)
	if err != nil {
		return err
	}

	return cpy
}
875875
func (e *JSONEncoder) EncodeInfo(res *InfoResult) ([]byte, error) {
	return json.Marshal(res)
}
230683
func (resp *RequestVoteResponse) Encode(w io.Writer) (int, error) {
	pb := &protobuf.RequestVoteResponse{
		Term:        proto.Uint64(resp.Term),
		VoteGranted: proto.Bool(resp.VoteGranted),
	}

	p, err := proto.Marshal(pb)
	if err != nil {
		return -1, err
	}

	return w.Write(p)
}
1147887
func (c *BotTasksCall) IncludePerformanceStats(includePerformanceStats bool) *BotTasksCall {
	c.urlParams_.Set("include_performance_stats", fmt.Sprint(includePerformanceStats))
	return c
}
372731
func EncodeValue(sc *stmtctx.StatementContext, raw types.Datum) ([]byte, error) {
	var v types.Datum
	err := flatten(sc, raw, &v)
	if err != nil {
		return nil, errors.Trace(err)
	}
	b, err := codec.EncodeValue(sc, nil, v)
	return b, errors.Trace(err)
}
1097145
func EncodeResponse(cached *CachedResponse, writer io.Writer) error {
	return gob.NewEncoder(writer).Encode(cached)
}
330391
func (cf *concatFunction) GetPartialResult(evalCtx *AggEvaluateContext) []types.Datum {
	return []types.Datum{cf.GetResult(evalCtx)}
}
1049620
func Convert_v1_PodStatusResult_To_core_PodStatusResult(in *v1.PodStatusResult, out *core.PodStatusResult, s conversion.Scope) error {
	return autoConvert_v1_PodStatusResult_To_core_PodStatusResult(in, out, s)
}
1137393
func (e *JSONEncoder) EncodeHistory(res *HistoryResult) ([]byte, error) {
	return json.Marshal(res)
}
91408
func extendedPrecisionStats(us []uint64) (ExtendedPrecisionStats, error) {
	if l := len(us); l != 3 {
		return ExtendedPrecisionStats{}, fmt.Errorf("incorrect number of values for XFS extended precision stats: %d", l)
	}

	return ExtendedPrecisionStats{
		FlushBytes: us[0],
		WriteBytes: us[1],
		ReadBytes:  us[2],
	}, nil
}
1068277
func EncodeVarint(x uint32) []byte {
	if x>>7 == 0 {
		return []byte{
			byte(x),
		}
	}

	if x>>14 == 0 {
		return []byte{
			byte(0x80 | x>>7),
			byte(127 & x),
		}
	}

	if x>>21 == 0 {
		return []byte{
			byte(0x80 | x>>14),
			byte(0x80 | x>>7),
			byte(127 & x),
		}
	}

	return []byte{
		byte(0x80 | x>>21),
		byte(0x80 | x>>14),
		byte(0x80 | x>>7),
		byte(127 & x),
	}
}
955449
func (cf *countFunction) GetResult(evalCtx *AggEvaluateContext) (d types.Datum) {
	d.SetInt64(evalCtx.Count)
	return d
}
1019675
func EncodeNopResponse(
	ctx context.Context,
	pub *amqp.Publishing,
	response interface{},
) error {
	return nil
}