// pointFor returns a representative point for the side of the given bitCode.
359428
func pointFor(b orb.Bound, code int) orb.Point {
	switch code {
	case 1:
		return orb.Point{b.Min[0], (b.Max[1] + b.Min[1]) / 2}
	case 2:
		return orb.Point{b.Max[0], (b.Max[1] + b.Min[1]) / 2}
	case 4:
		return orb.Point{(b.Max[0] + b.Min[0]) / 2, b.Min[1]}
	case 5:
		return orb.Point{b.Min[0], b.Min[1]}
	case 6:
		return orb.Point{b.Max[0], b.Min[1]}
	case 8:
		return orb.Point{(b.Max[0] + b.Min[0]) / 2, b.Max[1]}
	case 9:
		return orb.Point{b.Min[0], b.Max[1]}
	case 10:
		return orb.Point{b.Max[0], b.Max[1]}
	}

	panic("invalid code")
}
623264
func (point Point) String() string {
	var result string
	if bytes, err := json.Marshal(point); err == nil {
		result = string(bytes)
	} else {
		result = err.Error()
	}
	return result
}
1287762
func CodecFor(codec ObjectCodec, version unversioned.GroupVersion) Codec {
	return &codecWrapper{codec, version}
}
98836
func (r Rect) ContainsPoint(p Point) bool {
	return r.X.Contains(p.X) && r.Y.Contains(p.Y)
}
172293
func (p PostGISPolygon) Value() (driver.Value, error) {
	parts := make([]string, len(p.Points))
	for i, pt := range p.Points {
		parts[i] = fmt.Sprintf("%.8f %.8f", pt.Lon, pt.Lat)
	}
	return []byte(fmt.Sprintf("SRID=4326;POLYGON((%s))", strings.Join(parts, ","))), nil
}
1063294
func (g *genDeepCopy) doPointer(t *types.Type, sw *generator.SnippetWriter) {
	ut := underlyingType(t)
	uet := underlyingType(ut.Elem)

	dc, dci := deepCopyMethodOrDie(ut.Elem), deepCopyIntoMethodOrDie(ut.Elem)
	switch {
	case dc != nil || dci != nil:
		rightPointer := !isReference(ut.Elem)
		if dc != nil {
			rightPointer = dc.Results[0].Kind == types.Pointer
		}
		if rightPointer {
			sw.Do("*out = (*in).DeepCopy()\n", nil)
		} else {
			sw.Do("x := (*in).DeepCopy()\n", nil)
			sw.Do("*out = &x\n", nil)
		}
	case uet.IsAssignable():
		sw.Do("*out = new($.Elem|raw$)\n", ut)
		sw.Do("**out = **in", nil)
	case uet.Kind == types.Map, uet.Kind == types.Slice, uet.Kind == types.Pointer:
		sw.Do("*out = new($.Elem|raw$)\n", ut)
		sw.Do("if **in != nil {\n", nil)
		sw.Do("in, out := *in, *out\n", nil)
		g.generateFor(uet, sw)
		sw.Do("}\n", nil)
	case uet.Kind == types.Struct:
		sw.Do("*out = new($.Elem|raw$)\n", ut)
		sw.Do("(*in).DeepCopyInto(*out)\n", nil)
	default:
		klog.Fatalf("Hit an unsupported type %v for %v", uet, t)
	}
}
769726
func pointKey(measurement string, tags Tags, fields Fields, t time.Time) ([]byte, error) {
	if len(fields) == 0 {
		return nil, ErrPointMustHaveAField
	}

	if !t.IsZero() {
		if err := CheckTime(t); err != nil {
			return nil, err
		}
	}

	for key, value := range fields {
		switch value := value.(type) {
		case float64:
			// Ensure the caller validates and handles invalid field values
			if math.IsInf(value, 0) {
				return nil, fmt.Errorf("+/-Inf is an unsupported value for field %s", key)
			}
			if math.IsNaN(value) {
				return nil, fmt.Errorf("NAN is an unsupported value for field %s", key)
			}
		case float32:
			// Ensure the caller validates and handles invalid field values
			if math.IsInf(float64(value), 0) {
				return nil, fmt.Errorf("+/-Inf is an unsupported value for field %s", key)
			}
			if math.IsNaN(float64(value)) {
				return nil, fmt.Errorf("NAN is an unsupported value for field %s", key)
			}
		}
		if len(key) == 0 {
			return nil, fmt.Errorf("all fields must have non-empty names")
		}
	}

	key := MakeKey([]byte(measurement), tags)
	for field := range fields {
		sz := seriesKeySizeV1(key, []byte(field))
		if sz > MaxKeyLength {
			return nil, fmt.Errorf("max key length exceeded: %v > %v", sz, MaxKeyLength)
		}
	}

	return key, nil
}
793213
func (f *Fpdf) point(x, y float64) {
	f.outf("%.2f %.2f m", x*f.k, (f.h-y)*f.k)
}
623450
func SignedArea(a, b, c Point) float64 {
	return float64(RobustSign(a, b, c)) * PointArea(a, b, c)
}
956948
func NewPointFromSeries(key []byte, fields Fields, t time.Time) Point {
	return &point{
		key:    key,
		time:   t,
		fields: fields.MarshalBinary(),
	}
}
1088476
func PointFromBytes(bytes []byte) (*Point, error) {
	var result Point
	err := json.Unmarshal(bytes, &result)
	return &result, err
}
885563
func bitPos(s []byte, bit bool) int {
	for i, b := range s {
		for j, set := range toBits(b) {
			if set == bit {
				return i*8 + j
			}
		}
	}
	return -1
}
998192
func (p *Polygon) ContainsPoint(point Point) bool {
	// NOTE: A bounds check slows down this function by about 50%. It is
	// worthwhile only when it might allow us to delay building the index.
	if !p.index.IsFresh() && !p.bound.ContainsPoint(point) {
		return false
	}

	// For small polygons, and during initial construction, it is faster to just
	// check all the crossing.
	const maxBruteForceVertices = 32
	if p.numVertices < maxBruteForceVertices || p.index == nil {
		inside := false
		for _, l := range p.loops {
			// use loops bruteforce to avoid building the index on each loop.
			inside = inside != l.bruteForceContainsPoint(point)
		}
		return inside
	}

	// Otherwise, look up the ShapeIndex cell containing this point.
	it := p.index.Iterator()
	if !it.LocatePoint(point) {
		return false
	}

	return p.iteratorContainsPoint(it, point)
}
328128
func pointValue(constraint *securityv1.SecurityContextConstraints) points {
	totalPoints := noPoints

	if constraint.AllowPrivilegedContainer {
		totalPoints += privilegedPoints
	}

	// add points based on volume requests
	totalPoints += volumePointValue(constraint)

	if constraint.AllowHostNetwork {
		totalPoints += hostNetworkPoints
	}
	if constraint.AllowHostPorts {
		totalPoints += hostPortsPoints
	}

	// add points based on capabilities
	totalPoints += capabilitiesPointValue(constraint)

	// the map contains points for both RunAsUser and SELinuxContext
	// strategies by taking advantage that they have identical strategy names
	strategiesPoints := map[string]points{
		string(securityv1.RunAsUserStrategyRunAsAny):         runAsAnyUserPoints,
		string(securityv1.RunAsUserStrategyMustRunAsNonRoot): runAsNonRootPoints,
		string(securityv1.RunAsUserStrategyMustRunAsRange):   runAsRangePoints,
		string(securityv1.RunAsUserStrategyMustRunAs):        runAsUserPoints,
	}

	strategyType := string(constraint.SELinuxContext.Type)
	points, found := strategiesPoints[strategyType]
	if found {
		totalPoints += points
	} else {
		klog.Warningf("SELinuxContext type %q has no point value, this may cause issues in sorting SCCs by restriction", strategyType)
	}

	strategyType = string(constraint.RunAsUser.Type)
	points, found = strategiesPoints[strategyType]
	if found {
		totalPoints += points
	} else {
		klog.Warningf("RunAsUser type %q has no point value, this may cause issues in sorting SCCs by restriction", strategyType)
	}

	return totalPoints
}
548618
func Point(p orb.Point, proj orb.Projection) orb.Point {
	return proj(p)
}
265404
func BinFor(beg, end int) uint32 {
	end--
	switch {
	case beg>>level5Shift == end>>level5Shift:
		return level5 + uint32(beg>>level5Shift)
	case beg>>level4Shift == end>>level4Shift:
		return level4 + uint32(beg>>level4Shift)
	case beg>>level3Shift == end>>level3Shift:
		return level3 + uint32(beg>>level3Shift)
	case beg>>level2Shift == end>>level2Shift:
		return level2 + uint32(beg>>level2Shift)
	case beg>>level1Shift == end>>level1Shift:
		return level1 + uint32(beg>>level1Shift)
	}
	return level0
}
1081566
func (pts BittrexDepthArray) makePts() []DepthPoint {
	depth := make([]DepthPoint, 0, len(pts))
	for _, pt := range pts {
		depth = append(depth, DepthPoint{
			Quantity: pt.Quantity,
			Price:    pt.Rate,
		})
	}
	return depth
}