// NewHistorical returns a new HistoricalWeatherData pointer with
//the supplied arguments.
9439
func NewHistorical(unit, key string, options ...Option) (*HistoricalWeatherData, error) {
	h := &HistoricalWeatherData{
		Settings: NewSettings(),
	}

	unitChoice := strings.ToUpper(unit)
	if !ValidDataUnit(unitChoice) {
		return nil, errUnitUnavailable
	}
	h.Unit = DataUnits[unitChoice]

	var err error
	h.Key, err = setKey(key)
	if err != nil {
		return nil, err
	}

	if err := setOptions(h.Settings, options); err != nil {
		return nil, err
	}
	return h, nil
}
1355769
func NewHistory(author, comment, createdBy string, isEmptyLayer bool) History {
	return History{
		Author:     author,
		Created:    time.Now().UTC(),
		CreatedBy:  createdBy,
		Comment:    comment,
		EmptyLayer: isEmptyLayer,
	}
}
899285
func AllHistoryKind() map[HistoryKind]string {
	return map[HistoryKind]string{
		KindUnit:              "statuses for specified unit and its workload",
		KindUnitAgent:         "statuses from the agent that is managing a unit",
		KindWorkload:          "statuses for unit's workload",
		KindMachineInstance:   "statuses that occur due to provisioning of a machine",
		KindMachine:           "status of the agent that is managing a machine",
		KindContainerInstance: "statuses from the agent that is managing containers",
		KindContainer:         "statuses from the containers only and not their host machines",
	}
}
46836
func (u *Unit) WorkloadVersionHistory() *HistoryGetter {
	return &HistoryGetter{st: u.st, globalKey: u.globalWorkloadVersionKey()}
}
588616
func (cw *CloudWatch) NewHistogram(name string) metrics.Histogram {
	return convert.NewCounterAsHistogram(cw.NewCounter(name))
}
256675
func (p *statsdProvider) NewHistogram(name string, _ int) metrics.Histogram {
	return p.s.NewTiming(name, 1.0)
}
116626
func (c *Page) NavigateToHistoryEntry(entryId int) (*gcdmessage.ChromeResponse, error) {
	var v PageNavigateToHistoryEntryParams
	v.EntryId = entryId
	return c.NavigateToHistoryEntryWithParams(&v)
}
376589
func NewFakeHistory(informer appsinformers.ControllerRevisionInformer) Interface {
	return &fakeHistory{informer.Informer().GetIndexer(), informer.Lister()}
}
335956
func (p *influxProvider) NewHistogram(name string, buckets int) metrics.Histogram {
	return p.in.NewHistogram(name)
}
269488
func (h *History) Newer(buf *Buffer) (new *Buffer, changed bool) {
	if h.selected >= len(h.tmp)-1 {
		return buf, false
	}
	h.tmp[h.selected] = buf.Text()

	h.selected++
	new = NewBuffer()
	new.InsertText(h.tmp[h.selected], false, true)
	return new, true
}
1154821
func (cw *CloudWatch) NewHistogram(name string) metrics.Histogram {
	return &Histogram{
		name: name,
		obs:  cw.histograms.Observe,
	}
}
1165045
func NewUserHistory(log logger.Logger, vlog *libkb.VDebugLog) *UserHistory {
	return &UserHistory{
		histories: make(map[tlfKey]writersByRevision),
		log:       log,
		vlog:      vlog,
	}
}
1036563
func NewHistogramFrom(opts prometheus.HistogramOpts, labelNames []string) *Histogram {
	hv := prometheus.NewHistogramVec(opts, labelNames)
	prometheus.MustRegister(hv)
	return NewHistogram(hv)
}
627086
func (h *DeploymentHistoryViewer) History(namespace, name string) (HistoryInfo, error) {
	historyInfo := HistoryInfo{
		RevisionToTemplate: make(map[int64]*api.PodTemplateSpec),
	}
	deployment, err := h.c.Extensions().Deployments(namespace).Get(name)
	if err != nil {
		return historyInfo, fmt.Errorf("failed to retrieve deployment %s: %v", name, err)
	}
	_, allOldRSs, err := deploymentutil.GetOldReplicaSets(*deployment, h.c)
	if err != nil {
		return historyInfo, fmt.Errorf("failed to retrieve old replica sets from deployment %s: %v", name, err)
	}
	newRS, err := deploymentutil.GetNewReplicaSet(*deployment, h.c)
	if err != nil {
		return historyInfo, fmt.Errorf("failed to retrieve new replica set from deployment %s: %v", name, err)
	}
	allRSs := append(allOldRSs, newRS)
	for _, rs := range allRSs {
		v, err := deploymentutil.Revision(rs)
		if err != nil {
			continue
		}
		historyInfo.RevisionToTemplate[v] = rs.Spec.Template
		changeCause := getChangeCause(rs)
		if historyInfo.RevisionToTemplate[v].Annotations == nil {
			historyInfo.RevisionToTemplate[v].Annotations = make(map[string]string)
		}
		historyInfo.RevisionToTemplate[v].Annotations[ChangeCauseAnnotation] = changeCause
	}
	return historyInfo, nil
}
520843
func AddHistory(s string) {
	n := HistorySize()
	if n == 0 || s != GetHistory(n-1) {
		C.add_history(C.CString(s))
	}
}
240629
func (e *JSONEncoder) EncodeHistoryRemove(res *HistoryRemoveResult) ([]byte, error) {
	return json.Marshal(res)
}
787260
func parseHistorical(data [][]string) ([]PriceH, error) {
	// This is the list of prices with allocated space. Length of space should
	// subtracted by 1 because the first row of data is title.
	var list = make([]PriceH, len(data)-1)
	// We need to leave the first row, because it contains title of columns.
	for k, v := range data {
		if k == 0 {
			continue
		}
		// Parse row of data into PriceH type and append it to collection of prices.
		p, err := parseHistoricalRow(v)
		if err != nil {
			return list, err
		}

		// (k - 1) because we remove header from the list so index should be
		// reduced by one.
		list[k-1] = p
	}
	return list, nil
}