// NewDimensions returns a new Dimensions instance
189815
func NewDimensions(Height uint64, Width uint64) *Dimensions {
	s := new(Dimensions)
	s.Height = Height
	s.Width = Width
	return s
}
254912
func (s *CloudWatchAlarmConfiguration) SetDimensions(v []*Dimension) *CloudWatchAlarmConfiguration {
	s.Dimensions = v
	return s
}
453782
func (f *File) adjustColDimensions(xlsx *xlsxWorksheet, col, offset int) {
	for rowIdx := range xlsx.SheetData.Row {
		for colIdx, v := range xlsx.SheetData.Row[rowIdx].C {
			cellCol, cellRow, _ := CellNameToCoordinates(v.R)
			if col <= cellCol {
				if newCol := cellCol + offset; newCol > 0 {
					xlsx.SheetData.Row[rowIdx].C[colIdx].R, _ = CoordinatesToCellName(newCol, cellRow)
				}
			}
		}
	}
}
525788
func (s *ImageStoreService) NewAddImageStoreParams(provider string) *AddImageStoreParams {
	p := &AddImageStoreParams{}
	p.p = make(map[string]interface{})
	p.p["provider"] = provider
	return p
}
303911
func (f *File) adjustRowDimensions(xlsx *xlsxWorksheet, row, offset int) {
	for i, r := range xlsx.SheetData.Row {
		if newRow := r.R + offset; r.R >= row && newRow > 0 {
			f.ajustSingleRowDimensions(&xlsx.SheetData.Row[i], newRow)
		}
	}
}
983819
func BuildDimensions(mTags map[string]string) []*cloudwatch.Dimension {
	const MaxDimensions = 10
	dimensions := make([]*cloudwatch.Dimension, 0, MaxDimensions)

	// This is pretty ugly but we always want to include the "host" tag if it exists.
	if host, ok := mTags["host"]; ok {
		dimensions = append(dimensions, &cloudwatch.Dimension{
			Name:  aws.String("host"),
			Value: aws.String(host),
		})
	}

	var keys []string
	for k := range mTags {
		if k != "host" {
			keys = append(keys, k)
		}
	}
	sort.Strings(keys)

	for _, k := range keys {
		if len(dimensions) >= MaxDimensions {
			break
		}

		value := mTags[k]
		if value == "" {
			continue
		}

		dimensions = append(dimensions, &cloudwatch.Dimension{
			Name:  aws.String(k),
			Value: aws.String(mTags[k]),
		})
	}

	return dimensions
}
848460
func (w *WithDimensions) AddEvents(ctx context.Context, events []*event.Event, next Sink) error {
	return next.AddEvents(ctx, w.appendDimensionsEvents(events))
}
182867
func ListenerDims(name string, typ string) map[string]string {
	return map[string]string{
		"location": "listener",
		"name":     name,
		"type":     typ,
	}
}
482358
func (s *DimensionKeyDescription) SetDimensions(v map[string]*string) *DimensionKeyDescription {
	s.Dimensions = v
	return s
}
461626
func newPodMetricses(c *MetricsV1beta1Client, namespace string) *podMetricses {
	return &podMetricses{
		client: c.RESTClient(),
		ns:     namespace,
	}
}
570843
func (configMgr *ConfigurationManager) AddDimensionInfo(dimensionInfo string) (map[string]string, error) {
	config := make(map[string]string, 0)

	config, er := configMgr.addDimensionInfo(dimensionInfo)
	if er != nil {
		openlogging.GetLogger().Errorf("failed to do add dimension info %s", er)
		return config, er
	}

	err := configMgr.pullSourceConfigsByDI("ConfigCenterSource", dimensionInfo)
	if err != nil {
		openlogging.GetLogger().Errorf("fail to load configuration of ConfigCenterSource source%s", err)
		return nil, err
	}

	return config, nil
}
547878
func Dimensions(width, height float64) PrintToPDFOption {
	return func(o map[string]interface{}) {
		o["paperWidth"] = width
		o["paperHeight"] = height
	}
}
678000
func NewEvent(e *JSONWriteFormat, defaultDimensions map[string]string) *event.Event {
	// if you add another  dimension that we read from the json update this number
	const MaxCollectDDims = 6
	dimensions := make(map[string]string, len(defaultDimensions)+MaxCollectDDims)
	for k, v := range defaultDimensions {
		dimensions[k] = v
	}
	// events don't have a dsname
	eventType, _ := getReasonableMetricName(e, 0, dimensions)
	addIfNotNullOrEmpty(dimensions, "plugin", true, e.Plugin)
	parseDimensionsOut(dimensions, e.PluginInstance, e.Host)

	properties := make(map[string]interface{}, len(e.Meta)+2)
	for k, v := range e.Meta {
		properties[k] = v
	}
	_, exists := e.Meta["severity"]
	if !exists && e.Severity != nil {
		properties["severity"] = *e.Severity
	}
	_, exists = e.Meta["message"]
	if !exists && e.Message != nil {
		properties["message"] = *e.Message
	}

	timestamp := time.Unix(0, int64(float64(time.Second)**e.Time))
	return event.NewWithProperties(eventType, event.COLLECTD, dimensions, properties, timestamp)
}
1357943
func NewBox(width, height int, flags int) *Box {
	width, height = GetXY(width, height)

	box := new(Box)
	box.Buf = new(bytes.Buffer)
	box.Width = width
	box.Height = height
	box.Border = DEFAULT_BORDER
	box.PaddingX = 1
	box.PaddingY = 0
	box.Flags = flags

	return box
}
597953
func New(width, height int, fillColor color.Color) *image.NRGBA {
	if width <= 0 || height <= 0 {
		return &image.NRGBA{}
	}

	c := color.NRGBAModel.Convert(fillColor).(color.NRGBA)
	if (c == color.NRGBA{0, 0, 0, 0}) {
		return image.NewNRGBA(image.Rect(0, 0, width, height))
	}

	return &image.NRGBA{
		Pix:    bytes.Repeat([]byte{c.R, c.G, c.B, c.A}, width*height),
		Stride: 4 * width,
		Rect:   image.Rect(0, 0, width, height),
	}
}
998533
func stripEmptyDimensions(dims []string) []string {
	source := strpair.ParseMap(dims)
	result := strpair.Map{}
	for k, ds := range source {
		for _, dim := range ds {
			if dim != "" {
				result.Add(k, dim)
			}
		}
	}
	return result.Format()
}
1000250
func (s *CustomizedLoadMetricSpecification) SetDimensions(v []*MetricDimension) *CustomizedLoadMetricSpecification {
	s.Dimensions = v
	return s
}