// IsDirty implements the DirtyBlockCache interface for
// DirtyBlockCacheStandard.
337756
func (d *DirtyBlockCacheStandard) IsDirty(_ tlf.ID, ptr BlockPointer,
	branch BranchName) (isDirty bool) {
	dirtyID := dirtyBlockID{
		id:       ptr.ID,
		refNonce: ptr.RefNonce,
		branch:   branch,
	}

	d.lock.RLock()
	defer d.lock.RUnlock()
	_, isDirty = d.cache[dirtyID]
	return
}
1251849
func IsHeldElsewhere(err error) bool {
	if errno, ok := err.(syscall.Errno); ok {
		return errno == syscall.EWOULDBLOCK
	}
	return false
}
386804
func (d *DirtyBlockCacheStandard) ShouldForceSync(_ tlf.ID) bool {
	d.lock.RLock()
	defer d.lock.RUnlock()
	// TODO: Fill up to likely block boundaries?
	return d.waitBufBytes >= d.syncBufferCap
}
1195724
func (v ValueType) IsCumulative() bool {
	return v == CumulativeIntType ||
		v == CumulativeFloatType ||
		v == CumulativeDistributionType
}
643068
func (s *State) IsDead() bool {
	s.Lock()
	res := s.Dead
	s.Unlock()
	return res
}
643939
func (s *Server) IsBlocked() bool {
	s.blockMutex.Lock()
	defer s.blockMutex.Unlock()

	return s.block
}
413326
func (s *Store) IsDir(ctx context.Context, name string) bool {
	return s.storage.IsDir(ctx, name)
}
1002500
func (d DirentFileInfo) IsDir() bool {
	if d.Entry.DirentType == keybase1.DirentType_DIR {
		return true
	}
	return false
}
159890
func (h *hawkularSink) checkCache(key string, hash uint64) bool {
	h.regLock.Lock()
	defer h.regLock.Unlock()
	_, found := h.expReg[key]
	if !found || h.expReg[key].hash != hash {
		return false
	}
	// Update the TTL
	h.expReg[key].ttl = h.runId
	return true
}
1041719
func (fbo *folderBlockOps) GetDirtyDirBlockRefs(
	lState *kbfssync.LockState) []data.BlockRef {
	fbo.blockLock.RLock(lState)
	defer fbo.blockLock.RUnlock(lState)
	var dirtyRefs []data.BlockRef
	for ptr := range fbo.dirtyDirs {
		dirtyRefs = append(dirtyRefs, ptr.Ref())
	}
	return dirtyRefs
}
286003
func IsDirectory(path string) (bool, error) {
	fileInfo, err := os.Stat(path)
	if err != nil {
		return false, errors.Wrapf(err, "Error calling os.Stat on file %s", path)
	}
	return fileInfo.IsDir(), nil
}
811154
func IsDefaultDeny(err error) bool {
	if err == nil {
		return false
	}

	_, ok := err.(defaultDeny)
	return ok
}
971505
func (v *View) IsDirty() bool {
	if v.IsScratch() {
		return false
	}
	lastSave := v.Settings().Int("lime.last_save_change_count", -1)
	return v.ChangeCount() != lastSave
}
385323
func (c *ConfigLocal) BlockCache() data.BlockCache {
	c.lock.RLock()
	defer c.lock.RUnlock()
	return c.bcache
}
180810
func IsDirEmpty(dirname string) (status bool, err error) {
	f, err := os.Open(dirname)
	if err == nil {
		defer f.Close()
		if _, err = f.Readdirnames(1); err == io.EOF {
			status = true
			err = nil
		}
	}

	return
}
1223690
func isNodeReady(node *v1.Node) bool {
	nodeReadyCondition := findNodeCondition(node, v1.NodeReady)
	if nodeReadyCondition == nil {
		glog.Warningf("v1.NodeReady condition not set on node %s", node.Name)
		return false
	}
	if nodeReadyCondition.Status != v1.ConditionTrue {
		glog.V(4).Infof("node %q not ready: %v", node.Name, nodeReadyCondition)
		return false
	}

	networkUnavailableCondition := findNodeCondition(node, v1.NodeNetworkUnavailable)
	if networkUnavailableCondition != nil {
		if networkUnavailableCondition.Status != v1.ConditionFalse && networkUnavailableCondition.Status != v1.ConditionUnknown {
			glog.V(4).Infof("node %q not ready: %v", node.Name, networkUnavailableCondition)
			return false
		}
	} else {
		glog.V(4).Infof("v1.NodeNetworkUnavailable condition not set on node %s", node.Name)
	}

	return true
}
147227
func (fbo *folderBlockOps) GetDirtyFileBlockRefs(
	lState *kbfssync.LockState) []data.BlockRef {
	fbo.blockLock.RLock(lState)
	defer fbo.blockLock.RUnlock(lState)
	var dirtyRefs []data.BlockRef
	for ref := range fbo.unrefCache {
		dirtyRefs = append(dirtyRefs, ref)
	}
	return dirtyRefs
}