Checks that the verifier contains only safe characters
        and is no shorter than lower and no longer than upper.
13708
def check_verifier(self, verifier):
        
        lower, upper = self.verifier_length
        return (set(verifier) <= self.safe_characters and
                lower <= len(verifier) <= upper)
62574
protected boolean validate(char[] component, int soffset, int eoffset,
            BitSet generous) {
        return super.validate(component, soffset, eoffset, lax(generous));
    }
851802
private static boolean isNumeric(String value) {
    for (char c : value.toCharArray()) {
      if (!Character.isDigit(c)) {
        return false;
      }
    }
    return true;
  }
257890
def min_length?(value, length)
			has_min_length = coerce_bool (value.length >= length)
			unless has_min_length
				@error = "Error, expected value to have at least #{length} characters, got: #{value.length}"
			end
			has_min_length
		end
454652
private static boolean isValidChar(char c) {
        if ( c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c >= 'a' && c <= 'z' ) {
            return true;
        }
        return c != ' ' && c != '\u00A0' && !Character.isWhitespace(c) && !Character.isWhitespace(c);
    }
597632
private static boolean validateValue(String value) {
    if (value.length() > VALUE_MAX_SIZE || value.charAt(value.length() - 1) == ' ' /* '\u0020' */) {
      return false;
    }
    for (int i = 0; i < value.length(); i++) {
      char c = value.charAt(i);
      if (c == ',' || c == '=' || c < ' ' /* '\u0020' */ || c > '~' /* '\u007E' */) {
        return false;
      }
    }
    return true;
  }
591088
def _check_enclosing_characters(string, opener, closer):
    
    opener_count = string.count(opener)
    closer_count = string.count(closer)
    total = opener_count + closer_count
    if total > 2:
        msg = MORE_THAN_ONE_SET.format(opener, closer)
        raise ValueError(msg)
    elif total == 1:
        msg = INCOMPLETE_SET.format(opener, closer)
        raise ValueError(msg)
    elif opener_count > 1:
        msg = INCORRECT_SET_CONSTITUENT.format(opener)
        raise ValueError(msg)
    elif closer_count > 1:
        msg = INCORRECT_SET_CONSTITUENT.format(closer)
        raise ValueError(msg)
115665
function isNotEmpty() {
        if (_valueType === 'string') {
            _valid = _valid && _value !== '';
        } else if (_valueType instanceof Array) {
            _valid = _valid && _value.length > 0;
        }
        return _guard;
    }
489503
def remove_unsafe_chars(text):
    """"""
    if isinstance(text, six.string_types):
        text = UNSAFE_RE.sub('', text)
    return text
477095
private static boolean validateKey(String key) {
    if (key.length() > KEY_MAX_SIZE
        || key.isEmpty()
        || key.charAt(0) < 'a'
        || key.charAt(0) > 'z') {
      return false;
    }
    for (int i = 1; i < key.length(); i++) {
      char c = key.charAt(i);
      if (!(c >= 'a' && c <= 'z')
          && !(c >= '0' && c <= '9')
          && c != '_'
          && c != '-'
          && c != '*'
          && c != '/') {
        return false;
      }
    }
    return true;
  }
27394
def _validate_empty(self, empty, field, value):
        
        if isinstance(value, Iterable) and len(value) == 0:
            self._drop_remaining_rules(
                'allowed', 'forbidden', 'items', 'minlength', 'maxlength',
                'regex', 'validator')
            if not empty:
                self._error(field, errors.EMPTY_NOT_ALLOWED)
140634
def length(min=None, max=None):
    

    def validate(value):
        if min and len(value) < min:
            return e("{} does not have a length of at least {}", value, min)
        if max and len(value) > max:
            return e("{} does not have a length of at most {}", value, max)
    return validate
396859
private function validateLowerThan(): bool
    {
        if ($this->options['max'] !== null) {
            if ($this->options['inclusive'] === false && $this->value >= $this->options['max']) {
                $this->setError(self::VALIDATOR_ERROR_NUMBER_MUST_BE_LOWER_THAN_MAX);
                return false;
            }

            if ($this->value > $this->options['max']) {
                $this->setError(self::VALIDATOR_ERROR_NUMBER_MUST_BE_LOWER_OR_EQUAL_TO_MAX);
                return false;
            }
        }
        return true;
    }
152739
private boolean checkSeVatId(final String pvatId) {
    final int checkSum = pvatId.charAt(11) - '0';
    final int sum = squareSum((pvatId.charAt(2) - '0') * 2) + pvatId.charAt(3) - '0'
        + squareSum((pvatId.charAt(4) - '0') * 2) + pvatId.charAt(5) - '0'
        + squareSum((pvatId.charAt(6) - '0') * 2) + pvatId.charAt(7) - '0'
        + squareSum((pvatId.charAt(8) - '0') * 2) + pvatId.charAt(9) - '0'
        + squareSum((pvatId.charAt(10) - '0') * 2);
    int calculatedCheckSum = 10 - sum % 10;
    if (calculatedCheckSum == 10) {
      calculatedCheckSum = 0;
    }
    return checkSum == calculatedCheckSum;
  }
853976
private void checkForLeadingZeroes() {
    Character la1 = chars.lookahead(1);
    Character la2 = chars.lookahead(2);
    if (la1 != null && la1 == '0' && CharType.DIGIT.isMatchedBy(la2)) {
      throw new ParseException("Numeric identifier MUST NOT contain leading zeroes");
    }
  }
187410
function isValidDelim(state, pos) {
	var prevChar, nextChar,
		max = state.posMax,
		can_open = true,
		can_close = true;

	prevChar = pos > 0 ? state.src.charCodeAt(pos - 1) : -1;
	nextChar = pos + 1 <= max ? state.src.charCodeAt(pos + 1) : -1;

	// Check non-whitespace conditions for opening and closing, and
	// check that closing delimeter isn't followed by a number
	if (prevChar === 0x20/* " " */ || prevChar === 0x09/* \t */ ||
			(nextChar >= 0x30/* "0" */ && nextChar <= 0x39/* "9" */)) {
		can_close = false;
	}
	if (nextChar === 0x20/* " " */ || nextChar === 0x09/* \t */) {
		can_open = false;
	}

	return {
		can_open: can_open,
		can_close: can_close
	};
}
1234556
private static boolean isValidChallenge(String authenticateHeader, String authChallengePrefix) {
        if (authenticateHeader != null && !authenticateHeader.isEmpty()
                && authenticateHeader.toLowerCase().startsWith(authChallengePrefix.toLowerCase())) {
            return true;
        }
        return false;
    }