Determines whether or not a given container is still alive.
326767
def is_alive(self, container: Container) -> bool:
        
        uid = container.uid
        r = self.__api.get('containers/{}/alive'.format(uid))

        if r.status_code == 200:
            return r.json()

        if r.status_code == 404:
            raise KeyError("no container found with given UID: {}".format(uid))

        self.__api.handle_erroneous_response(r)
510600
def determine_inside_container(self):
        
        tokenum, value = self.current.tokenum, self.current.value
        ending_container = False
        starting_container = False

        if tokenum == OP:
            # Record when we're inside a container of some sort (tuple, list, dictionary)
            # So that we can care about that when determining what to do with whitespace
            if value in ['(', '[', '{']:
                # add to the stack because we started a list
                self.containers.append(value)
                starting_container = True

            elif value in [')', ']', '}']:
                # not necessary to check for correctness
                self.containers.pop()
                ending_container = True

        self.just_ended_container = not len(self.containers) and ending_container
        self.just_started_container = len(self.containers) == 1 and starting_container
        self.in_container = len(self.containers) or self.just_ended_container or self.just_started_container
12302
def keep_alive(self, val: bool) -> None:
        
        self._keepalive = val
        if self._keepalive_handle:
            self._keepalive_handle.cancel()
            self._keepalive_handle = None
490483
def should_execute(self, workload):
        
        if not self._suspended.is_set():
            return True
        workload = unwrap_workload(workload)
        return hasattr(workload, 'keep_alive') and getattr(workload, 'keep_alive')
1229652
public boolean isAlive(Connection conn)
    {
        try
        {
            return con != null ? !con.isClosed() : false;
        }
        catch (SQLException e)
        {
            log.error("IsAlive check failed, running connection was invalid!!", e);
            return false;
        }
    }
1000963
public function isAlive()
    {
        if ($this->pid < 1) {
            return false;
        }

        $status = null;
        $pid = pcntl_wait($status, WNOHANG);

        switch ($pid) {
            case -1:
                throw new \RuntimeException('pcntl_wait failed.');

            case $this->pid:
                $this->pid = -1;

                return false;

            case 0:
                return true;
        }

        // Other pid exited.
        return true;
    }
72027
public Boolean isKeepAlive(boolean useDefault) {

        if (m_keepAlive != null) {
            return m_keepAlive;
        }
        if (useDefault) {
            return Boolean.TRUE;
        } else {
            return null;
        }

    }
55140
def is_running(config, container, *args, **kwargs):
    '''
    
    '''
    try:
        infos = _get_container_infos(config, container)
        return (infos if infos.get('State', {}).get('Running') else None)
    except Exception:
        return None
734306
def is_dead(self, proc, name):
        
        LOGGER.debug('Checking %s (%r)', name, proc)
        try:
            status = proc.status()
        except psutil.NoSuchProcess:
            LOGGER.debug('NoSuchProcess: %s (%r)', name, proc)
            return True

        LOGGER.debug('Process %s (%s) status: %r (Unresponsive Count: %s)',
                     name, proc.pid, status, self.unresponsive[name])
        if status in _PROCESS_RUNNING:
            return False
        elif status == psutil.STATUS_ZOMBIE:
            try:
                proc.wait(0.1)
            except psutil.TimeoutExpired:
                pass
            try:
                proc.terminate()
                status = proc.status()
            except psutil.NoSuchProcess:
                LOGGER.debug('NoSuchProcess: %s (%r)', name, proc)
                return True
        return status in _PROCESS_STOPPED_OR_DEAD
406403
def is_active(self):
    """"""
    if not self._multiplexer:
      return False
    return bool(self._multiplexer.PluginRunToTagToContent(metadata.PLUGIN_NAME))
1006379
def is_active(self):
        
        self.open()
        active = lvm_lv_is_active(self.__lvh)
        self.close()
        return bool(active)
780235
def is_pod_running(self, pod):
        
        # FIXME: Validate if this is really the best way
        is_running = (
            pod is not None and
            pod.status.phase == 'Running' and
            pod.status.pod_ip is not None and
            pod.metadata.deletion_timestamp is None and
            all([cs.ready for cs in pod.status.container_statuses])
        )
        return is_running
1105618
def container_running(self, container_name):
        
        filters = {
            "name": container_name,
            "status": "running",
        }

        for container in self.client.containers.list(filters=filters):
            if container_name == container.name:
                return container
        return None
821372
def process_is_alive?(pid)
      begin
        Process.kill(0, pid)
        return true
      rescue Errno::ESRCH
        return false
      rescue SystemCallError => e
        return true
      end
    end
1040171
static boolean isAlive(Vertex vertex) {
        if (vertex == null) return false;

        try {
            return Sets.newHashSet(Schema.BaseType.values()).contains(Schema.BaseType.valueOf(vertex.label()));
        } catch (IllegalStateException e) {
            return false;
        }
    }
1283381
def is_alive(self):
        """"""
        null = chr(0)
        if self.remote_conn is None:
            log.error("Connection is not initialised, is_alive returns False")
            return False
        if self.protocol == "telnet":
            try:
                # Try sending IAC + NOP (IAC is telnet way of sending command)
                # IAC = Interpret as Command; it comes before the NOP.
                log.debug("Sending IAC + NOP")
                # Need to send multiple times to test connection
                self.remote_conn.sock.sendall(telnetlib.IAC + telnetlib.NOP)
                self.remote_conn.sock.sendall(telnetlib.IAC + telnetlib.NOP)
                self.remote_conn.sock.sendall(telnetlib.IAC + telnetlib.NOP)
                return True
            except AttributeError:
                return False
        else:
            # SSH
            try:
                # Try sending ASCII null byte to maintain the connection alive
                log.debug("Sending the NULL byte")
                self.write_channel(null)
                return self.remote_conn.transport.is_active()
            except (socket.error, EOFError):
                log.error("Unable to send", exc_info=True)
                # If unable to send, we can tell for sure that the connection is unusable
                return False
        return False
201253
def check_starting!(service_pod, container)
      raise "service stopped" if !@service_pod.running?
      raise "service redeployed" if @service_pod.deploy_rev != service_pod.deploy_rev
      raise "container recreated" if @container.id != container.id
      raise "container restarted" if @container.started_at != container.started_at
    end