def is_agent_running(self, fail_if_running=False, fail_if_not_running=False):
        """Returns true if the agent service is running, as determined by the pidfile.

        This will optionally raise an Exception with an appropriate error message if the agent is not running.

        @param fail_if_running:  True if the method should raise an Exception with a message about where the pidfile
            was read from.
        @param fail_if_not_running: True if the method should raise an Exception with a message about where the pidfile
            was read from.

        @type fail_if_running: bool
        @type fail_if_not_running: bool

        @return: True if the agent process is already running.
        @rtype: bool

        @raise AgentAlreadyRunning
        @raise AgentNotRunning
        """
        self._log_init_debug(scalyr_util.get_pid_tid() % 'Checking if agent is running %s')
        pid = self.__read_pidfile()

        if fail_if_running and pid is not None:
            raise AgentAlreadyRunning('The pidfile %s exists and indicates it is running pid=%d' % (
                self.__pidfile, pid))

        if fail_if_not_running and pid is None:
            raise AgentNotRunning('The pidfile %s does not exist or listed process is not running.' % self.__pidfile)

        return pid is not None
dataset/ETHPy150Open scalyr/scalyr-agent-2/scalyr_agent/platform_posix.py/PosixPlatformController.is_agent_running/swapped operands of `%`