Checks whether browser is dead. Used to catch
situations like "Error communicating with the remote browser. It may have died." exceptions

@return true if browser is dead
764117
private static boolean isBrowserDead() {
        try {
            if (((FramesTransparentWebDriver) getDriver()).getWrappedDriver() instanceof AppiumDriver) {
                getDriver().getPageSource();
            } else {
                getDriver().getCurrentUrl();
            }
            return false;
        } catch (Throwable t) {
            Report.jenkins("*****BROWSER IS DEAD ERROR***** ", t);
            return true;
        }
    }
503383
def is_alive(self):
        """"""
        null = chr(0)
        if self.device is None:
            return {"is_alive": False}
        if self.transport == "telnet":
            try:
                # Try sending IAC + NOP (IAC is telnet way of sending command
                # IAC = Interpret as Command (it comes before the NOP)
                self.device.write_channel(telnetlib.IAC + telnetlib.NOP)
                return {"is_alive": True}
            except UnicodeDecodeError:
                # Netmiko logging bug (remove after Netmiko >= 1.4.3)
                return {"is_alive": True}
            except AttributeError:
                return {"is_alive": False}
        else:
            # SSH
            try:
                # Try sending ASCII null byte to maintain the connection alive
                self.device.write_channel(null)
                return {"is_alive": self.device.remote_conn.transport.is_active()}
            except (socket.error, EOFError):
                # If unable to send, we can tell for sure that the connection is unusable
                return {"is_alive": False}
        return {"is_alive": False}
803834
public boolean isDone() {
        final boolean isTraceOn = svLogger.isLoggable(Level.FINER);
        if (isTraceOn)
            svLogger.entering(CLASS_NAME, "isDone", toString());

        try {
            if (!ivDone) {
                ivDone = (ivServer != null ? ivServer.isDone() : true);
            }
        } catch (RemoteException e) {
            // Throw an EJBException to the client.
            throw initCause(new EJBException(e));
        }

        if (isTraceOn)
            svLogger.exiting(CLASS_NAME, "isDone", Boolean.valueOf(ivDone));
        return ivDone;
    }
505602
public boolean isRemoteFilter()
    {
        for (int i = 0; (this.getMessageListener(i) != null); i++)
        {
            if (this.getMessageListener(i) instanceof Remote)
                return true;
        }
        return false;
    }
433706
public static function checkBrowserKonqueror()
    {
        if (stripos(self::$userAgentString, 'Konqueror') !== false) {
            $aresult = explode(' ', stristr(self::$userAgentString, 'Konqueror'));
            $aversion = explode('/', $aresult[0]);
            if (isset($aversion[1])) {
                self::$browser->setVersion($aversion[1]);
            }
            self::$browser->setName(Browser::KONQUEROR);

            return true;
        }

        return false;
    }
844971
private static boolean isInternetReachable()
    {
        try {
            final URL url = new URL("http://www.google.com");
            final HttpURLConnection urlConnect = (HttpURLConnection)url.openConnection();
            urlConnect.setConnectTimeout(1000);
            urlConnect.getContent();
            urlConnect.disconnect();
        } catch (UnknownHostException e) {
            return false;
        } catch (IOException e) {
            return false;
        }
        return true;
    }
252332
def is_alive(self):
        
        if hasattr(self.device, 'remote_conn'):
            return self.device.remote_conn.transport.is_active() and self._xml_agent_alive
        return False
1089948
protected function checkBrowserOmniWeb()
    {
        if (stripos($this->_agent, 'omniweb') !== false) {
            $aresult = explode('/', stristr($this->_agent, 'omniweb'));
            $aversion = explode(' ', isset($aresult[1]) ? $aresult[1] : '');
            $this->setVersion($aversion[0]);
            $this->setBrowser(self::BROWSER_OMNIWEB);
            return true;
        }
        return false;
    }
197936
protected boolean checkBuffer() throws IOException {
        if (!enableMultiReadofPostData) {
            if (null != this.buffer) {
                if (this.buffer.hasRemaining()) {
                    return true;
                }
                this.buffer.release();
                this.buffer = null;
            }
            try {
                this.buffer = this.isc.getRequestBodyBuffer();
                if (null != this.buffer) {
                    // record the new amount of data read from the channel
                    this.bytesRead += this.buffer.remaining();
                    // Tr.debug(tc, "Buffer=" + WsByteBufferUtils.asString(this.buffer));
                    return true;
                }
                return false;
            } catch (IOException e) {
                this.error = e;
                throw e;
            }
        } else {
            return checkMultiReadBuffer();
        }
    }
976990
public boolean enabled() {
        boolean isEnabled = false;
        try {
            // adding additional check for disabled attribute, due to issues with safari
            isEnabled = (element.getWebElement().isEnabled() && !element.get().allAttributes().containsKey("disabled"));
        } catch (NullPointerException | NoSuchElementException e) {
            // Null pointer means the element was deleted, and there has no attributes. No such element means the same thing
            log.info(e);
        }
        return isEnabled;
    }
1043709
@Override
    public boolean isEmpty() {
        try {
            // we use this lock to make
            smartLock.readLock().acquire();

            if (currentConsumers.get() > 0)
                synchronize(currentConsumers.get());

            return super.isEmpty();
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        } finally {
            smartLock.readLock().release();
        }
    }
142416
public function killSession() {
      $response = $this->request('get', 'killSession');
      if ($response->getStatusCode() != 200) {
         $body = json_decode($response->getBody()->getContents());
         throw new Exception(ErrorHandler::getMessage($body[0]));
      }
      return true;
   }
1021937
def is_exhausted(self):
        
        retry_counts = (self.total, self.connect, self.read, self.redirect, self.status)
        retry_counts = list(filter(None, retry_counts))
        if not retry_counts:
            return False

        return min(retry_counts) < 0
1340213
def is_alive(self):
        """"""
        null = chr(0)
        try:
            if self.device is None:
                return {"is_alive": False}
            else:
                # Try sending ASCII null byte to maintain the connection alive
                self._send_command(null)
        except (socket.error, EOFError):
            # If unable to send, we can tell for sure that the connection is unusable,
            # hence return False.
            return {"is_alive": False}
        return {"is_alive": self.device.remote_conn.transport.is_active()}
1079378
public static boolean isRserveRunning() {
        try {
            RConnection c = new RConnection();
            Log.Out.println("Rserve is running.");
            c.close();
            return true;
        } catch (Exception e) {
            Log.Err.println("First connect try failed with: " + e.getMessage());
        }
        return false;
    }
984572
public boolean isRunning() {
        try {
            client.get("/");
            return true;
        } catch (IOException e) {
            LOGGER.debug("isRunning()", e);
            return false;
        }
    }
1298518
protected function checkBrowserVivaldi() {
        if( stripos($this->_agent,'Vivaldi') !== false ) {
            $aresult = explode('/',stristr($this->_agent,'Vivaldi'));
            $aversion = explode(' ',$aresult[1]);
            $this->setVersion($aversion[0]);
            $this->setBrowser(self::BROWSER_VIVALDI);
            return true;
        }
        return false;
    }