// SoftClip clips the constant to the range [-0.5, 0.5]
2334
func (c C) SoftClip() Input {
	if float32(c) < -0.5 {
		return C(-0.5)
	} else if float32(c) > 0.5 {
		return C(0.5)
	}
	return c
}
918852
func interpolate(min, max float64, npoints int) govector.Vector {
	interp := make(govector.Vector, npoints)

	step := (max - min) / (float64(npoints) - 1)
	interp[0] = min
	i := 1
	for i < npoints {
		interp[i] = interp[i-1] + step
		i++
	}
	return interp
}
1207020
func (r Product_Item_Price) GetCapacityRestrictionMaximum() (resp string, err error) {
	err = r.Session.DoRequest("SoftLayer_Product_Item_Price", "getCapacityRestrictionMaximum", nil, &r.Options, &resp)
	return
}
613982
func (c C) Clip2(val Input) Input {
	return c.Max(val.Neg()).Min(val)
}
1298034
func (builder *FetchValueCommandBuilder) WithSloppyQuorum(sloppyQuorum bool) *FetchValueCommandBuilder {
	builder.protobuf.SloppyQuorum = &sloppyQuorum
	return builder
}
383839
func (cr *Context) Clip() {
	C.cairo_clip(cr.Ptr)
	if err := cr.status(); err != nil {
		panic(err)
	}
}
470770
func (s *ShapeIndex) clipVAxis(edge *clippedEdge, middle r1.Interval) (a, b *clippedEdge) {
	if edge.bound.Y.Hi <= middle.Lo {
		// Edge is entirely contained in the lower child.
		return edge, nil
	} else if edge.bound.Y.Lo >= middle.Hi {
		// Edge is entirely contained in the upper child.
		return nil, edge
	}
	// The edge bound spans both children.
	return s.clipVBound(edge, 1, middle.Hi), s.clipVBound(edge, 0, middle.Lo)
}
177376
func Clamp(f, low, high float32) float32 {
	return engomath.Clamp(f, low, high)
}
36687
func interpolationFuncChomp() ast.Function {
	newlines := regexp.MustCompile(`(?:\r\n?|\n)*\z`)
	return ast.Function{
		ArgTypes:   []ast.Type{ast.TypeString},
		ReturnType: ast.TypeString,
		Callback: func(args []interface{}) (interface{}, error) {
			return newlines.ReplaceAllString(args[0].(string), ""), nil
		},
	}
}
639490
func (cr *Context) InClip(x, y float64) bool {
	ret := C.cairo_in_clip(cr.Ptr, C.double(x), C.double(y)) != 0
	if err := cr.status(); err != nil {
		panic(err)
	}
	return ret
}
571118
func HasAutoClip(ctx context.Context) bool {
	_, ok := ctx.Value(ctxKeyAutoClip).(bool)
	return ok
}
1064087
func ClipTable(table Table, i, j, m, n int) Table {
	minR, minC := i, j
	maxR, maxC := i+m, j+n
	if minR < 0 || minC < 0 || minR > maxR || minC > maxC || maxR >= table.RowCount() || maxC >= table.ColCount() {
		panic("out of bound")
	}
	return &TableView{table, i, j, m, n}
}
1265516
func (e *Editor) GetClipboard() string {
	s, _ := e.clipboard.Get()

	return s
}
269872
func RemovePrefix(args ...interface{}) string {
	s := args[0].(string)

	if strings.HasPrefix(s, "SoftLayer_") {
		return s[10:]
	}

	return s
}
1148926
func newClippedShape(id int32, numEdges int) *clippedShape {
	return &clippedShape{
		shapeID: id,
		edges:   make([]int, numEdges),
	}
}
1053407
func copyslice(input Float64Data) Float64Data {
	s := make(Float64Data, input.Len())
	copy(s, input)
	return s
}
1013957
func (p *WebPage) SetClipRect(rect Rect) error {
	req := map[string]interface{}{
		"ref": p.ref.id,
		"rect": rectJSON{
			Top:    rect.Top,
			Left:   rect.Left,
			Width:  rect.Width,
			Height: rect.Height,
		},
	}
	return p.ref.process.doJSON("POST", "/webpage/SetClipRect", req, nil)
}