// IsLocal returns true if this is a local address
175600
func (a *NetAddr) IsLocal() bool {
	host, _, err := net.SplitHostPort(a.Addr)
	if err != nil {
		return false
	}
	return IsLocalhost(host)
}
921706
func IsLocalhost(host string) bool {
	if host == "localhost" {
		return true
	}
	ip := net.ParseIP(host)
	return ip.IsLoopback() || ip.IsUnspecified()
}
1125040
func (s *CatAllocationService) Local(local bool) *CatAllocationService {
	s.local = &local
	return s
}
822377
func (c *UsersInfoCall) IncludeLocale(includeLocale bool) *UsersInfoCall {
	c.includeLocale = includeLocale
	return c
}
965133
func GetLocale(locale string) (*Locale, bool) {
	l, ok := locales[locale]
	return l, ok
}
967315
func (s *IndicesGetMappingService) Local(local bool) *IndicesGetMappingService {
	s.local = &local
	return s
}
524630
func DialTimeoutLocal(socket string, timeout time.Duration) (net.Conn, error) {
	// on unix, we dial a unix socket
	return net.DialTimeout("unix", socket, timeout)
}
560840
func (a Address) Locality() string {
	var locality string

	if a.City != "" {
		locality = a.City
	} else if a.Town != "" {
		locality = a.Town
	} else if a.Village != "" {
		locality = a.Village
	}

	return locality
}
842445
func (s *IndicesGetTemplateService) Local(local bool) *IndicesGetTemplateService {
	s.local = &local
	return s
}
1282730
func (s *CatCountService) Local(local bool) *CatCountService {
	s.local = &local
	return s
}
377370
func (s *IndicesGetService) Local(local bool) *IndicesGetService {
	s.local = &local
	return s
}
176427
func (s *session) closeLocal(e error) {
	s.closeOnce.Do(func() {
		if e == nil {
			s.logger.Infof("Closing session.")
		} else {
			s.logger.Errorf("Closing session with error: %s", e)
		}
		s.sessionRunner.Retire(s.srcConnID)
		s.closeChan <- closeError{err: e, sendClose: true, remote: false}
	})
}
257312
func IsLocalHost(hostport string) bool {
	host, _, err := net.SplitHostPort(hostport)
	if err != nil {
		return false
	}
	switch {
	case host == "localhost", host == "":
	case net.ParseIP(host).IsLoopback():

	default:
		return false
	}
	return true
}
819669
func (bs *baseVCSSource) initLocal(ctx context.Context) error {
	err := bs.repo.get(ctx)

	if err != nil {
		return unwrapVcsErr(err)
	}
	return nil
}
255843
func (s *SearchShardsService) Local(local bool) *SearchShardsService {
	s.local = &local
	return s
}
459856
func (c *Conn) LocalAddr() net.Addr {
	a, err := c.ep.GetLocalAddress()
	if err != nil {
		return nil
	}
	return fullToTCPAddr(a)
}
988617
func (m *Meta) IsLocalBackend(b backend.Backend) bool {
	// Is it a local backend?
	bLocal, ok := b.(*backendLocal.Local)

	// If it is, does it not have an alternate state backend?
	if ok {
		ok = bLocal.Backend == nil
	}

	return ok
}