Validates a name prefix.
494057
private void checkPrefix(String prefix) {
    if (prefix.length() > 0) {
      // Make sure that prefix starts with a legal character.
      if (!contains(firstChars, prefix.charAt(0))) {
        char[] chars = new char[firstChars.length];
        for (int i = 0; i < chars.length; i++) {
          chars[i] = firstChars[i].name;
        }
        throw new IllegalArgumentException(
            "prefix must start with one of: " + Arrays.toString(chars));
      }
      for (int pos = 1; pos < prefix.length(); ++pos) {
        char[] chars = new char[nonFirstChars.length];
        for (int i = 0; i < chars.length; i++) {
          chars[i] = nonFirstChars[i].name;
        }
        if (!contains(nonFirstChars, prefix.charAt(pos))) {
          throw new IllegalArgumentException(
              "prefix has invalid characters, must be one of: "
              + Arrays.toString(chars));
        }
      }
    }
  }
719609
public static function validateOperation($name)
    {
        $name = self::validateNamingConvention($name);
        if (self::isKeyword($name)) {
            $name = self::NAME_PREFIX . ucfirst($name);
        }
        return $name;
    }
721958
function(name) {
    var regexp, idx,
      length = this.extraHeaders.length;

    if (this.headers[Utils.headerize(name)]) {
      return true;
    } else {
      regexp = new RegExp('^\\s*'+ name +'\\s*:','i');
      for (idx=0; idx<length; idx++) {
        if (regexp.test(this.extraHeaders[idx])) {
          return true;
        }
      }
    }

    return false;
  }
285808
private static boolean validTemplateTypeName(String name) {
    return !name.isEmpty()
        && CharMatcher.javaLetterOrDigit().or(CharMatcher.is('_')).matchesAllOf(name);
  }
729727
protected void validateName (String username)
        throws InvalidUsernameException
    {
        // check length
        if (username.length() < MINIMUM_USERNAME_LENGTH) {
            throw new InvalidUsernameException("error.username_too_short");
        }
        if (username.length() > MAXIMUM_USERNAME_LENGTH) {
            throw new InvalidUsernameException("error.username_too_long");
        }

        // check that it's only valid characters
        if (!username.matches(NAME_REGEX)) {
            throw new InvalidUsernameException("error.invalid_username");
        }
    }
1330728
def _is_scope_prefix(scope_name, prefix_name):
  """"""

  if not prefix_name:
    return True

  if not scope_name.endswith("/"):
    scope_name += "/"

  if not prefix_name.endswith("/"):
    prefix_name += "/"

  return scope_name.startswith(prefix_name)
404534
def validate_nodepool_name(namespace):
    """"""
    if namespace.nodepool_name != "":
        if len(namespace.nodepool_name) > 12:
            raise CLIError('--nodepool-name can contain atmost 12 characters')
        if not namespace.nodepool_name.isalnum():
            raise CLIError('--nodepool-name should only contain alphanumeric characters')
229913
def is_valid_name_error(name: str, node: Node = None) -> Optional[GraphQLError]:
    """"""
    if not isinstance(name, str):
        raise TypeError("Expected string")
    if name.startswith("__"):
        return GraphQLError(
            f"Name {name!r} must not begin with '__',"
            " which is reserved by GraphQL introspection.",
            node,
        )
    if not re_name.match(name):
        return GraphQLError(
            f"Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but {name!r} does not.", node
        )
    return None
613936
public static boolean isStarQualifiedName(String name) {
    return name != null
        && name.endsWith(".*")
        && isQualifiedName(name.substring(0, name.length() - 2));
  }
847242
private String computeSetterName(String name)
	{
		StringBuilder _result = new StringBuilder().append(PREFIX__SETTER);
		_result.append(Character.toUpperCase(name.charAt(0))).append(name.substring(1));
		return _result.toString();
	}
10444
private void validateName(String name) throws DDFException {
    Boolean isNameExisted;
    try {
      this.getManager().getDDFByName(name);
      isNameExisted = true;
    } catch (DDFException e) {
      isNameExisted = false;
    }
    if(isNameExisted) {
      throw new DDFException(String.format("DDF with name %s already exists", name));
    }

    Pattern p = Pattern.compile("^[a-zA-Z0-9_-]*$");
    Matcher m = p.matcher(name);
    if(!m.find()) {
      throw new DDFException(String.format("Invalid name %s, only allow alphanumeric (uppercase and lowercase a-z, " +
          "numbers 0-9) and dash (\"-\") and underscore (\"_\")", name));
    }
  }
767100
protected void validateName(String name, String typeDescription) {
        if (!APPLICATION_NAME_PATTERN.matcher(name).matches()) {
            throw new DiscoveryException(typeDescription + " [" + name + "] must start with a letter, end with a letter or digit and contain only letters, digits or hyphens. Example: foo-bar");
        }
    }
709464
def _do_remove_prefix(name):
    """"""
    res = name
    if isinstance(res, str):
        if (res.find('Table: ') == 0):
            res = res.replace('Table: ', '', 1)
    return res
210742
public void expectNumeric(String name) {
        expectNumeric(name, messages.get(Validation.NUMERIC_KEY.name(), name));
    }
342942
def _namematcher(regex):
    """"""

    matcher = re_compile(regex)

    def match(target):
        target_name = getattr(target, '__name__', '')
        result = matcher.match(target_name)
        return result

    return match
1144589
def _validate_names(self, name=None, names=None, deep=False):
        
        from copy import deepcopy
        if names is not None and name is not None:
            raise TypeError("Can only provide one of `names` and `name`")
        elif names is None and name is None:
            return deepcopy(self.names) if deep else self.names
        elif names is not None:
            if not is_list_like(names):
                raise TypeError("Must pass list-like as `names`.")
            return names
        else:
            if not is_list_like(name):
                return [name]
            return name
291035
public static void validateSimonName(String name) {
		if (!checkName(name)) {
			throw new SimonException("Simon name must match following pattern: '" + SimonUtils.NAME_PATTERN.pattern() + "', used name: " + name);
		}
	}