// IsMining returns whether or not the CPU miner has been started and is
// therefore currenting mining.
//
// This function is safe for concurrent access.
484802
func (m *CPUMiner) IsMining() bool {
	m.Lock()
	defer m.Unlock()

	return m.started
}
838886
func (tx *transaction) hasBlock(hash *chainhash.Hash) bool {
	// Return true if the block is pending to be written on commit since
	// it exists from the viewpoint of this transaction.
	if _, exists := tx.pendingBlocks[*hash]; exists {
		return true
	}

	return tx.hasKey(bucketizedKey(blockIdxBucketID, hash[:]))
}
829246
func (s *GrpcServer) IsRunning() bool {
	s.lock.Lock()
	defer s.lock.Unlock()

	return s.running
}
411200
func (c *criClient) IsRunning(ep *endpoint.Endpoint) bool {
	if c == nil {
		return false
	}

	podID := ep.GetContainerID()

	if podID == "" {
		return false
	}

	pssr := criRuntime.PodSandboxStatusRequest{
		PodSandboxId: podID,
	}
	ns := namespaces.WithNamespace(context.Background(), k8sContainerdNamespace)
	cont, err := c.RuntimeServiceClient.PodSandboxStatus(ns, &pssr)
	if err == criStore.ErrNotExist {
		return false
	}
	if err != nil {
		log.WithError(err).Debugf("unable to get pod sandbox status of %v", pssr)
		return false
	}

	return cont.GetStatus().State == criRuntime.PodSandboxState_SANDBOX_READY
}
1296637
func IsRunning(c cookoo.Context, p *cookoo.Params) (interface{}, cookoo.Interrupt) {
	cli := p.Get("client", nil).(client.Client)
	count := p.Get("count", 20).(int)
	k := client.NewKeysAPI(cli)
	for i := 0; i < count; i++ {
		_, err := k.Get(dctx(), "/", &client.GetOptions{})
		if err == nil {
			return true, nil
		}
		log.Infof(c, "Waiting for etcd to come online.")
		time.Sleep(250 * time.Millisecond)
	}
	log.Errf(c, "Etcd is not answering after %d attempts.", count)
	return false, &cookoo.FatalError{"Could not connect to Etcd."}
}
460757
func IsHasherImplemented(hasher string) bool {
	switch hasher {
	case
		Argon2Hasher,
		BCryptHasher,
		BCryptSHA256Hasher,
		PBKDF2SHA1Hasher,
		PBKDF2SHA256Hasher:
		return true
	}

	return false
}
1364600
func IsRunning() (bool, error) {
	// On windows casting the error to exec.Error does not yield a os.PathError type
	// It's easyer to just return false before even trying to execute an external command
	// on windows at least
	if runtime.GOOS == "windows" {
		return false, nil
	}

	// TODO(ericsnow) This function should be fixed to precisely match
	// the equivalent shell script line in service/discovery.go.

	cmd := exec.Command(initctlPath, "--system", "list")
	_, err := cmd.CombinedOutput()
	if err == nil {
		return true, nil
	}

	if common.IsCmdNotFoundErr(err) {
		return false, nil
	}
	// Note: initctl will fail if upstart is installed but not running.
	// The error message will be:
	//   Name "com.ubuntu.Upstart" does not exist
	return false, errors.Annotatef(err, "exec %q failed", initctlPath)
}
966987
func (m *CPUMiner) HashesPerSecond() float64 {
	m.Lock()
	defer m.Unlock()

	// Nothing to do if the miner is not currently running.
	if !m.started {
		return 0
	}

	return <-m.queryHashesPerSec
}
1248118
func IsRunning() (string, error) {
	var (
		cmdOut []byte
		err    error
		path   string
	)
	cmd := "fcagent"
	args := []string{"echo"}

	if path, err = exec.LookPath(cmd); err != nil {
		log.Debug(err)
	}
	log.Debug(path, args[0])

	if cmdOut, err = exec.Command(cmd, args...).Output(); err != nil {
		log.Debug(err)
	}
	return string(cmdOut), err
}
343996
func (s *stackV1Beta2) IsColliding(servicesClient corev1.ServiceInterface, st Stack) error {
	return nil
}
1323638
func (i Intersection) IsOccurring(t time.Time) bool {
	for _, r := range i {
		if r.IsOccurring(t) == false {
			return false
		}
	}

	return true
}
809011
func (p Phase) IsRunning() bool {
	if p.IsTerminal() {
		return false
	}
	switch p {
	case QUIESCE, IMPORT, VALIDATION, SUCCESS:
		return true
	default:
		return false
	}
}
886838
func (ac *ArrayComprehension) IsGround() bool {
	return ac.Term.IsGround() && ac.Body.IsGround()
}
869360
func (sm *SyncManager) IsCurrent() bool {
	reply := make(chan bool)
	sm.msgChan <- isCurrentMsg{reply: reply}
	return <-reply
}
822038
func checkRunning() bool {
	var zone string
	var err error

	if connection != nil {
		err = connection.sysobj.Call(dbusInterface+".getDefaultZone", 0).Store(&zone)
		return err == nil
	}
	return false
}
899327
func (mp *TxPool) IsTransactionInPool(hash *chainhash.Hash) bool {
	// Protect concurrent access.
	mp.mtx.RLock()
	inPool := mp.isTransactionInPool(hash)
	mp.mtx.RUnlock()

	return inPool
}
725151
func (s *set) IsGround() bool {
	return !s.Until(func(x *Term) bool {
		return !x.IsGround()
	})
}