Helper that returns whether the instance is Up of Down.
@param status {@link InstanceStatus} instance to evaluate the status from
@return {@code true} if {@link InstanceStatus} is UP
762264
protected Boolean parseInstanceStatus(InstanceStatus status) {
		if (status == null) {
			return null;
		}
		return status == InstanceStatus.UP;
	}
1332613
def is_alive(self):
        
        running = False
        if not self.instance_id:
            return False

        try:
            log.debug("Getting information for instance %s",
                      self.instance_id)
            running = self._cloud_provider.is_instance_running(
                self.instance_id)
        except Exception as ex:
            log.debug("Ignoring error while looking for vm id %s: %s",
                      self.instance_id, str(ex))
        if running:
            log.debug("node `%s` (instance id %s) is up and running",
                      self.name, self.instance_id)
            self.update_ips()
        else:
            log.debug("node `%s` (instance id `%s`) still building...",
                      self.name, self.instance_id)

        return running
455558
public static boolean checkResponseStatus(JSONObject jsonResponse) {

        if (jsonResponse != null) {

            if (jsonResponse.getBoolean("ok")) {

                return true;
            } else {

                System.err.println("The API returned the following error: " + jsonResponse.getString("description"));
            }
        } else {

            System.err.println("JSON Response was null, something went wrong...");
        }

        return false;
    }
59485
public boolean status(int responseCode) {
		if (urlConnection instanceof HttpURLConnection) {
			HttpURLConnection http = (HttpURLConnection) urlConnection;
			try {
				return http.getResponseCode() == responseCode;
			} catch (IOException e) {
				e.printStackTrace();
				return false;
			}
		} else
			return false;
	}
767758
def is_state(self, status):
        
        if status == self.state:
            return True
        # Now low status
        if status == 'o' and self.state == u'UP':
            return True
        if status == 'd' and self.state == u'DOWN':
            return True
        if status in ['u', 'x'] and self.state == u'UNREACHABLE':
            return True
        return False
254283
def status()
            joinThread()
            lastconnerror = getCString()
            status = getCString()
            uptime = 0
            begin
                uptime_uint = MiniUPnP.new_uintp()
                r = MiniUPnP.UPNP_GetStatusInfo(@urls.controlURL,
                           @data.servicetype, status, uptime_uint,
                           lastconnerror)
                if r != 0 then
                    raise UPnPException.new, "Error while retriving status info. #{code2error(r)}."
                end
                uptime = MiniUPnP.uintp_value(uptime_uint)
            rescue
                raise
            ensure
                MiniUPnP.delete_uintp(uptime_uint)
            end
            return status.rstrip,lastconnerror.rstrip,uptime
        end
595864
public static void verifyRolloutInStatus(final Rollout rollout, final Rollout.RolloutStatus status) {
        if (!rollout.getStatus().equals(status)) {
            throw new RolloutIllegalStateException("Rollout is not in status " + status.toString());
        }
    }
447995
def status(self, status_id, raise_exception_on_failure=False):
        """"""
        query = {"output": "json", "user_credentials": self.api_key}

        resp = requests.get(
            "%sstatus/%s" % (self._url, status_id), params=query, timeout=self._timeout
        )

        if raise_exception_on_failure and resp.status_code != 200:
            raise DocumentStatusFailure(resp.content, resp.status_code)

        if resp.status_code == 200:
            as_json = json.loads(resp.content)
            if as_json["status"] == "completed":
                as_json["download_key"] = _get_download_key(as_json["download_url"])
            return as_json
        return resp
1374826
public java.util.List<InstanceStatus> getInstanceStatuses() {
        if (instanceStatuses == null) {
            instanceStatuses = new com.amazonaws.internal.SdkInternalList<InstanceStatus>();
        }
        return instanceStatuses;
    }
1263366
public static boolean isContentAlwaysEmpty(HttpStatus status) {
        if (status.codeClass() == HttpStatusClass.INFORMATIONAL) {
            return true;
        }

        switch (status.code()) {
            case 204:
            case 205:
            case 304:
                return true;
        }
        return false;
    }
1033785
def is_running(self):
        
        self.__update_status()
        return self.status == Status.UP or self.status == Status.DECOMMISSIONED
628279
def is_available(self):
        
        # if the availability flag is raised, return True immediately.
        # NOTE: subsequent API failures will lower this flag. we do this here
        # to ensure we don't keep hitting Cuckoo with requests while
        # availability is there.
        if self.server_available:
            return True

        # otherwise, we have to check with the cloud.
        else:
            try:
                response = self._request("cuckoo/status")

                # we've got cuckoo.
                if response.status_code == 200:
                    self.server_available = True
                    return True

            except sandboxapi.SandboxError:
                pass

        self.server_available = False
        return False
1288233
@Override
    public boolean statusUpdate(final String appName, final String id,
                                final InstanceStatus newStatus, String lastDirtyTimestamp,
                                final boolean isReplication) {
        if (super.statusUpdate(appName, id, newStatus, lastDirtyTimestamp, isReplication)) {
            replicateToPeers(Action.StatusUpdate, appName, id, null, newStatus, isReplication);
            return true;
        }
        return false;
    }
1037170
def is_available(self):
        
        # if the availability flag is raised, return True immediately.
        # NOTE: subsequent API failures will lower this flag. we do this here
        # to ensure we don't keep hitting Joe with requests while availability
        # is there.
        if self.server_available:
            return True

        # otherwise, we have to check with the cloud.
        else:

            try:
                self.server_available = self.jbx.server_online()
                return self.server_available
            except jbxapi.JoeException:
                pass

        self.server_available = False
        return False
400575
public com.google.api.ads.adwords.axis.v201809.cm.SharedSetStatus getStatus() {
        return status;
    }
1253488
public static PStatus toProto(Status status) {
    switch (status.getCode()) {
      case ABORTED:
        return PStatus.ABORTED;
      case ALREADY_EXISTS:
        return PStatus.ALREADY_EXISTS;
      case CANCELLED:
        return PStatus.CANCELED;
      case DATA_LOSS:
        return PStatus.DATA_LOSS;
      case DEADLINE_EXCEEDED:
        return PStatus.DEADLINE_EXCEEDED;
      case FAILED_PRECONDITION:
        return PStatus.FAILED_PRECONDITION;
      case INTERNAL:
        return PStatus.INTERNAL;
      case INVALID_ARGUMENT:
        return PStatus.INVALID_ARGUMENT;
      case NOT_FOUND:
        return PStatus.NOT_FOUND;
      case OK:
        return PStatus.OK;
      case OUT_OF_RANGE:
        return PStatus.OUT_OF_RANGE;
      case PERMISSION_DENIED:
        return PStatus.PERMISSION_DENIED;
      case RESOURCE_EXHAUSTED:
        return PStatus.RESOURCE_EXHAUSTED;
      case UNAUTHENTICATED:
        return PStatus.UNAUTHENTICATED;
      case UNAVAILABLE:
        return PStatus.UNAVAILABLE;
      case UNIMPLEMENTED:
        return PStatus.UNIMPLEMENTED;
      case UNKNOWN:
        return PStatus.UNKNOWN;
      default:
        return PStatus.UNKNOWN;
    }
  }
150188
private static Status getStatus(Throwable throwable) {
    Status status = Status.UNKNOWN;

    if (throwable instanceof StatusRuntimeException) {
      status = ((StatusRuntimeException) throwable).getStatus();
    } else if (throwable instanceof StatusException) {
      status = ((StatusException) throwable).getStatus();
    }
    return status;
  }