// See cairo_region_translate().
//
// C API documentation: http://cairographics.org/manual/cairo-Regions.html#cairo-region-translate
338750
func (region *Region) Translate(dx, dy int) {
	C.cairo_region_translate(region.Ptr, C.int(dx), C.int(dy))
	if err := region.status(); err != nil {
		panic(err)
	}
}
188128
func GetRegion(d *schema.ResourceData, config *Config) string {
	if v, ok := d.GetOk("region"); ok {
		return v.(string)
	}

	return config.Region
}
75082
func (v *View) Transform(viewport text.Region) render.Recipe {
	pe := util.Prof.Enter("view.Transform")
	defer pe.Exit()
	v.lock.Lock()
	defer v.lock.Unlock()
	if v.syntax == nil {
		return nil
	}
	cs := v.Settings().String("color_scheme", "")
	scheme := ed.GetColorScheme(cs)
	rr := make(render.ViewRegionMap)
	for k, v := range v.regions {
		rr[k] = *v.Clone()
	}
	rs := render.ViewRegions{Flags: render.SELECTION}
	rs.Regions.AddAll(v.selection.Regions())
	rr["lime.selection"] = rs
	return render.Transform(scheme, rr, viewport)
}
1045709
func translateFunc(arg1, arg2, arg3 query) func(query, iterator) interface{} {
	return func(q query, t iterator) interface{} {
		str := asString(t, arg1.Evaluate(t))
		src := asString(t, arg2.Evaluate(t))
		dst := asString(t, arg3.Evaluate(t))

		var replace []string
		for i, s := range src {
			d := ""
			if i < len(dst) {
				d = string(dst[i])
			}
			replace = append(replace, string(s), d)
		}
		return strings.NewReplacer(replace...).Replace(str)
	}
}
133648
func (r *LambdaResults) RegionsData() map[string]AggData {
	regionsMap := make(map[string]AggData)
	for _, region := range r.Regions() {
		regionsMap[region] = sumAggData(r.ResultsForRegion(region))
	}
	return regionsMap
}
176650
func (i18 *I18Mem) Translate(key string, values ...interface{}) (string, error) {
	i18.muTranlsates.RLock()
	defer i18.muTranlsates.RUnlock()
	format, ok := i18.translates[key]
	if !ok {
		return "", fmt.Errorf("Unknown translate for %s key", key)
	}
	return fmt.Sprintf(format, values...), nil
}
127900
func (t translator) translate(vFrom, vTo reflect.Value) {
	tFrom := vFrom.Type()
	tTo := vTo.Type()
	if fnv := t.getTranslator(tFrom, tTo); fnv.IsValid() {
		vTo.Set(fnv.Call([]reflect.Value{vFrom})[0])
		return
	}
	if t.translatable(tFrom, tTo) {
		t.translateSameType(vFrom, vTo)
		return
	}

	panic(fmt.Sprintf("Translator not defined for %v to %v", tFrom, tTo))
}
1344310
func (r *RegionSet) Regions() (ret []Region) {
	r.lock.Lock()
	defer r.lock.Unlock()
	ret = make([]Region, len(r.regions))
	copy(ret, r.regions)
	return
}
1101425
func (ui *UI) TranslateText(template string, templateValues ...map[string]interface{}) string {
	return ui.translate(template, getFirstSet(templateValues))
}
840103
func (s Slice) translate() (Slice, error) {
	if !s.IsSmallInt() && !s.IsUInt() {
		return nil, WithStack(InvalidTypeError{"Cannot translate key of this type"})
	}
	if attributeTranslator == nil {
		return nil, WithStack(NeedAttributeTranslatorError)
	}
	return s.translateUnchecked(), nil
}
1196605
func (r ContinuousRange) Translate(value float64) int {
	normalized := value - r.Min
	ratio := normalized / r.GetDelta()

	if r.IsDescending() {
		return r.Domain - int(math.Ceil(ratio*float64(r.Domain)))
	}

	return int(math.Ceil(ratio * float64(r.Domain)))
}
1315575
func (c *defaultsCommand) parseArgsForRegion(args []string) ([]string, error) {
	var err error
	if len(args) > 0 {
		// determine if the first arg is cloud/region or region and return
		// appropriate positional args.
		args, err = c.parseCloudRegion(args)
		if err != nil {
			return nil, errors.Trace(err)
		}
	}
	return args, nil
}
373767
func (matrix *Matrix) TransformDistance(dx, dy *float64) {
	C.cairo_matrix_transform_distance((*C.cairo_matrix_t)(unsafe.Pointer(matrix)), (*C.double)(unsafe.Pointer(dx)), (*C.double)(unsafe.Pointer(dy)))
}
400706
func Translate(ctx context.Context, format string, args ...interface{}) string {
	return ctx.Translate(format, args...)
}
318069
func (r Region) String() string {
	return fmt.Sprintf("(%d, %d)", r.From, r.To)
}
971006
func (s *Resource) SetRegion(v string) *Resource {
	s.Region = &v
	return s
}
290707
func translate(t translator.Translator, text, from string, to translator.Language) <-chan string {
	out := make(chan string)
	go func() {
		translation, err := t.Translate(text, from, to.Code)
		if err != nil {
			out <- fmt.Sprintf("Error during translation for %s: %s", to.Name, err.Error())
		} else {
			out <- fmt.Sprintf("%s [%s]: %s", to.Name, to.Code, translation)
		}
		close(out)
	}()
	return out
}