// getInsertLocation determines insert location in a Section, which is the
// first blank line after a non-blank.
10812
func (s *Section) getInsertLocation(idx int) int {
	for i := idx; i >= 0; i-- {
		if s.file.lines[i].item != nil {
			return i + 1
		}
	}

	return -1
}
516404
func (c *Debugger) ContinueToLocation(location *DebuggerLocation, targetCallFrames string) (*gcdmessage.ChromeResponse, error) {
	var v DebuggerContinueToLocationParams
	v.Location = location
	v.TargetCallFrames = targetCallFrames
	return c.ContinueToLocationWithParams(&v)
}
712131
func (u *User) GetLocation() string {
	if u == nil || u.Location == nil {
		return ""
	}
	return *u.Location
}
151441
func (c Client) GetBucketLocation(bucketName string) (string, error) {
	if err := s3utils.CheckValidBucketName(bucketName); err != nil {
		return "", err
	}
	return c.getBucketLocation(bucketName)
}
494508
func (f *Filter) location(h [2]uint64, i uint64) uint {
	return uint((h[0] + h[1]*i) & f.mask)
}
1045970
func (c *locationCache) getLocation(offset int) *time.Location {
	c.lock.Lock()
	defer c.lock.Unlock()

	location, ok := c.cache[offset]
	if !ok {
		location = time.FixedZone("", offset)
		c.cache[offset] = location
	}

	return location
}
1182183
func (d *failureDetail) Location() (string, int, string) {
	return d.fileName, d.lineNumber, d.funcName
}
262961
func getObjectLocation(r *http.Request, domains []string, bucket, object string) string {
	// unit tests do not have host set.
	if r.Host == "" {
		return path.Clean(r.URL.Path)
	}
	proto := handlers.GetSourceScheme(r)
	if proto == "" {
		proto = getURLScheme(globalIsSSL)
	}
	u := &url.URL{
		Host:   r.Host,
		Path:   path.Join(slashSeparator, bucket, object),
		Scheme: proto,
	}
	// If domain is set then we need to use bucket DNS style.
	for _, domain := range domains {
		if strings.Contains(r.Host, domain) {
			u.Host = bucket + "." + r.Host
			u.Path = path.Join(slashSeparator, object)
			break
		}
	}
	return u.String()
}
257191
func PrintLocationBrief(l []location.Location) {
	var output []string

	output = append(output, fmt.Sprintf("Provider | Region"))

	for i := 0; i < len(l); i++ {
		output = append(output, fmt.Sprintf("%s | %s", l[i].Provider, l[i].Region))
	}

	fmt.Println(columnize.SimpleFormat(output))
}
1113864
func (c *RegionCache) LocateRegionByID(bo *Backoffer, regionID uint64) (*KeyLocation, error) {
	c.mu.RLock()
	r := c.getRegionByIDFromCache(regionID)
	if r != nil {
		loc := &KeyLocation{
			Region:   r.VerID(),
			StartKey: r.StartKey(),
			EndKey:   r.EndKey(),
		}
		c.mu.RUnlock()
		return loc, nil
	}
	c.mu.RUnlock()

	r, err := c.loadRegionByID(bo, regionID)
	if err != nil {
		return nil, errors.Trace(err)
	}

	c.mu.Lock()
	defer c.mu.Unlock()
	c.insertRegionToCache(r)
	return &KeyLocation{
		Region:   r.VerID(),
		StartKey: r.StartKey(),
		EndKey:   r.EndKey(),
	}, nil
}
568025
func getRedirectLocation(urlPath string) (rLocation string) {
	if urlPath == minioReservedBucketPath {
		rLocation = minioReservedBucketPath + "/"
	}
	if contains([]string{
		"/",
		"/webrpc",
		"/login",
		"/favicon.ico",
	}, urlPath) {
		rLocation = minioReservedBucketPath + urlPath
	}
	return rLocation
}
976842
func (e *Error) Location() (file string, line int) {
	return e.file, e.line
}
343731
func (term *Term) SetLocation(loc *Location) *Term {
	term.Location = loc
	return term
}
497505
func (o *Organization) GetLocation() string {
	if o == nil || o.Location == nil {
		return ""
	}
	return *o.Location
}
852023
func (sp *ServiceProvider) GetSSOBindingLocation(binding string) string {
	for _, singleSignOnService := range sp.IDPMetadata.IDPSSODescriptor.SingleSignOnService {
		if singleSignOnService.Binding == binding {
			return singleSignOnService.Location
		}
	}
	return ""
}
109890
func (p *PullRequestComment) GetPosition() int {
	if p == nil || p.Position == nil {
		return 0
	}
	return *p.Position
}
926275
func currentLocation(c *current) *Location {
	return NewLocation(c.text, c.globalStore[filenameKey].(string), c.pos.line, c.pos.col)
}