// Get stock price history for number of years backwards.
344051
func HistoryForYears(symbol string, years int, period string) ([]PriceH, error) {
	var prices []PriceH
	duration := time.Duration(int64(time.Hour) * 24 * 365 * int64(years))
	to := time.Now()
	from := to.Add(-duration)

	data, err := loadHistoricalPrice(symbol, from, to, period)
	if err != nil {
		return prices, err
	}

	prices, err = parseHistorical(data)
	if err != nil {
		return prices, err
	}

	return prices, nil
}
1278521
func (b *buffer) backward() (start bool, err error) {
	if b.pos == b.promptLen {
		return true, nil
	}
	b.pos--

	// If position is on the same line.
	if _, col := b.pos2xy(b.pos); col != 0 {
		if _, err = term.Output.Write(CursorBackward); err != nil {
			return false, outputError(err.Error())
		}
	} else {
		if _, err = term.Output.Write(CursorUp); err != nil {
			return false, outputError(err.Error())
		}
		if _, err = fmt.Fprintf(term.Output, "\033[%dC", b.columns); err != nil {
			return false, outputError(err.Error())
		}
	}
	return
}
319508
func Reverse(in interface{}) interface{} {
	value := reflect.ValueOf(in)
	valueType := value.Type()

	kind := value.Kind()

	if kind == reflect.String {
		return ReverseString(in.(string))
	}

	if kind == reflect.Array || kind == reflect.Slice {
		length := value.Len()

		resultSlice := makeSlice(value, length)

		j := 0
		for i := length - 1; i >= 0; i-- {
			resultSlice.Index(j).Set(value.Index(i))
			j++
		}

		return resultSlice.Interface()
	}

	panic(fmt.Sprintf("Type %s is not supported by Reverse", valueType.String()))
}
86090
func (api *Client) GetIMHistory(channel string, params HistoryParameters) (*History, error) {
	return api.GetIMHistoryContext(context.Background(), channel, params)
}
814360
func (db *StakeDatabase) undoDiff(poolDiff PoolDiff) {
	db.applyDiff(PoolDiff{
		In:  poolDiff.Out,
		Out: poolDiff.In,
	})
}
612685
func (r *Render) backward(from, n int) int {
	return r.move(from, from-n)
}
372680
func (v *VersioningTestV1) GetOldString() (o string) {
	if v != nil && v.OldString != nil {
		return *v.OldString
	}

	return
}
1038185
func (b *Bittrex) GetDepositHistory(currency string) (deposits []Deposit, err error) {
	resource := "account/getdeposithistory"
	if currency != "all" {
		resource += "?currency=" + currency
	}
	r, err := b.client.do("GET", resource, "", true)
	if err != nil {
		return
	}
	var response jsonResponse
	if err = json.Unmarshal(r, &response); err != nil {
		return
	}
	if err = handleErr(response); err != nil {
		return
	}
	err = json.Unmarshal(response.Result, &deposits)
	return
}
976803
func (c *Corpus) ForeachClaimBack(value blob.Ref, at time.Time, fn func(*camtypes.Claim) bool) {
	for _, cl := range c.claimBack[value] {
		if !at.IsZero() && cl.Date.After(at) {
			continue
		}
		if !fn(cl) {
			return
		}
	}
}
783040
func (t OrderedTaxonomy) Reverse() OrderedTaxonomy {
	for i, j := 0, len(t)-1; i < j; i, j = i+1, j-1 {
		t[i], t[j] = t[j], t[i]
	}

	return t
}
745713
func GetPrice() Money {
	mu.Lock()
	defer mu.Unlock()

	if pri == nil {
		pri = &Price{}
	}
	return pri
}
684136
func (db *DB) GetBottlesByYears(account int, years []int) ([]BottleModel, error) {
	db.Lock()
	defer db.Unlock()
	bottles, ok := db.bottles[account]
	if !ok {
		return nil, fmt.Errorf("unknown account %d", account)
	}
	var res []BottleModel
	for _, b := range bottles {
		for _, y := range years {
			if y == b.Vintage {
				goto selected
			}
		}
		continue
	selected:
		res = append(res, *b)
	}
	return res, nil
}
344210
func (t *T) Resume() {
	if t.ticker == nil {
		t.ticker = time.NewTicker(t.interval)
	}
}
3476
func (m *MarketplacePlan) GetYearlyPriceInCents() int {
	if m == nil || m.YearlyPriceInCents == nil {
		return 0
	}
	return *m.YearlyPriceInCents
}
933161
func (api *Client) GetGroupHistory(group string, params HistoryParameters) (*History, error) {
	return api.GetGroupHistoryContext(context.Background(), group, params)
}
755615
func (b *Buffer) PeekBack() float64 {
	if b.size == 0 {
		return 0
	}
	if b.tail == 0 {
		return b.array[len(b.array)-1]
	}
	return b.array[b.tail-1]
}
84581
func (r Billing_Info) GetLastBillDate() (resp datatypes.Time, err error) {
	err = r.Session.DoRequest("SoftLayer_Billing_Info", "getLastBillDate", nil, &r.Options, &resp)
	return
}