// AddDataPair is a convenience method which wrapps around AddData: It adds the points
// (x[n],y[n]) to the chart.
424080
func (c *ScatterChart) AddDataPair(name string, x, y []float64, plotstyle PlotStyle, style Style) {
	n := imin(len(x), len(y))
	data := make([]EPoint, n)
	nan := math.NaN()
	for i := 0; i < n; i++ {
		data[i] = EPoint{X: x[i], Y: y[i], DeltaX: nan, DeltaY: nan}
	}
	c.AddData(name, data, plotstyle, style)
}
169423
func (g *Gauge) Add(delta float64) {
	g.add(g.name, lv.LabelValues{}, delta)
}
1286733
func (pm *pointerMap) addPointer(ptr uintptr) bool {
	// Is this already known to be reused?
	for _, have := range pm.reusedPointers {
		if ptr == have {
			return true
		}
	}
	// Have we seen it once before?
	for _, seen := range pm.allpointers {
		if ptr == seen {
			// Add it to the register of pointers we have seen more than once
			pm.reusedPointers = append(pm.reusedPointers, ptr)
			return true
		}
	}
	// This pointer was new to us
	pm.allpointers = append(pm.allpointers, ptr)
	return false
}
258398
func (d *Data) Add(key string, value string) {
	d.Values.Add(key, value)
}
728254
func (f *Forwarder) AddDatapoints(ctx context.Context, points []*datapoint.Datapoint) (err error) {
	openConnection := f.pool.Get()
	if openConnection == nil {
		openConnection, err = f.dialer("tcp", f.connectionAddress, f.connectionTimeout)
		if err != nil {
			err = errors.Annotatef(err, "cannot dial %s", f.connectionAddress)
			return
		}
	}
	defer func() {
		if err == nil {
			f.pool.Return(openConnection)
		} else {
			err = errors.NewMultiErr([]error{err, openConnection.Close()})
		}
	}()

	if err := f.setMinTime(ctx, openConnection); err != nil {
		return err
	}

	points = f.FilterDatapoints(points)
	if len(points) == 0 {
		return nil
	}

	var buf bytes.Buffer
	for _, dp := range points {
		if carbonLine, exists := NativeCarbonLine(dp); exists {
			_, err = fmt.Fprintf(&buf, "%s\n", carbonLine)
			errors.PanicIfErr(err, "buffer writes should not error out")
			continue
		}
		_, err = fmt.Fprintf(&buf, "%s %s %d\n", f.datapointToGraphite(dp),
			dp.Value,
			dp.Timestamp.UnixNano()/time.Second.Nanoseconds())
		errors.PanicIfErr(err, "buffer writes should not error out")
	}
	_, err = buf.WriteTo(openConnection)
	if err != nil {
		return errors.Annotate(err, "cannot fully write buf to carbon connection")
	}
	return nil
}
1174029
func (h *HTTPSink) AddDatapoints(ctx context.Context, points []*datapoint.Datapoint) (err error) {
	if len(points) == 0 || h.DatapointEndpoint == "" {
		return nil
	}
	return h.doBottom(ctx, func() (io.Reader, bool, error) {
		return h.encodePostBodyProtobufV2(points)
	}, "application/x-protobuf", h.DatapointEndpoint, datapointAndEventResponseValidator)
}
1338489
func (calc *PointCentroidCalculator) AddPoint(point *geom.Point) {
	calc.AddCoord(geom.Coord(point.FlatCoords()))
}
634850
func (j *Job) AddDatacenter(dc string) *Job {
	j.Datacenters = append(j.Datacenters, dc)
	return j
}
597467
func NewPatchEndpointIDLabels(ctx *middleware.Context, handler PatchEndpointIDLabelsHandler) *PatchEndpointIDLabels {
	return &PatchEndpointIDLabels{Context: ctx, Handler: handler}
}
197592
func (p *queryPlan) addSpecifiedData(ctx context.Context, r table.Row, cls *semantic.GraphClause, lo *storage.LookupOptions) error {
	if cls.S == nil {
		v := getBoundValueForComponent(r, []string{cls.SBinding, cls.SAlias})
		if v != nil {
			if v.N != nil {
				cls.S = v.N
			}
		}
	}
	if cls.P == nil && cls.PID != "" && cls.PAnchorBinding != "" {
		v := r[cls.PAnchorBinding]
		if v != nil && v.T != nil {
			p, err := predicate.NewTemporal(cls.PID, *v.T)
			if err != nil {
				return err
			}
			cls.P = p
		}
	}
	if cls.P == nil {
		v := getBoundValueForComponent(r, []string{cls.PBinding, cls.PAlias})
		if v != nil {
			if v.P != nil {
				cls.P = v.P
			}
		}
		nlo, err := updateTimeBoundsForRow(lo, cls, r)
		if err != nil {
			return err
		}
		lo = nlo
	}
	if cls.O == nil && cls.OID != "" && cls.OAnchorBinding != "" {
		v := r[cls.OAnchorBinding]
		if v != nil && v.T != nil {
			p, err := predicate.NewTemporal(cls.OID, *v.T)
			if err != nil {
				return err
			}
			cls.O = triple.NewPredicateObject(p)
		}
	}
	if cls.O == nil {
		v := getBoundValueForComponent(r, []string{cls.OBinding, cls.OAlias})
		if v != nil {
			o, err := cellToObject(v)
			if err == nil {
				cls.O = o
			}
		}
		nlo, err := updateTimeBoundsForRow(lo, cls, r)
		if err != nil {
			return err
		}
		lo = nlo
	}

	tracer.Trace(p.tracer, func() []string {
		cls := *cls
		return []string{fmt.Sprintf("Corrected clause: %v", &cls)}
	})

	stmLimit := int64(0)
	if len(p.stm.GraphPatternClauses()) == 1 && len(p.stm.GroupBy()) == 0 && len(p.stm.HavingExpression()) == 0 {
		stmLimit = p.stm.Limit()
	}
	tbl, err := simpleFetch(ctx, p.grfs, cls, lo, stmLimit, p.chanSize, p.tracer)
	if err != nil {
		return err
	}
	p.tbl.AddBindings(tbl.Bindings())
	for _, nr := range tbl.Rows() {
		p.tbl.AddRow(table.MergeRows([]table.Row{r, nr}))
	}
	return nil
}
142880
func (t *Table) AppendData(rec map[string]interface{}) *Table {
	t.Data = append(t.Data, rec)
	return t
}
1172486
func AttachRequestData(ctx context.Context, r *http.Request) context.Context {
	return context.WithValue(ctx, requestContextKey, r)
}
158740
func (p *Plot) Add(plotters ...Plotter) *Plot {
	for _, plotter := range plotters {
		plotter.Apply(p)
	}
	return p
}
3087
func NewDataPlacementRestrictionSatisfyPolicyDetails(PlacementRestriction *PlacementRestriction) *DataPlacementRestrictionSatisfyPolicyDetails {
	s := new(DataPlacementRestrictionSatisfyPolicyDetails)
	s.PlacementRestriction = PlacementRestriction
	return s
}
22160
func (a *AsyncMultiTokenSink) AddDatapoints(ctx context.Context, datapoints []*datapoint.Datapoint) (err error) {
	if token := ctx.Value(TokenCtxKey); token != nil {
		err = a.AddDatapointsWithToken(token.(string), datapoints)
	} else {
		err = fmt.Errorf("no value was found on the context with key '%s'", TokenCtxKey)
	}
	return
}
34397
func (c *Counter) AddDatapoints(ctx context.Context, points []*datapoint.Datapoint, next Sink) error {
	atomic.AddInt64(&c.TotalDatapoints, int64(len(points)))
	atomic.AddInt64(&c.TotalProcessCalls, 1)
	atomic.AddInt64(&c.CallsInFlight, 1)
	start := time.Now()
	err := next.AddDatapoints(ctx, points)
	atomic.AddInt64(&c.TotalProcessTimeNs, time.Since(start).Nanoseconds())
	atomic.AddInt64(&c.CallsInFlight, -1)
	if err != nil {
		atomic.AddInt64(&c.TotalProcessErrors, 1)
		atomic.AddInt64(&c.ProcessErrorPoints, int64(len(points)))
		c.logErrMsg(ctx, err, "Unable to process datapoints")
	}
	return err
}
270033
func (c *HeapProfiler) AddInspectedHeapObject(heapObjectId string) (*gcdmessage.ChromeResponse, error) {
	var v HeapProfilerAddInspectedHeapObjectParams
	v.HeapObjectId = heapObjectId
	return c.AddInspectedHeapObjectWithParams(&v)
}