// GetLastValues computes the last moving average value but walking back window size samples,
// and recomputing the last moving average chunk.
510994
func (ema *EMASeries) GetLastValues() (x, y float64) {
	if ema.InnerSeries == nil {
		return
	}
	if len(ema.cache) == 0 {
		ema.ensureCachedValues()
	}
	lastIndex := ema.InnerSeries.Len() - 1
	x, _ = ema.InnerSeries.GetValues(lastIndex)
	y = ema.cache[lastIndex]
	return
}
1326502
func GetLastFrame(frames errors.StackTrace) FrameInfo {
	if len(frames) == 0 {
		return FrameInfo{}
	}
	pc := uintptr(frames[0]) - 1
	fn := runtime.FuncForPC(pc)
	if fn == nil {
		return FrameInfo{Func: fmt.Sprintf("unknown func at %v", pc)}
	}
	filePath, lineNo := fn.FileLine(pc)
	return FrameInfo{
		CallStack: GetCallStack(frames),
		Func:      FuncName(fn),
		File:      filePath,
		LineNo:    lineNo,
	}
}
49769
func (ts TimeSeries) GetValues(index int) (x, y float64) {
	x = util.Time.ToFloat64(ts.XValues[index])
	y = ts.YValues[index]
	return
}
407290
func (dbMan *dbManager) getLastSequence() (lastSequence string) {

	err := dbMan.getDB().QueryRow("select last_sequence from EDGEX_APID_CLUSTER LIMIT 1").Scan(&lastSequence)
	if err != nil && err != sql.ErrNoRows {
		log.Panicf("Failed to query EDGEX_APID_CLUSTER: %v", err)
		return
	}

	log.Debugf("lastSequence: %s", lastSequence)
	return
}
614610
func (_class VMSSClass) GetLastRunTime(sessionID SessionRef, self VMSSRef) (_retval time.Time, _err error) {
	_method := "VMSS.get_last_run_time"
	_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
	if _err != nil {
		return
	}
	_selfArg, _err := convertVMSSRefToXen(fmt.Sprintf("%s(%s)", _method, "self"), self)
	if _err != nil {
		return
	}
	_result, _err := _class.client.APICall(_method, _sessionIDArg, _selfArg)
	if _err != nil {
		return
	}
	_retval, _err = convertTimeToGo(_method + " -> ", _result.Value)
	return
}
691677
func (prs *PolynomialRegressionSeries) GetValues(index int) (x, y float64) {
	if prs.InnerSeries == nil || prs.InnerSeries.Len() == 0 {
		return
	}

	if prs.coeffs == nil {
		coeffs, err := prs.computeCoefficients()
		if err != nil {
			panic(err)
		}
		prs.coeffs = coeffs
	}

	offset := prs.GetOffset()
	effectiveIndex := util.Math.MinInt(index+offset, prs.InnerSeries.Len())
	x, y = prs.InnerSeries.GetValues(effectiveIndex)
	y = prs.apply(x)
	return
}
831793
func (cs ContinuousSeries) GetValues(index int) (float64, float64) {
	return cs.XValues[index], cs.YValues[index]
}
52920
func (tc *TabletStatsCache) GetAggregateStats(target *querypb.Target) (*querypb.AggregateStats, error) {
	e := tc.getEntry(target.Keyspace, target.Shard, target.TabletType)
	if e == nil {
		return nil, topo.NewError(topo.NoNode, topotools.TargetIdent(target))
	}

	e.mu.RLock()
	defer e.mu.RUnlock()
	if target.TabletType == topodatapb.TabletType_MASTER {
		if len(e.aggregates) == 0 {
			return nil, topo.NewError(topo.NoNode, topotools.TargetIdent(target))
		}
		for _, agg := range e.aggregates {
			return agg, nil
		}
	}
	targetAlias := tc.getAliasByCell(target.Cell)
	agg, ok := e.aggregates[targetAlias]
	if !ok {
		return nil, topo.NewError(topo.NoNode, topotools.TargetIdent(target))
	}
	return agg, nil
}
267832
func (prs *PolynomialRegressionSeries) GetFirstValues() (x, y float64) {
	if prs.InnerSeries == nil || prs.InnerSeries.Len() == 0 {
		return
	}
	if prs.coeffs == nil {
		coeffs, err := prs.computeCoefficients()
		if err != nil {
			panic(err)
		}
		prs.coeffs = coeffs
	}
	x, y = prs.InnerSeries.GetValues(0)
	y = prs.apply(x)
	return
}
804229
func LastIndex(s T, val interface{}) int {
	rs := reflectSlice(s)
	if vt := reflect.TypeOf(val); rs.Type().Elem() != vt {
		// TODO: Better "<seq> is not a sequence of <val>".
		panic(&generic.TypeError{rs.Type(), vt, "cannot find"})
	}

	for i := rs.Len() - 1; i >= 0; i-- {
		if rs.Index(i).Interface() == val {
			return i
		}
	}
	return -1
}
279500
func (c *Client) GetValues(keys []string) (map[string]string, error) {
	allEnvVars := os.Environ()
	envMap := make(map[string]string)
	for _, e := range allEnvVars {
		index := strings.Index(e, "=")
		envMap[e[:index]] = e[index+1:]
	}
	vars := make(map[string]string)
	for _, key := range keys {
		k := transform(key)
		for envKey, envValue := range envMap {
			if strings.HasPrefix(envKey, k) {
				vars[clean(envKey)] = envValue
			}
		}
	}

	log.Debug(fmt.Sprintf("Key Map: %#v", vars))

	return vars, nil
}
931425
func GetLastSplit(src, separator string) string {
	split := strings.Split(src, separator)
	return split[len(split)-1]
}
1072257
func (_class VMMetricsClass) GetLastUpdated(sessionID SessionRef, self VMMetricsRef) (_retval time.Time, _err error) {
	_method := "VM_metrics.get_last_updated"
	_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
	if _err != nil {
		return
	}
	_selfArg, _err := convertVMMetricsRefToXen(fmt.Sprintf("%s(%s)", _method, "self"), self)
	if _err != nil {
		return
	}
	_result, _err := _class.client.APICall(_method, _sessionIDArg, _selfArg)
	if _err != nil {
		return
	}
	_retval, _err = convertTimeToGo(_method + " -> ", _result.Value)
	return
}
625424
func (lrs *LinearRegressionSeries) GetValues(index int) (x, y float64) {
	if lrs.InnerSeries == nil || lrs.InnerSeries.Len() == 0 {
		return
	}
	if lrs.IsZero() {
		lrs.computeCoefficients()
	}
	offset := lrs.GetOffset()
	effectiveIndex := util.Math.MinInt(index+offset, lrs.InnerSeries.Len())
	x, y = lrs.InnerSeries.GetValues(effectiveIndex)
	y = (lrs.m * lrs.normalize(x)) + lrs.b
	return
}
274317
func (tag *Tag) GetLastFrame(id string) Framer {
	// Avoid an allocation of slice in GetFrames,
	// if there is anyway one frame.
	if f, exists := tag.frames[id]; exists {
		return f
	}

	fs := tag.GetFrames(id)
	if len(fs) == 0 {
		return nil
	}
	return fs[len(fs)-1]
}
893648
func (_class VMGuestMetricsClass) GetLastUpdated(sessionID SessionRef, self VMGuestMetricsRef) (_retval time.Time, _err error) {
	_method := "VM_guest_metrics.get_last_updated"
	_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
	if _err != nil {
		return
	}
	_selfArg, _err := convertVMGuestMetricsRefToXen(fmt.Sprintf("%s(%s)", _method, "self"), self)
	if _err != nil {
		return
	}
	_result, _err := _class.client.APICall(_method, _sessionIDArg, _selfArg)
	if _err != nil {
		return
	}
	_retval, _err = convertTimeToGo(_method + " -> ", _result.Value)
	return
}
1302573
func (c *Client) GetValues(keys []string) (map[string]string, error) {
	vars := make(map[string]string)
	var err error
	for _, key := range keys {
		log.Debug("Processing key=%s", key)
		var resp map[string]string
		resp, err = c.getParametersWithPrefix(key)
		if err != nil {
			return vars, err
		}
		if len(resp) == 0 {
			resp, err = c.getParameter(key)
			if err != nil && err.(awserr.Error).Code() != ssm.ErrCodeParameterNotFound {
				return vars, err
			}
		}
		for k, v := range resp {
			vars[k] = v
		}
	}
	return vars, nil
}