Simple check to determine if qname is legal. If it returns false
then <param>str</param> is illegal; if it returns true then
<param>str</param> is legal.
499501
public static boolean isXML11ValidQName(String str) {

        final int colon = str.indexOf(':');

        if (colon == 0 || colon == str.length() - 1) {
            return false;
        }
       
        if (colon > 0) {
            final String prefix = str.substring(0,colon);
            final String localPart = str.substring(colon+1);
            return isXML11ValidNCName(prefix) && isXML11ValidNCName(localPart);
        }
        else {
            return isXML11ValidNCName(str);
        }
     }
680299
def is_valid(cls, arg):
        
        return (isinstance(arg, (int, long)) and (arg >= 0)) or \
            isinstance(arg, str)
437304
def is_valid_python(tkn: str) -> bool:
    
    try:
        root = ast.parse(tkn)
    except SyntaxError:
        return False
    return len(root.body) == 1 and isinstance(root.body[0], ast.Expr) and isinstance(root.body[0].value, ast.Name)
532486
def check_valid(self):
		
		for k,input in self.inputs.items():
			if k in self.valid_opts:
				for param in self.valid_opts[k]:
					if param is None or input is None:
						return True
					elif type(param) is str and '+' in param:
						if re.search(r'^'+param,str(input)):
							return True
					elif type(param) is bool and type(input) is bool:
						return True
					elif type(param) is list and type(input) is list:
						return True
					else:
						if str(input).lower() == str(param):
							return True
				raise ValueError("Invalid input for '%s' parameter. Options are: %s" % (k,' '.join(["'%s'," % str(o) for o in self.valid_opts[k]]) ))
			else:
				raise ValueError("Invalid parameter for '%s'. Params are: %s" % (self.__class__.__name__,', '.join(["'%s'" % p for p in self.valid_opts.keys()]) ))
70195
def is_valid(self, qstr=None):
        """"""
        if qstr is None:
            qstr = self.currentText()
        return QUrl(qstr).isValid()
528369
public static boolean isPrintableString(String str) {
    for (int i = 0; i < str.length(); i++) {
      if (!isPrintableChar(str.charAt(i))) {
        return false;
      }
    }
    return true;
  }
1109820
def verify?(params)
      params = Utils.stringify_keys(params)
      return false if params['sign_type'] != @sign_type

      sign = params.delete('sign')
      # sign_type does not use in notify sign
      params.delete('sign_type')
      string = params_to_string(params)
      case @sign_type
      when 'RSA'
        ::Alipay::Sign::RSA.verify?(@alipay_public_key, string, sign)
      when 'RSA2'
        ::Alipay::Sign::RSA2.verify?(@alipay_public_key, string, sign)
      else
        raise "Unsupported sign_type: #{@sign_type}"
      end
    end
257413
boolean isAccepted(final String name) {
        for (String str : charsets) {
            if (str.equalsIgnoreCase(name)) {
                return true;
            }
        }
        return false;
    }
303515
public static boolean isValid(String name) {
		char[] nameChars = name.toCharArray();
		for (int i = 0; i < nameChars.length; i++) {
			boolean valid = i == 0 ? Character.isJavaIdentifierStart(nameChars[i]) : Character.isJavaIdentifierPart(nameChars[i]);
			if (!valid) {
				return valid;
			}
		}
		return true;
	}
1339432
def isstring(args, quoted=False):
    """"""
    isquoted = lambda c: c[0]==c[-1] and c[0] in ['"', "'"]

    if quoted:
        check = lambda c: isinstance(c, str) and isquoted(c)
    else:
        check = lambda c: isinstance(c, str)

    if isinstance(args, list):
        return all(map(check, args))
    else:
        return check(args)
1241279
def is_valid(cls, arg):
        
        return (isinstance(arg, (int, long)) and (arg >= 0)) or \
            isinstance(arg, basestring)
1289033
def is_valid_int_param(param):
    
    if param is None:
        return False
    try:
        param = int(param)
        if param < 0:
            return False
    except (TypeError, ValueError):
        return False
    return True
106259
public static boolean isValidName(String name) {
    final int length = name.length();
    if (length == 0) {
      return false;
    }
    char ch = name.charAt(0);
    if (!isNameStart(ch)) {
      return false;
    }
    for (int i = 1; i < length; ++i) {
      ch = name.charAt(i);
      if (!isName(ch)) {
        return false;
      }
    }
    return true;
  }
1158528
def is_valid(self):
        ''''''
        return (self.is_primitive and self.name) \
            or (self.is_complex and self.name) \
            or (self.is_list and self.nested) \
            or (self.is_map and self.nested) \
            or (self.is_model and self.nested)
108094
boolean allowsValue(String str, ValidationContext vc) {
    try {
      getValue(str, vc);
      return true;
    }
    catch (DatatypeException e) {
      return false;
    }
  }
580506
def is_username_valid(username):
    
    pattern = re.compile(r"^[a-zA-Z0-9_.-]+$")
    return bool(pattern.match(username))
1148732
private static boolean isParamLiteral(String param) {
    try {
      Double.parseDouble(param);
      return true;
    } catch (NumberFormatException e) {
      // Check to see if the parameter is a literal - either a quoted string or
      // numeric literal
      if (param.length() > 1
          && (param.charAt(0) == '"' || param.charAt(0) == '\'')
          && param.charAt(0) == param.charAt(param.length() - 1)) {
        return true;
      }
    }
    return false;
  }