// Locator returns a Maidenhead Locator for the point coordinates with
// specified precision
174993
func (p Point) Locator(precision int) (string, error) {
	return locator(p, precision)
}
588189
func (s *Audio) SetLocation(v string) *Audio {
	s.Location = &v
	return s
}
1122592
func LocatePointInRing(layout geom.Layout, p geom.Coord, ring []float64) location.Type {
	counter := rayCrossingCounter{p: p}

	stride := layout.Stride()

	for i := stride; i < len(ring); i += stride {
		p1 := geom.Coord(ring[i : i+2])
		p2 := geom.Coord(ring[i-stride : i-stride+2])

		counter.countSegment(p1, p2)
		if counter.isPointOnSegment {
			return counter.getLocation()
		}
	}
	return counter.getLocation()
}
1374793
func (r *defaultRouter) GetLocalPeer(realmURI URI, details map[string]interface{}) (Peer, error) {
	realm, ok := r.realms[realmURI]
	if !ok {
		return nil, NoSuchRealmError(realmURI)
	}
	// TODO: session open/close callbacks?
	return realm.getPeer(details)
}
662979
func FindFileLocation(p Process, fileName string, lineno int) (uint64, error) {
	pc, fn, err := p.BinInfo().LineToPC(fileName, lineno)
	if err != nil {
		return 0, err
	}
	if fn.Entry == pc {
		pc, _ = FirstPCAfterPrologue(p, fn, true)
	}
	return pc, nil
}
938662
func (h *HereError) Location() string {
	lastSlash := strings.LastIndex(h.loc, "/")
	secondLastSlash := strings.LastIndex(h.loc[:lastSlash], "/")

	return h.loc[secondLastSlash+1:]
}
954723
func (expr *Expr) SetLocation(loc *Location) *Expr {
	expr.Location = loc
	return expr
}
708353
func (s *JobManifest) SetLocation(v *JobManifestLocation) *JobManifest {
	s.Location = v
	return s
}
175446
func newEdgeLocator(edge *channeldb.ChannelEdgePolicy) *EdgeLocator {
	return &EdgeLocator{
		ChannelID: edge.ChannelID,
		Direction: uint8(edge.ChannelFlags & lnwire.ChanUpdateDirection),
	}
}
1075990
func (opts *Options) IndexLocation() *Location {
	o := opts.Clone()
	o.nmr = NewNamer(&NOpts{base: opts.filename})
	return NewLocation(o)
}
984410
func (l *Location) buildFindPath(endpoint string) string {
	path := fmt.Sprintf("%s/v1/locations/", endpoint)

	if l.Provider != "" {
		path = fmt.Sprintf("%s%s", path, l.Provider)

		if l.Region != "" {
			path = fmt.Sprintf("%s/%s", path, l.Region)
		}
	}

	return path
}
1257598
func (w *With) SetLocation(loc *Location) *With {
	w.Location = loc
	return w
}
27341
func (bi *BinaryInfo) Location(entry reader.Entry, attr dwarf.Attr, pc uint64, regs op.DwarfRegisters) (int64, []op.Piece, string, error) {
	instr, descr, err := bi.locationExpr(entry, attr, pc)
	if err != nil {
		return 0, nil, "", err
	}
	addr, pieces, err := op.ExecuteStackProgram(regs, instr)
	return addr, pieces, descr, err
}
353595
func ResourceLocation(getter ResourceGetter, connection client.ConnectionInfoGetter, proxyTransport http.RoundTripper, ctx context.Context, id string) (*url.URL, http.RoundTripper, error) {
	schemeReq, name, portReq, valid := utilnet.SplitSchemeNamePort(id)
	if !valid {
		return nil, nil, errors.NewBadRequest(fmt.Sprintf("invalid node request %q", id))
	}

	info, err := connection.GetConnectionInfo(ctx, types.NodeName(name))
	if err != nil {
		return nil, nil, err
	}

	// We check if we want to get a default Kubelet's transport. It happens if either:
	// - no port is specified in request (Kubelet's port is default)
	// - the requested port matches the kubelet port for this node
	if portReq == "" || portReq == info.Port {
		return &url.URL{
				Scheme: info.Scheme,
				Host:   net.JoinHostPort(info.Hostname, info.Port),
			},
			info.Transport,
			nil
	}

	if err := proxyutil.IsProxyableHostname(ctx, &net.Resolver{}, info.Hostname); err != nil {
		return nil, nil, errors.NewBadRequest(err.Error())
	}

	// Otherwise, return the requested scheme and port, and the proxy transport
	return &url.URL{Scheme: schemeReq, Host: net.JoinHostPort(info.Hostname, portReq)}, proxyTransport, nil
}
840780
func dpWorker(points []geo.Point, threshold float64, mask []byte) int {

	found := 0

	var stack []int
	stack = append(stack, 0, len(points)-1)

	l := &geo.Line{}
	for len(stack) > 0 {
		start := stack[len(stack)-2]
		end := stack[len(stack)-1]

		// modify the line in place
		a := l.A()
		a[0], a[1] = points[start][0], points[start][1]

		b := l.B()
		b[0], b[1] = points[end][0], points[end][1]

		maxDist := 0.0
		maxIndex := 0
		for i := start + 1; i < end; i++ {
			dist := l.SquaredDistanceFrom(&points[i])

			if dist > maxDist {
				maxDist = dist
				maxIndex = i
			}
		}

		if maxDist > threshold*threshold {
			found++
			mask[maxIndex] = 1

			stack[len(stack)-1] = maxIndex
			stack = append(stack, maxIndex, end)
		} else {
			stack = stack[:len(stack)-2]
		}
	}

	return found
}
96170
func (t *Tab) GetElementByLocation(x, y int) (*Element, error) {
	_, nodeId, err := t.DOM.GetNodeForLocation(x, y, false)
	if err != nil {
		return nil, err
	}
	ele, _ := t.GetElementByNodeId(nodeId)
	return ele, nil
}
754260
func (s *SessionVars) Location() *time.Location {
	loc := s.TimeZone
	if loc == nil {
		loc = timeutil.SystemLocation()
	}
	return loc
}