@param string $process_status

@return bool
322518
public function on($process_status = "false")
    {
        if (is_array($process_status))
            return (bool) in_array($this->process_status, $process_status);
        return ($this->process_status == $process_status);
    }
496165
public static function is_active($status) {
        // List of statuses which doesn't require any further processing.
        $finalstatuses = [
            self::DATAREQUEST_STATUS_COMPLETE,
            self::DATAREQUEST_STATUS_CANCELLED,
            self::DATAREQUEST_STATUS_REJECTED,
            self::DATAREQUEST_STATUS_DOWNLOAD_READY,
            self::DATAREQUEST_STATUS_EXPIRED,
            self::DATAREQUEST_STATUS_DELETED,
        ];

        return !in_array($status, $finalstatuses);
    }
214486
public function process($last_call = true)
    {
        if (self::is_ajax(true)) {
            // AJAX call
            return $this->process_data($last_call);
        }
        return true;
    }
784619
public static function exceptionApplies(Process $process): bool
    {
        if (Node\FatalException::exceptionApplies($process)) {
            $error = json_decode($process->getErrorOutput(), true);

            return $error['message'] === 'The idle timeout has been reached.';
        }

        return false;
    }
376645
public static function isSupported()
    {
        if (null === self::$supported) {
            self::$supported = function_exists('cli_set_process_title') || function_exists('setproctitle');
        }

        return self::$supported;
    }
1023913
public function checkHealth()
    {
        if (!$this->process->isRunning()) {
            if ($this->status == self::STATUS_CLEANINGUP || $this->status == self::STATUS_CLEANEDUP) {
                //okay so we're ready to stop!
                $this->status = self::STATUS_DEAD;
                return true;
            } elseif ($this->status == ChildProcessContainer::STATUS_SLEEPY) {
                //okay so we're ready to stop!
                $this->status = self::STATUS_DEAD;
                return true;
            }
            $this->status = self::STATUS_DEAD;
            return false;
        } else {
            return true;
        }

    }
209381
public static function switchStatus(string $status)
    {
        if ($status == "off") {
            self::$status = "off";
        } elseif ($status == "on") {
            self::$status = "on";
        } else {
            die("TaskBar : Undefined status '$status'. Status must be 'on' or 'off'. ");
        }
        return (1);
    }
955549
def is_running(process_id: int) -> bool:
    
    pstr = str(process_id)
    encoding = sys.getdefaultencoding()
    s = subprocess.Popen(["ps", "-p", pstr], stdout=subprocess.PIPE)
    for line in s.stdout:
        strline = line.decode(encoding)
        if pstr in strline:
            return True
    return False
344026
private function checkCacheContentEvent($check_status = true)
    {
        // Checks if a service cache-control exists
        if (null === $this->cache_content) {
            return false;
        }

        // Checks if the target event is not a main contentset
        if (
            $this->object instanceof ContentSet
            && true === is_array($this->object->getPages())
            && 0 < $this->object->getPages()->count()
        ) {
            return false;
        }

        return true === $check_status ? $this->validator->isValid('cache_status', $this->object) : true;
    }
222215
public function isActive()
    {
        // Get the process id file location for the application.
        $pidFile = $this->config->get('application_pid_file');

        // If the process id file doesn't exist then the daemon is obviously not running.
        if (!is_file($pidFile)) {
            return false;
        }

        // Read the contents of the process id file as an integer.
        $fp = fopen($pidFile, 'r');
        $pid = fread($fp, filesize($pidFile));
        $pid = (int) $pid;
        fclose($fp);

        // Check to make sure that the process id exists as a positive integer.
        if (!$pid) {
            return false;
        }

        // Check to make sure the process is active by pinging it and ensure it responds.
        if (!posix_kill($pid, 0)) {
            // No response so remove the process id file and log the situation.
            @ unlink($pidFile);

            $this->getLogger()->warning('The process found based on PID file was unresponsive.');

            return false;
        }

        return true;
    }
796268
public function isStatic($status = null)
    {
        $this->is_static = $status !== null ? $status : $this->is_static;
        return $this->is_static ;
    }
912917
def _pid_is_alive(cls, pid, timeout):
        """"""
        try:
            proc = psutil.Process(pid)
        except psutil.NoSuchProcess:
            return False

        try:
            proc.wait(timeout=timeout)
        except psutil.TimeoutExpired:
            return True

        return False
1272985
public function isProcessRunning(bool $throwsException = false): bool
    {
        $running = false;
        try {
            $pid = $this->getPid();
            $isRunning = $this->process->isRunning($pid);
            if ($isRunning) {
                $this->logger->debug("Pid '${pid}' running.");
                $running = true;
            } else {
                $this->logger->debug("Pid '${pid}' not running.");
            }
        } catch (Exception\PidNotFoundException $e) {
            if ($throwsException) {
                throw $e;
            }
        }

        return $running;
    }
473874
public function isSuccessful()
    {
        if (!$this->testMdSignatures()) {
            return false;
        }

        return in_array($this->getStatus(), [self::STATUS_PENDING, self::STATUS_PROCESSED]);
    }
1193650
public function check() : void {
        $processesInfo = $this->getProcessesInfo();

        foreach($this->processes as $process) {
            foreach($processesInfo as $processInfo) {
                if( Str::startsWith($processInfo->getCommand(), $process->getCommand()) ) {
                    $process->setInfo($processInfo);
                    break 2;
                }
            }
        }

        $this->checked = true;
    }
962348
public function statusExist($status)
    {
        $generator = $this->getStatuses();
        $list = iterator_to_array($generator);

        return in_array($status, $list);
    }
1145801
protected function process_status_change($oldstatus) {
        // Store the dependent status.
        $prevalue = $this->dependentsetting->get_status();
        // Store the current status.
        $currentstatus = $this->setting->get_status();
        if ($currentstatus == base_setting::NOT_LOCKED) {
            if ($prevalue == base_setting::LOCKED_BY_HIERARCHY &&
                    !$this->evaluate_disabled_condition($this->setting->get_value())) {
                // Dependency has changes, is not fine, unlock the dependent setting.
                $this->dependentsetting->set_status(base_setting::NOT_LOCKED);
            }
        } else {
            // Make sure the dependent setting is also locked, in this case by hierarchy.
            $this->dependentsetting->set_status(base_setting::LOCKED_BY_HIERARCHY);
        }
        // Return true if the dependent setting has changed.
        return ($prevalue != $this->dependentsetting->get_status());
    }