// Returns true if the supplied socket is fully available in `topoDetails`.
356087
func (a *cpuAccumulator) isSocketFree(socketID int) bool {
	return a.details.CPUsInSocket(socketID).Size() == a.topo.CPUsPerSocket()
}
1296695
func (cp *ChannelProvider) HasCapability(capability string) bool {
	switch capability {
	// Add new capability names here
	case ChannelV1_3:
		return true
	case ChannelV1_1:
		return true
	default:
		return false
	}
}
730266
func (c *Client) ClusterAvailable() (bool, error) {
	_, err := c.GetClusterStatus()
	if err != nil {
		return false, err
	}
	return true, nil
}
538807
func (nc *Conn) IsClosed() bool {
	nc.mu.RLock()
	defer nc.mu.RUnlock()
	return nc.isClosed()
}
360265
func isErrClosing(err error) bool {
	if opErr, ok := err.(*net.OpError); ok {
		err = opErr.Err
	}
	return "use of closed network connection" == err.Error()
}
724464
func IsSupported(ext string) bool {
	for name := range Types {
		if name == ext {
			return true
		}
	}
	return false
}
840026
func (nc *Conn) IsReconnecting() bool {
	nc.mu.RLock()
	defer nc.mu.RUnlock()
	return nc.isReconnecting()
}
1056561
func NewSocket(i *websocket.Conn, c *Context, f *Fibre) *Socket {
	return &Socket{i, c, f, nil}
}
1247315
func IsNotAvailable(err error) bool {
	err = errors.Cause(err)
	_, ok := err.(*notAvailable)
	return ok
}
195359
func peerURLFromConnectionFailedStatus(details []interface{}) string {
	if len(details) != 0 {
		url, ok := details[0].(string)
		if ok {
			return endpoint.ToAddress(url)
		}
	}
	return ""
}
811234
func (a *Agent) connectedToRightProxy() bool {
	for _, proxy := range a.DiscoverProxies {
		if a.connectedTo(proxy) {
			return true
		}
	}
	return false
}
221344
func (e *endpoint) maybeEnableSACKPermitted(synOpts *header.TCPSynOptions) {
	var v SACKEnabled
	if err := e.stack.TransportProtocolOption(ProtocolNumber, &v); err != nil {
		// Stack doesn't support SACK. So just return.
		return
	}
	if bool(v) && synOpts.SACKPermitted {
		e.sackPermitted = true
	}
}
788304
func hasMultipleServers(config clientcmdapi.Config) bool {
	server := ""
	for _, cluster := range config.Clusters {
		if len(server) == 0 {
			server = cluster.Server
		}
		if server != cluster.Server {
			return true
		}
	}
	return false
}
754430
func IsWebsocketRequest(req *http.Request) bool {
	containsHeader := func(name, value string) bool {
		items := strings.Split(req.Header.Get(name), ",")
		for _, item := range items {
			if value == strings.ToLower(strings.TrimSpace(item)) {
				return true
			}
		}
		return false
	}
	return containsHeader(Connection, "upgrade") && containsHeader(Upgrade, "websocket")
}
299690
func (g *GlobalContext) ResetSocket(clearError bool) (net.Conn, rpc.Transporter, bool, error) {
	g.SocketWrapper = nil
	return g.GetSocket(clearError)
}
815928
func (r Network_Vlan_Firewall) IsHighAvailabilityUpgradeAvailable() (resp bool, err error) {
	err = r.Session.DoRequest("SoftLayer_Network_Vlan_Firewall", "isHighAvailabilityUpgradeAvailable", nil, &r.Options, &resp)
	return
}
76233
func (list packetList) isComplete() (bool, int) {
	numPackets := len(list)

	// Trivial cases

	switch numPackets {
	case 0:
		return false, 0
	case 1:
		return true, len(list[0].Payload)
	case 2:
		TCPHeader0, _ := tcpFromPcap(list[0])
		TCPHeader1, _ := tcpFromPcap(list[1])
		size0 := len(list[0].Payload)

		if TCPHeader0.Seq+uint32(size0) == TCPHeader1.Seq {
			return true, size0 + len(list[1].Payload)
		}

		return false, 0
	}

	// More than 2 packets -> loop

	TCPHeader, _ := tcpFromPcap(list[0])
	payloadSize := len(list[0].Payload)
	prevSeq := TCPHeader.Seq
	prevSize := len(list[0].Payload)

	for i := 1; i < numPackets; i++ {
		TCPHeader, _ = tcpFromPcap(list[i])
		if prevSeq+uint32(prevSize) != TCPHeader.Seq {
			return false, 0
		}

		prevSeq = TCPHeader.Seq
		prevSize = len(list[i].Payload)
		payloadSize += prevSize
	}

	return true, payloadSize
}