Validates a string as a possible Kubernetes version. An empty string is also valid, which tells the server
    to use its default version.
498555
def validate_k8s_version(namespace):
    """"""
    if namespace.kubernetes_version:
        k8s_release_regex = re.compile(r'^[v|V]?(\d+\.\d+\.\d+.*)$')
        found = k8s_release_regex.findall(namespace.kubernetes_version)
        if found:
            namespace.kubernetes_version = found[0]
        else:
            raise CLIError('--kubernetes-version should be the full version number, '
                           'such as "1.7.12" or "1.8.7"')
860441
function validateFormat(attr, conf, err) {
    if (nullCheck.call(this, attr, conf, err)) return;
    if (typeof this[attr] === 'string') {
        if (!this[attr].match(conf['with'])) {
            err();
        }
    } else {
        err();
    }
}
198680
function (name, version) {
    if (!name || !_.isString(name)) {
      var err = new Error('Please pass a valid string as name!');
      debug(err);
      throw err;
    }

    version = version || 0;

    if (!_.isNumber(version)) {
      var err = new Error('Please pass a valid number as version!');
      debug(err);
      throw err;
    }

    return _.find(this.events, function (evt) {
      return evt.name === name && evt.version === version;
    });
  }
473849
def valid?
      default_fts_operator_validator = EnumAttributeValidator.new('String', ["AND", "OR"])
      return false unless default_fts_operator_validator.valid?(@default_fts_operator)
      default_fts_field_operator_validator = EnumAttributeValidator.new('String', ["AND", "OR"])
      return false unless default_fts_field_operator_validator.valid?(@default_fts_field_operator)
      return true
    end
510974
def parse_version_string(version_string):
    
    components = version_string.split('-') + [None, None]
    version = list(map(int, components[0].split('.')))
    build_tag = components[1] if components[1] else BUILD_TAG
    build_number = int(components[2]) if components[2] else components[2]

    return (version, build_tag, build_number)
78238
def validate(self):
        """"""
        if not self.get('api_key'):
            raise ValueError("api_key not found in config. Please see documentation.")
        host = self.get('host') or DEFAULT_CLOUD_HOST
        if host:
            # remove extraneous slashes and force to byte string
            # otherwise msg += message_body in httplib will fail in python2
            # when message_body contains binary data, and url is unicode

            # remaining failure modes include at least:
            # passing bytes in python3 will fail as we try to strip unicode '/' characters
            # passing unicode code points in python2 will fail due to httplib host.encode('ascii')
            host = host.strip('/')
            if not isinstance(host, str):
                host = host.encode('utf-8')
            self['host'] = host

        self.setdefault('autostart_notification_thread', True)
1369312
function valueIsNullForValidator(value, validatorName) {
  if (value === null || value === CONSTANT.NULL || typeof value === 'undefined') {
    return true;
  }

  if (value === '' && VALIDATOR_CONSIDERS_EMPTY_STRING_NULL[validatorName]) {
    return true;
  }

  return false;
}
813638
public boolean validateVersionType(String versionType, DiagnosticChain diagnostics, Map<Object, Object> context) {
		return true;
	}
50805
def _validate_single_port_string(port):
    
    if ' ' not in port or len(port.split(' ')) != 2:
        raise ValueError(
            "Port '{}' should have exactly one space in it".format(port)
        )
    (external, internal) = port.split(' ')
    try:
        external = int(external)
    except ValueError:
        raise ValueError(
            "Port '{}' external port isn't an int".format(port)
        )
    if ':' not in internal:
        raise ValueError(
            "Port '{}' local address should be 'IP:port'".format(port)
        )
    if not internal.startswith('unix:'):
        ip, localport = internal.split(':')
        if ip != 'localhost' and not _is_non_public_numeric_address(ip):
            raise ValueError(
                "Port '{}' internal IP '{}' should be a local "
                "address".format(port, ip)
            )
751601
function validVersion(version, spec) {
  // Normalize route versions
  var test = spec.versions || [spec.version]

  // Check for direct version match
  if (~test.indexOf(version)) {
    return true
  }

  // Use semver and attempt to match on supplied version
  return !!test.filter(function(v) {
    return semver.satisfies(v, version)
  }).length
}
1179215
def validate_options(self, k, v):
        """"""

        super().validate_options(k, v)
        if k == 'charset_size':
            if v not in (1, 2, 4):
                raise ValueError("{}: '{}' is an unsupported charset size".format(self.__class__.__name__, v))
        elif k == 'wide_charset_size':
            if v not in (2, 4):
                raise ValueError("{}: '{}' is an unsupported wide charset size".format(self.__class__.__name__, v))
        elif k in ('exec_charset', 'wide_exec_charset'):
            # See if parsing fails.
            self.get_encoding_name(v)
        elif k == 'string_types':
            if RE_VALID_STRING_TYPES.match(v) is None:
                raise ValueError("{}: '{}' does not define valid string types".format(self.__class__.__name__, v))
96597
def validate_version(self, service_id, version_number):
		""""""
		content = self._fetch("/service/%s/version/%d/validate" % (service_id, version_number))
		return self._status(content)
407389
def validate(self, input_string):
        
        parsed_url = urlparse(url=input_string)
        return bool(parsed_url.scheme and parsed_url.netloc)
410258
function (name, version) {
    if (!name || !_.isString(name)) {
      var err = new Error('Please pass a valid string as name!');
      debug(err);
      throw err;
    }

    version = version || 0;

    if (!_.isNumber(version)) {
      var err = new Error('Please pass a valid number as version!');
      debug(err);
      throw err;
    }

    var found = _.find(this.loadingEventTransformers, function (evt) {
      return evt.name === name && evt.version === version;
    });

    if (found) return found;

    return _.find(this.loadingEventTransformers, function (evt) {
      return evt.name === name && (evt.version === null || evt.version === undefined);
    });
  }
1203709
def __validate_datetime_string(self):
        

        try:
            try:
                StrictVersion(self._value)
                raise TypeConversionError(
                    "invalid datetime string: version string found {}".format(self._value)
                )
            except ValueError:
                pass
        except TypeError:
            raise TypeConversionError("invalid datetime string: type={}".format(type(self._value)))
499784
def validate_no_existing_tag(tag_string)
      existing_tags = []
      @gitrepo.tags.each { |tag| existing_tags << tag.name }
      if existing_tags.include?(tag_string)
        ui.error 'This version tag has already been committed to the repo.'
        ui.error "Are you sure you haven't released this already?"
        exit 6
      end
    end
979364
def current_version_option_validator(ctx, param, value):
    

    current_version = None

    if value:
        try:
            current_version = Version(value)
        except ValueError:
            ctx.fail(f"{value} is not a valid version string")

    # Look for the last git tag for the curren version
    git = Git()
    tag_pattern = ctx.params["tag_pattern"]
    versions = tag_analyzer(git.tags, tag_pattern, Version)

    # User provided current version. Try to find a tag that match it.
    if current_version:
        for version in versions:
            if version == current_version:
                current_version = version
                break
    elif versions:
        current_version = versions[0]

    ctx.params["current_tag"] = current_version.tag if current_version else None
    ctx.params["versions"] = versions

    return current_version