// IsNodeReady returns true if a node is ready; false otherwise.
552923
func IsNodeReady(node *Node) bool {
	for _, c := range node.Status.Conditions {
		if c.Type == NodeReady {
			return c.Status == ConditionTrue
		}
	}
	return false
}
306909
func IsServerSide(e error) bool {
	if se, ok := e.(ServerSideError); ok {
		return se.IsServerSide()
	}
	return false
}
694385
func (n *node) isEmpty() bool {
	if len(n.psubs) == 0 && len(n.qsubs) == 0 {
		if n.next == nil || n.next.numNodes() == 0 {
			return true
		}
	}
	return false
}
764650
func (m *RestrictionManager) isReady() bool {
	m.mux.RLock()
	defer m.mux.RUnlock()
	return m.initialized
}
752274
func (ch *Chunk) IsFullyRead() bool {
	if ch == nil || ch.R == nil {
		return true
	}
	return ch.Size <= ch.Pos
}
191531
func (r *runner) isBoundary(index, startpos, endpos int) bool {
	return (index > startpos && syntax.IsWordChar(r.runtext[index-1])) !=
		(index < endpos && syntax.IsWordChar(r.runtext[index]))
}
1344551
func (c *cluster) allNodesReady() (ret bool) {
	if c.Static {
		return true
	}
	for _, id := range c.nodeIDs() {
		if c.Topology.nodeStates[id] != nodeStateReady {
			return false
		}
	}
	return true
}
1132896
func (o OnionHop) IsEmpty() bool {
	return o.NodePub.X == nil || o.NodePub.Y == nil
}
275295
func (h *Handler) WaitForReady() bool {
	// there is no ready func configured, so we return immediately
	if h.readyFunc == nil {
		return true
	}

	timeout := time.After(timeToWaitForReady)
	for !h.readyFunc() {
		select {
		case <-time.After(100 * time.Millisecond):
		case <-timeout:
			return h.readyFunc()
		}
	}
	return true
}
318775
func (client *Client) WaitForImageReady(regionId common.Region, imageId string, timeout int) error {
	if timeout <= 0 {
		timeout = ImageDefaultTimeout
	}
	for {
		args := DescribeImagesArgs{
			RegionId: regionId,
			ImageId:  imageId,
			Status:   ImageStatusCreating,
		}

		images, _, err := client.DescribeImages(&args)
		if err != nil {
			return err
		}
		if images == nil || len(images) == 0 {
			args.Status = ImageStatusAvailable
			images, _, er := client.DescribeImages(&args)
			if er == nil && len(images) == 1 {
				break
			} else {
				return common.GetClientErrorFromString("Not found")
			}
		}
		if images[0].Progress == "100%" {
			break
		}
		timeout = timeout - DefaultWaitForInterval
		if timeout <= 0 {
			return common.GetClientErrorFromString("Timeout")
		}
		time.Sleep(DefaultWaitForInterval * time.Second)
	}
	return nil
}
881512
func (rkg TLFReaderKeyGenerationsV2) IsReader(user keybase1.UID, deviceKey kbfscrypto.CryptPublicKey) bool {
	keyGen := rkg.LatestKeyGeneration()
	if keyGen < 1 {
		return false
	}
	return rkg[keyGen-1].IsReader(user, deviceKey)
}
854274
func (a *NetAddr) IsEmpty() bool {
	return a.Addr == "" && a.AddrNetwork == "" && a.Path == ""
}
511359
func (h Handle) IsReader(user keybase1.UID) bool {
	// TODO(KBFS-2185) relax this?
	if h.TypeForKeying() == tlf.TeamKeying {
		panic("Can't check whether a user is a reader on a team TLF")
	}
	if h.TypeForKeying() == tlf.PublicKeying || h.IsWriter(user) {
		return true
	}
	_, ok := h.resolvedReaders[user.AsUserOrTeam()]
	return ok
}
1225680
func (e *Element) IsSelected() (bool, error) {
	e.lock.RLock()
	defer e.lock.RUnlock()

	if !e.ready {
		return false, &ElementNotReadyErr{}
	}

	checked, ok := e.attributes["checked"]
	if ok == true && checked != "false" {
		return true, nil
	}
	return false, nil
}
425842
func (a *AttributeDefinition) IsReadOnly() bool {
	if _, readOnlyMetadataIsPresent := a.Metadata["swagger:read-only"]; readOnlyMetadataIsPresent {
		return true
	}
	return false
}
1067229
func (s *HTTPScaffold) handleReady(resp http.ResponseWriter, req *http.Request) {
	if req.Method != "GET" {
		resp.WriteHeader(http.StatusMethodNotAllowed)
		return
	}

	status, healthErr := s.callHealthCheck()
	if status == OK {
		healthErr = s.tracker.markedDown()
		if healthErr != nil {
			status = NotReady
		}
	}

	if status == OK {
		resp.WriteHeader(http.StatusOK)
	} else {
		writeUnavailable(resp, req, status, healthErr)
	}
}
180181
func isNodeRegistered(ctx context.Context, client kubernetes.Interface, nodename string) (bool, error) {
	var registered bool

	maxInterval := 1000 * time.Millisecond
	maxTime := 10 * time.Second

	// @lets try multiple times
	err := utils.Retry(ctx, maxInterval, maxTime, func() error {
		// @step: get a lit of nodes
		nodes, err := client.CoreV1().Nodes().List(metav1.ListOptions{
			LabelSelector: fmt.Sprintf("kubernetes.io/hostname=%s", nodename),
		})
		if err != nil {
			return err
		}

		// @check if we found a registered node
		if len(nodes.Items) > 0 {
			registered = true
		}

		return nil
	})
	if err != nil {
		return false, err
	}

	return registered, nil
}