// UnitsToPointsVar converts the units to the documents unit type for all variables passed in
503563
func (gp *GoPdf) UnitsToPointsVar(u ...*float64) {
	UnitsToPointsVar(gp.config.Unit, u...)
}
54852
func (e *Element) Dimensions() ([]float64, error) {
	var points []float64
	e.lock.RLock()

	params := &gcdapi.DOMGetBoxModelParams{
		NodeId: e.id,
	}
	box, err := e.tab.DOM.GetBoxModelWithParams(params)

	e.lock.RUnlock()

	if err != nil {
		return nil, err
	}
	points = box.Content
	return points, nil
}
1360653
func TabletTypeListVar(p *[]topodatapb.TabletType, name string, usage string) {
	flag.Var((*TabletTypeListValue)(p), name, usage)
}
769019
func (term *Term) Vars() VarSet {
	vis := &VarVisitor{vars: VarSet{}}
	Walk(vis, term)
	return vis.vars
}
1060839
func (t *TemplateResource) setVars() error {
	var err error
	log.Debug("Retrieving keys from store")
	log.Debug("Key prefix set to " + t.Prefix)

	result, err := t.storeClient.GetValues(util.AppendPrefix(t.Prefix, t.Keys))
	if err != nil {
		return err
	}
	log.Debug("Got the following map from store: %v", result)

	t.store.Purge()

	for k, v := range result {
		t.store.Set(path.Join("/", strings.TrimPrefix(k, t.Prefix)), v)
	}
	return nil
}
680893
func (fs *FlagSet) UintVar(p *uint, names []string, value uint, usage string) {
	fs.Var(newUintValue(value, p), names, usage)
}
417832
func convertRowHeightToPixels(height float64) float64 {
	var pixels float64
	if height == 0 {
		return pixels
	}
	pixels = math.Ceil(4.0 / 3.0 * height)
	return pixels
}
228159
func ToPages(seq interface{}) (Pages, error) {
	if seq == nil {
		return Pages{}, nil
	}

	switch v := seq.(type) {
	case Pages:
		return v, nil
	case *Pages:
		return *(v), nil
	case WeightedPages:
		return v.Pages(), nil
	case PageGroup:
		return v.Pages, nil
	case []interface{}:
		pages := make(Pages, len(v))
		success := true
		for i, vv := range v {
			p, ok := vv.(Page)
			if !ok {
				success = false
				break
			}
			pages[i] = p
		}
		if success {
			return pages, nil
		}
	}

	return nil, fmt.Errorf("cannot convert type %T to Pages", seq)
}
514652
func (s *session) GetAllSysVars() (map[string]string, error) {
	if s.Value(sessionctx.Initing) != nil {
		return nil, nil
	}
	sql := `SELECT VARIABLE_NAME, VARIABLE_VALUE FROM %s.%s;`
	sql = fmt.Sprintf(sql, mysql.SystemDB, mysql.GlobalVariablesTable)
	rows, _, err := s.ExecRestrictedSQL(s, sql)
	if err != nil {
		return nil, err
	}
	ret := make(map[string]string)
	for _, r := range rows {
		k, v := r.GetString(0), r.GetString(1)
		ret[k] = v
	}
	return ret, nil
}
1212650
func (gp *GoPdf) PointsToUnitsVar(u ...*float64) {
	PointsToUnitsVar(gp.config.Unit, u...)
}
402765
func ConvertUnitsString(val string, from Unit, to Unit) (float64, error) {
	floatValue, err := strconv.ParseFloat(val, 64)
	if err != nil {
		return 0, err
	}
	return ConvertUnits(floatValue, from, to), nil
}
1226708
func NewServerVariables(in interface{}, context *compiler.Context) (*ServerVariables, error) {
	errors := make([]error, 0)
	x := &ServerVariables{}
	m, ok := compiler.UnpackMap(in)
	if !ok {
		message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in)
		errors = append(errors, compiler.NewError(context, message))
	} else {
		// repeated NamedServerVariable additional_properties = 1;
		// MAP: ServerVariable
		x.AdditionalProperties = make([]*NamedServerVariable, 0)
		for _, item := range m {
			k, ok := compiler.StringValue(item.Key)
			if ok {
				v := item.Value
				pair := &NamedServerVariable{}
				pair.Name = k
				var err error
				pair.Value, err = NewServerVariable(v, compiler.NewContext(k, context))
				if err != nil {
					errors = append(errors, err)
				}
				x.AdditionalProperties = append(x.AdditionalProperties, pair)
			}
		}
	}
	return x, compiler.NewErrorGroupOrNil(errors)
}
282270
func ValuesToPoints(values map[string][]Value) []models.Point {
	points := make([]models.Point, 0, len(values))
	for composite, vals := range values {
		series, field := SeriesAndFieldFromCompositeKey([]byte(composite))
		strField := string(field)
		for _, val := range vals {
			t := time.Unix(0, val.UnixNano())
			fields := models.Fields{strField: val.Value()}
			points = append(points, models.NewPointFromSeries(series, fields, t))
		}
	}
	return points
}
1126566
func GetStatusVars() (map[string]*StatusVal, error) {
	statusVars := make(map[string]*StatusVal)

	for _, statistics := range statisticsList {
		vals, err := statistics.Stats()
		if err != nil {
			return nil, errors.Trace(err)
		}

		for name, val := range vals {
			scope := statistics.GetScope(name)
			statusVars[name] = &StatusVal{Value: val, Scope: scope}
		}
	}

	return statusVars, nil
}
347038
func (gp *GoPdf) PointsToUnits(u float64) float64 {
	return PointsToUnits(gp.config.Unit, u)
}
1014778
func IntVar(p *int, name string, value int, usage string) {
	CommandLine.Var(newIntValue(value, p), name, usage)
}
590184
func evalPoints(f Function, fromX, toX float64, count int) Points {
	interval := (toX - fromX) / float64(count)
	ps := NewPoints()
	for x := fromX; x < toX; x += interval {
		y := f.Eval(x)
		ps = append(ps, NewPoint(x, y))
	}
	return ps
}