// RandomLocalNumberUS returns a US E.164 number
// AreaCode + Prefix + Line Number
165464
func (fng *FakeNumberGenerator) RandomLocalNumberUSAreaCodes(acs []uint16) uint64 {
	ac := acs[fng.Rand.Intn(len(acs))]
	return fng.LocalNumberUS(ac, fng.RandomLineNumber())
}
483664
func LocalUnix(t time.Time) int64 {
	_, offset := t.Zone()
	return t.Unix() + int64(offset)
}
521760
func (c *Conn) LocalAddr() (net.Addr, error) {
	if !c.IsAlive() {
		return nil, errors.New("connection not ready")
	}
	return c.conn.LocalAddr(), nil
}
1139562
func (m *MockConn) LocalAddr() net.Addr {
	ret := m.ctrl.Call(m, "LocalAddr")
	ret0, _ := ret[0].(net.Addr)
	return ret0
}
1321402
func RandAlphaNumSeq(n int) string {
	b := make([]rune, n)
	for i := range b {
		b[i] = alphaNum[rand.Intn(len(alphaNum))]
	}
	return string(b)
}
23017
func (_m *ServiceResponse) ForLocal() discovery.LocalResponse {
	ret := _m.Called()

	var r0 discovery.LocalResponse
	if rf, ok := ret.Get(0).(func() discovery.LocalResponse); ok {
		r0 = rf()
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(discovery.LocalResponse)
		}
	}

	return r0
}
794903
func ListenOnLocalRandomPort() (net.Listener, error) {
	ip, err := Localhost()
	if err != nil {
		return nil, err
	}
	return net.ListenTCP("tcp", &net.TCPAddr{IP: ip, Port: 0})
}
1065088
func (na *NetAddress) Local() bool {
	return na.IP.IsLoopback() || zero4.Contains(na.IP)
}
642472
func (u URL) IsLocal() bool {
	return u.Type == URLTypeLocal || (u.Type == URLTypeURL && u.URL.Scheme == "file" && u.URL.Opaque == "")
}
470441
func (tracerOptions) RandomNumber(randomNumber func() uint64) TracerOption {
	return func(tracer *Tracer) {
		tracer.randomNumber = randomNumber
	}
}
1363542
func FailRand(n int) {
	if callIndexToFail < 0 {
		return
	}

	if callRandIndexToFail < 0 {
		// first call in the loop, pick a random index to fail at
		callRandIndexToFail = rand.Intn(n)
		callRandIndex = 0
	}

	if callIndex == callIndexToFail {
		if callRandIndex == callRandIndexToFail {
			Exit()
		}
	}

	callRandIndex += 1

	if callRandIndex == n {
		callIndex += 1
	}
}
470782
func (c *Conn) LocalAddr() net.Addr {
	if !c.ok() {
		return nil
	}
	return c.conn.LocalAddr()
}
962492
func SetRandomNumberBoundaries(start, end int) error {
	if start > end {
		return errors.New(ErrStartValueBiggerThanEnd)
	}
	nBoundary = numberBoundary{start: start, end: end}
	return nil
}
1164393
func (r Location_Datacenter) GetOnlineSslVpnUserCount() (resp int, err error) {
	err = r.Session.DoRequest("SoftLayer_Location_Datacenter", "getOnlineSslVpnUserCount", nil, &r.Options, &resp)
	return
}
509874
func (s ServerListener) LocalAddr() net.Addr {
	if s.packet == nil {
		return nil
	}
	return s.packet.LocalAddr()
}
1170450
func isLocalAddress(local, localRemote string) bool {
	// Resolve the IP returned by the STUN server first.
	localRemoteAddr, err := net.ResolveUDPAddr("udp", localRemote)
	if err != nil {
		return false
	}
	// Try comparing with the local address on the socket first, but only if
	// it's actually specified.
	addr, err := net.ResolveUDPAddr("udp", local)
	if err == nil && addr.IP != nil && !addr.IP.IsUnspecified() {
		return addr.IP.Equal(localRemoteAddr.IP)
	}
	// Fallback to checking IPs of all interfaces
	addrs, err := net.InterfaceAddrs()
	if err != nil {
		return false
	}
	for _, addr := range addrs {
		ip, _, err := net.ParseCIDR(addr.String())
		if err != nil {
			continue
		}
		if ip.Equal(localRemoteAddr.IP) {
			return true
		}
	}
	return false
}
1116561
func RandomAddressAt(self Address, prox int) (addr Address) {
	addr = self
	pos := -1
	if prox >= 0 {
		pos = prox / 8
		trans := prox % 8
		transbytea := byte(0)
		for j := 0; j <= trans; j++ {
			transbytea |= 1 << uint8(7-j)
		}
		flipbyte := byte(1 << uint8(7-trans))
		transbyteb := transbytea ^ byte(255)
		randbyte := byte(rand.Intn(255))
		addr[pos] = ((addr[pos] & transbytea) ^ flipbyte) | randbyte&transbyteb
	}
	for i := pos + 1; i < len(addr); i++ {
		addr[i] = byte(rand.Intn(255))
	}

	return
}