Return {@code true} if the provided code is a valid close status code.
550029
public static boolean isValid(int code) {
        if (code >= 0 && code <= 999 || code >= 1004 && code <= 1006
                || code >= 1012 && code <= 2999) {
            return false;
        }
        return true;
    }
33485
public boolean isValid() {
        boolean valid = false;
        try {
            validate();
            valid = true;
        } catch(Exception e) {
            // File is not valid if exception thrown parsing.
            valid = false;
        }
    
        return valid;
    }
135887
public static function validateCloseCode($code)
    {
        return !($code < 1000 || //Not used
            $code > 5000 || //Invalid
            ($code > 1015 && $code < 3000) || //Range 1000-2999 is reserved for protocol, but currently there are no codes above 1015
            $code === 1004 || //Reserved
            $code === self::CODE_NO_STATUS || //Reserved (internal app usage)
            $code === self::CODE_ABNORMAL || //Reserved (internal app usage)
            ($code > 1011 && $code <= 1015) //Not defined by RFC, but from reserved range (exc. 1015 is reserved for app int. use)
        );
    }
813819
static boolean isValid(int type) {
        // make sure this is always synchronized with Zoodefs!!
        switch (type) {
        case OpCode.notification:
            return false;
        case OpCode.create:
        case OpCode.delete:
        case OpCode.createSession:
        case OpCode.exists:
        case OpCode.getData:
        case OpCode.setData:
        case OpCode.sync:
        case OpCode.getACL:
        case OpCode.setACL:
        case OpCode.getChildren:
        case OpCode.getChildren2:
        case OpCode.ping:
        case OpCode.closeSession:
        case OpCode.setWatches:
            return true;
        default:
            return false;
        }
    }
99913
private boolean closeInternal(ErrorCode errorCode, @Nullable IOException errorException) {
    assert (!Thread.holdsLock(this));
    synchronized (this) {
      if (this.errorCode != null) {
        return false;
      }
      if (source.finished && sink.finished) {
        return false;
      }
      this.errorCode = errorCode;
      this.errorException = errorException;
      notifyAll();
    }
    connection.removeStream(id);
    return true;
  }
1324386
def apply_status_code(status:)
      raise EntityClosedError if closed?
      case status.to_i
      when 429
        @throttle = true
        @error = true
        @fault = false
      when 400..499
        @error = true
        @throttle = false
        @fault = false
      when 500..599
        @fault = true
        @error = false
        @throttle = false
      end

      @http_response ||= {}
      @http_response[:status] = status.to_i
    end
848473
public boolean isValid() {
    if (lc_dev_proxy == null) {
      return false;
    }
    try {
      lc_dev_proxy.ping();
    }
    catch (DevFailed dv) {
      close();
      return false;
    }
    return true;
  }
484857
def is_code(self):
        """"""
        if self.cell_type == 'code':
            return True
        if self.cell_type == 'raw' and 'active' in self.metadata:
            return True
        return False
503890
@JSFProperty(defaultValue = "true", tagExcluded = true)
    public boolean isValid()
    {
        Object value = getStateHelper().get(PropertyKeys.valid);
        if (value != null)
        {
            return (Boolean) value;        
        }
        return true; 
    }
146320
public boolean containsNone(int start, int end) {
        if (start < MIN_VALUE || start > MAX_VALUE) {
            throw new IllegalArgumentException("Invalid code point U+" + Utility.hex(start, 6));
        }
        if (end < MIN_VALUE || end > MAX_VALUE) {
            throw new IllegalArgumentException("Invalid code point U+" + Utility.hex(end, 6));
        }
        int i = -1;
        while (true) {
            if (start < list[++i]) break;
        }
        return ((i & 1) == 0 && end < list[i]);
    }
1023728
@Override
    public boolean isValid() {
        if (!_isValid && com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_CORE.isLoggable(Level.FINE)) {
            //only log this if it is invalid
            String s = _isValid + appNameAndIdString;
            LoggingUtil.SESSION_LOGGER_CORE.logp(Level.FINE, methodClassName, "isValid", s);
        }
        return _isValid;
    }
938107
public static void checkOperatorIsValid(int operatorCode) {
        switch (operatorCode) {
            case OPERATOR_LT:
            case OPERATOR_LE:
            case OPERATOR_EQ:
            case OPERATOR_NE:
            case OPERATOR_GE:
            case OPERATOR_GT:
            case OPERATOR_UNKNOWN:
                return;
            default:
                throw new IllegalStateException(String.format(Locale.US, ERROR_INVALID_CODE, operatorCode));
        }
    }
516016
public static boolean isRedirect(int statusCode) {
    switch (statusCode) {
      case HttpStatusCodes.STATUS_CODE_MOVED_PERMANENTLY: // 301
      case HttpStatusCodes.STATUS_CODE_FOUND: // 302
      case HttpStatusCodes.STATUS_CODE_SEE_OTHER: // 303
      case HttpStatusCodes.STATUS_CODE_TEMPORARY_REDIRECT: // 307
        return true;
      default:
        return false;
    }
  }
69718
public boolean isFinished()
	{
		if (finished)
			return true;

		try
		{
			final int code = exitCode();

			finished(code);

			return true;
		}
		catch (IllegalThreadStateException e)
		{
			return false;
		}
	}
1193619
@Override
  public void validateColorCode(String code) {
    Preconditions.checkNotEmpty(code, "color code is empty");
    Integer numericColorCode = Integer.valueOf(code);
    boolean isColorCodeValid = numericColorCode > 0 && numericColorCode < 257;
    if (!isColorCodeValid) {
      throw new IllegalArgumentException("color code should be a number between 1 and 256");
    }
  }
162131
public static void verifyScriptExecutionStatus(final Map<String, String> resultMap) {
        if (ZERO_SCRIPT_EXIT_CODE.equals(resultMap.get(SCRIPT_EXIT_CODE))) {
            resultMap.put(RETURN_CODE, RETURN_CODE_SUCCESS);
        } else {
            resultMap.put(RETURN_CODE, RETURN_CODE_FAILURE);
        }
    }
1248842
public boolean isDeviceCodeError() {
        ErrorObject errorObject = getErrorObject();
        if (errorObject == null) {
            return false;
        }
        String code = errorObject.getCode();
        if (code == null) {
            return false;
        }
        switch (code) {
            case "authorization_pending":
            case "slow_down":
            case "access_denied":
            case "code_expired":
                return true;
            default:
                return false;
        }
    }