Determines if a string name is a valid identifier
@param {string} name The string to be checked
@param {int} ecmaVersion The ECMAScript version if specified in the parserOptions config
@returns {boolean} True if the string is a valid identifier
545252
function isIdentifier(name, ecmaVersion) {
    if (ecmaVersion >= 6) {
        return esutils.keyword.isIdentifierES6(name);
    }
    return esutils.keyword.isIdentifierES5(name);
}
1265110
static boolean isValidSimpleName(String name) {
    return TokenStream.isJSIdentifier(name)
        && !TokenStream.isKeyword(name)
        // no Unicode escaped characters - some browsers are less tolerant
        // of Unicode characters that might be valid according to the
        // language spec.
        // Note that by this point, Unicode escapes have been converted
        // to UTF-16 characters, so we're only searching for character
        // values, not escapes.
        && isLatin(name);
  }
96800
public String getValidJavaIdentifier(String name) {
        if (!Character.isJavaIdentifierStart(name.charAt(0))) {
            name = "z" + name;
        }
        return name;
    }
719392
public function is($name)
    {
        $name = strtolower($name);

        if (!array_key_exists($name, $this->patterns)) {
            throw new \InvalidArgumentException(sprintf('Unrecognized browser, OS, mobile or tablet name "%s"', $name));
        }

        if (preg_match('/' . $this->patterns[$name] . '/i', $this->userAgent, $matches)) {
            $this->versions[$name] = isset($matches[1]) ? $matches[1] : false;
            return true;
        } else {
            $this->versions[$name] = false;
            return false;
        }
    }
292620
def prefixed(self, identifier, version):
        
        invalid_starting = ['Mn', 'Mc', 'Nd', 'Pc']
        if identifier.startswith('_'):  return True
        return((identifier[0] in string.digits) if version==2
               else (unicodedata.category(identifier[0]) in invalid_starting))
330302
public static boolean isValidFileName (String name) {
		try {
			if (OsUtils.isWindows()) {
				if (name.contains(">") || name.contains("<")) return false;
				name = name.toLowerCase(); //Windows is case insensitive
			}
			return new File(name).getCanonicalFile().getName().equals(name);
		} catch (Exception e) {
			return false;
		}
	}
1026208
static void checkMethodIdentifier(int version, final String name,
            final String msg) {
        if (name == null || name.length() == 0) {
            throw new IllegalArgumentException("Invalid " + msg
                    + " (must not be null or empty)");
        }
        if ((version & 0xFFFF) >= Opcodes.V1_5) {
            for (int i = 0; i < name.length(); ++i) {
                if (".;[/<>".indexOf(name.charAt(i)) != -1) {
                    throw new IllegalArgumentException("Invalid " + msg
                            + " (must be a valid unqualified name): " + name);
                }
            }
            return;
        }
        if (!Character.isJavaIdentifierStart(name.charAt(0))) {
            throw new IllegalArgumentException(
                    "Invalid "
                            + msg
                            + " (must be a '<init>', '<clinit>' or a valid Java identifier): "
                            + name);
        }
        for (int i = 1; i < name.length(); ++i) {
            if (!Character.isJavaIdentifierPart(name.charAt(i))) {
                throw new IllegalArgumentException(
                        "Invalid "
                                + msg
                                + " (must be '<init>' or '<clinit>' or a valid Java identifier): "
                                + name);
            }
        }
    }
175143
public static boolean isValidNcName( String name ) {
        if (name == null || name.length() == 0) return false;
        CharacterIterator iter = new StringCharacterIterator(name);
        char c = iter.first();
        if (!isValidNcNameStart(c)) return false;
        while (c != CharacterIterator.DONE) {
            if (!isValidNcName(c)) return false;
            c = iter.next();
        }
        return true;
    }
775479
protected static boolean isNameValid(String name) {
    Preconditions.checkNotNull(name);
    name = name.toLowerCase();
    return VALID_DB_TABLE_NAME_PATTERN_1.matcher(name).matches()
        && VALID_DB_TABLE_NAME_PATTERN_2.matcher(name).matches();
  }
921485
def validate_version(version)
      return if SemanticPuppet::Version.valid?(version)

      err = _("version string cannot be parsed as a valid Semantic Version")
      raise ArgumentError, _("Invalid 'version' field in metadata.json: %{err}") % { err: err }
    end
211181
protected boolean isSpecialPropertyName(String name) {
        for (String special : specialVersions) {
            if (special.equals(name)) {
                return true;
            }
        }
        return false;
    }
676292
static boolean isSigningRelated(String name) {
        name = name.toUpperCase(Locale.ENGLISH);
        if (!name.startsWith("META-INF/")) {
            return false;
        }
        name = name.substring(9);
        if (name.indexOf('/') != -1) {
            return false;
        }
        if (name.endsWith(".DSA")
                || name.endsWith(".RSA")
                || name.endsWith(".SF")
                || name.endsWith(".EC")
                || name.startsWith("SIG-")
                || name.equals("MANIFEST.MF")) {
            return true;
        }
        return false;
    }
1036138
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.commands, function (cmd) {
      return cmd.name === name && cmd.version === version;
    });
  }
101785
public static boolean isValidVersion(final String version) {
        return StringUtils.isNotBlank(version)
                && (ALTERNATE_PATTERN.matcher(version).matches() || STANDARD_PATTERN
                        .matcher(version).matches());
    }
102175
def com_google_fonts_check_name_version_format(ttFont):
  """"""
  from fontbakery.utils import get_name_entry_strings
  import re
  def is_valid_version_format(value):
    return re.match(r'Version\s0*[1-9]+\.\d+', value)

  failed = False
  version_entries = get_name_entry_strings(ttFont, NameID.VERSION_STRING)
  if len(version_entries) == 0:
    failed = True
    yield FAIL, Message("no-version-string",
                        ("Font lacks a NameID.VERSION_STRING (nameID={})"
                         " entry").format(NameID.VERSION_STRING))
  for ventry in version_entries:
    if not is_valid_version_format(ventry):
      failed = True
      yield FAIL, Message("bad-version-strings",
                          ("The NameID.VERSION_STRING (nameID={}) value must"
                           " follow the pattern \"Version X.Y\" with X.Y"
                           " between 1.000 and 9.999."
                           " Current version string is:"
                           " \"{}\"").format(NameID.VERSION_STRING,
                                             ventry))
  if not failed:
    yield PASS, "Version format in NAME table entries is correct."
1286357
def valid_name(name):
    ""
    if isinstance(name, bytes):
        name = name.decode('ascii')
    if not Definitions.COOKIE_NAME_RE.match(name):
        return False
    # This module doesn't support $identifiers, which are part of an obsolete
    # and highly complex standard which is never used.
    if name[0] == "$":
        return False
    return True
648379
function checkForDisallowedCharactersInString(node, identifier) {
        if (typeof identifier !== "undefined" && isNotAllowed(identifier)) {
            context.report(node, "Unexpected umlaut in \"" + identifier + "\".");
        }
    }