// GetBareMetalPlans returns a list of all available bare metal plans on Vultr account.
13503
func (c *Client) GetBareMetalPlans() ([]BareMetalPlan, error) {
	var bareMetalPlanMap map[string]BareMetalPlan
	if err := c.get(`plans/list_baremetal`, &bareMetalPlanMap); err != nil {
		return nil, err
	}

	var b bareMetalPlans
	for _, bareMetalPlan := range bareMetalPlanMap {
		b = append(b, bareMetalPlan)
	}

	sort.Sort(bareMetalPlans(b))
	return b, nil
}
62676
func (p *PageStats) GetTotalPages() int {
	if p == nil || p.TotalPages == nil {
		return 0
	}
	return *p.TotalPages
}
479608
func (t *Template) GetAllAWSAutoScalingPlansScalingPlanResources() map[string]*resources.AWSAutoScalingPlansScalingPlan {
	results := map[string]*resources.AWSAutoScalingPlansScalingPlan{}
	for name, untyped := range t.Resources {
		switch resource := untyped.(type) {
		case *resources.AWSAutoScalingPlansScalingPlan:
			results[name] = resource
		}
	}
	return results
}
854286
func (c *Client) GetAllScheduledMaintenances() (ScheduledMaintenancesResponse, error) {
	s := ScheduledMaintenancesResponse{}
	err := c.request("api/v2/scheduled-maintenances.json", &s)
	return s, err
}
1206605
func (t *Template) GetAllAWSServiceCatalogLaunchTemplateConstraintResources() map[string]*resources.AWSServiceCatalogLaunchTemplateConstraint {
	results := map[string]*resources.AWSServiceCatalogLaunchTemplateConstraint{}
	for name, untyped := range t.Resources {
		switch resource := untyped.(type) {
		case *resources.AWSServiceCatalogLaunchTemplateConstraint:
			results[name] = resource
		}
	}
	return results
}
236874
func (self *KubeletClient) GetAllRawContainers(host Host, start, end time.Time) ([]cadvisor.ContainerInfo, error) {
	url := self.getUrl(host, "/stats/container/")

	return self.getAllContainers(url, start, end)
}
57619
func (s *BaremetalService) NotifyBaremetalProvisionDone(p *NotifyBaremetalProvisionDoneParams) (*NotifyBaremetalProvisionDoneResponse, error) {
	resp, err := s.cs.newRequest("notifyBaremetalProvisionDone", p.toURLValues())
	if err != nil {
		return nil, err
	}

	var r NotifyBaremetalProvisionDoneResponse
	if err := json.Unmarshal(resp, &r); err != nil {
		return nil, err
	}

	// If we have a async client, we need to wait for the async result
	if s.cs.async {
		b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout)
		if err != nil {
			if err == AsyncTimeoutErr {
				return &r, err
			}
			return nil, err
		}

		if err := json.Unmarshal(b, &r); err != nil {
			return nil, err
		}
	}

	return &r, nil
}
383282
func (api *API) GetBaremetalModel(bm_id string) (*BaremetalModel, error) {
	res := new(BaremetalModel)
	url := createUrl(api, serverPathSegment, baremetalSegment, bm_id)
	err := api.Client.Get(url, &res, http.StatusOK)
	if err != nil {
		return nil, err
	}
	//	res.api = api
	return res, nil
}
364669
func GenericBars(bg BasicGraphics, bars []Barinfo, style Style) {
	for _, b := range bars {
		bg.Rect(b.x, b.y, b.w, b.h, style)
		if b.t != "" {
			var tx, ty int
			var a string
			_, fh, _ := bg.FontMetrics(b.f)
			if fh > 1 {
				fh /= 2
			}
			switch b.tp {
			case "ot":
				tx, ty, a = b.x+b.w/2, b.y-fh, "bc"
			case "it":
				tx, ty, a = b.x+b.w/2, b.y+fh, "tc"
			case "ib":
				tx, ty, a = b.x+b.w/2, b.y+b.h-fh, "bc"
			case "ob":
				tx, ty, a = b.x+b.w/2, b.y+b.h+fh, "tc"
			case "ol":
				tx, ty, a = b.x-fh, b.y+b.h/2, "cr"
			case "il":
				tx, ty, a = b.x+fh, b.y+b.h/2, "cl"
			case "or":
				tx, ty, a = b.x+b.w+fh, b.y+b.h/2, "cl"
			case "ir":
				tx, ty, a = b.x+b.w-fh, b.y+b.h/2, "cr"
			default:
				tx, ty, a = b.x+b.w/2, b.y+b.h/2, "cc"

			}

			bg.Text(tx, ty, b.t, a, 0, b.f)
		}
	}
}
587409
func (m *MarketplacePlan) GetBullets() []string {
	if m == nil || m.Bullets == nil {
		return nil
	}
	return *m.Bullets
}
591424
func (s *BaremetalService) ListBaremetalPxeServers(p *ListBaremetalPxeServersParams) (*ListBaremetalPxeServersResponse, error) {
	resp, err := s.cs.newRequest("listBaremetalPxeServers", p.toURLValues())
	if err != nil {
		return nil, err
	}

	var r ListBaremetalPxeServersResponse
	if err := json.Unmarshal(resp, &r); err != nil {
		return nil, err
	}

	return &r, nil
}
1085127
func (qe *QueryEngine) GetPlan(ctx context.Context, logStats *tabletenv.LogStats, sql string, skipQueryPlanCache bool) (*TabletPlan, error) {
	span, ctx := trace.NewSpan(ctx, "QueryEngine.GetPlan")
	defer span.Finish()

	if plan := qe.getQuery(sql); plan != nil {
		return plan, nil
	}

	// Obtain read lock to prevent schema from changing while
	// we build a plan. The read lock allows multiple identical
	// queries to build the same plan. One of them will win by
	// updating the query cache and prevent future races. Due to
	// this, query stats reporting may not be accurate, but it's
	// acceptable because those numbers are best effort.
	qe.mu.RLock()
	defer qe.mu.RUnlock()
	statement, err := sqlparser.Parse(sql)
	if err != nil {
		return nil, err
	}
	splan, err := planbuilder.Build(statement, qe.tables)
	if err != nil {
		return nil, err
	}
	plan := &TabletPlan{Plan: splan}
	plan.Rules = qe.queryRuleSources.FilterByPlan(sql, plan.PlanID, plan.TableName().String())
	plan.buildAuthorized()
	if plan.PlanID.IsSelect() {
		if plan.FieldQuery != nil {
			conn, err := qe.getQueryConn(ctx)
			if err != nil {
				return nil, err
			}
			defer conn.Recycle()

			sql := plan.FieldQuery.Query
			start := time.Now()
			r, err := conn.Exec(ctx, sql, 1, true)
			logStats.AddRewrittenSQL(sql, start)
			if err != nil {
				return nil, err
			}
			plan.Fields = r.Fields
		}
	} else if plan.PlanID == planbuilder.PlanDDL || plan.PlanID == planbuilder.PlanSet {
		return plan, nil
	}
	if !skipQueryPlanCache && !sqlparser.SkipQueryPlanCacheDirective(statement) {
		qe.plans.Set(sql, plan)
	}
	return plan, nil
}
677738
func (o *DomainTemplate) PolicyGroupTemplates(info *bambou.FetchingInfo) (PolicyGroupTemplatesList, *bambou.Error) {

	var list PolicyGroupTemplatesList
	err := bambou.CurrentSession().FetchChildren(o, PolicyGroupTemplateIdentity, &list, info)
	return list, err
}
615572
func (r *RepoStats) GetTotalPushes() int {
	if r == nil || r.TotalPushes == nil {
		return 0
	}
	return *r.TotalPushes
}
333324
func (t *Template) GetAllAWSEMRStepResources() map[string]*resources.AWSEMRStep {
	results := map[string]*resources.AWSEMRStep{}
	for name, untyped := range t.Resources {
		switch resource := untyped.(type) {
		case *resources.AWSEMRStep:
			results[name] = resource
		}
	}
	return results
}
239729
func (e *AzureMonitorDatasource) findClosestAllowedIntervalMS(intervalMs int64) int64 {
	closest := allowedIntervalsMS[0]

	for i, allowed := range allowedIntervalsMS {
		if intervalMs > allowed {
			if i+1 < len(allowedIntervalsMS) {
				closest = allowedIntervalsMS[i+1]
			} else {
				closest = allowed
			}
		}
	}
	return closest
}
937887
func (t *Template) GetAllAWSEMRInstanceFleetConfigResources() map[string]*resources.AWSEMRInstanceFleetConfig {
	results := map[string]*resources.AWSEMRInstanceFleetConfig{}
	for name, untyped := range t.Resources {
		switch resource := untyped.(type) {
		case *resources.AWSEMRInstanceFleetConfig:
			results[name] = resource
		}
	}
	return results
}