Returns true if the name is valid. Lets filter out commands which are not suitable to run inside fabric8-forge
976268
protected boolean isValidCommandName(String name) {
        if (Strings.isNullOrBlank(name) || ignoreCommands.contains(name)) {
            return false;
        }
        for (String prefix : ignoreCommandPrefixes) {
            if (name.startsWith(prefix)) {
                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;
  }
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;
    }
202963
def valid?(name, value)
      if @constraints.include? name then
        constraints[name].possible_vals.include? value
      else true end
    end
556529
public static boolean isValidQualifiedName(FeatureSet mode, String name) {
    if (name.endsWith(".") || name.startsWith(".")) {
      return false;
    }

    List<String> parts = Splitter.on('.').splitToList(name);
    for (String part : parts) {
      if (!isValidPropertyName(mode, part)) {
        return false;
      }
    }
    return isValidSimpleName(parts.get(0));
  }
467251
def is_python_interpreter_valid_name(filename):
    """"""
    pattern = r'.*python(\d\.?\d*)?(w)?(.exe)?$'
    if re.match(pattern, filename, flags=re.I) is None:
        return False
    else:
        return True
435522
def valid?
      return false if @id.nil?
      return false if @name.nil?
      authenticator_validator = EnumAttributeValidator.new('String', ["local", "ldap"])
      return false unless authenticator_validator.valid?(@authenticator)
      return true
    end
935036
def __isValidFilename(self, filename):
        """"""
        if filename and isinstance(filename, string_types):
            if re.match(r'^[\w\d\_\-\.]+$', filename, re.I):
                if self.__isValidTGZ(filename) or self.__isValidZIP(filename):
                    return True
        return False
832864
def is_valid_bucket_name(name):
    
    # Bucket names must be at least 3 and no more than 63 characters long.
    if (len(name) < 3 or len(name) > 63):
        return False
    # Bucket names must not contain uppercase characters or underscores.
    if (any(x.isupper() for x in name)):
        return False
    if "_" in name:
        return False
    # Bucket names must start with a lowercase letter or number.
    if not (name[0].islower() or name[0].isdigit()):
        return False
    # Bucket names must be a series of one or more labels. Adjacent labels are separated by a single period (.).
    for label in name.split("."):
        # Each label must start and end with a lowercase letter or a number.
        if len(label) < 1:
            return False
        if not (label[0].islower() or label[0].isdigit()):
            return False
        if not (label[-1].islower() or label[-1].isdigit()):
            return False
    # Bucket names must not be formatted as an IP address (for example, 192.168.5.4).
    looks_like_IP = True
    for label in name.split("."):
        if not label.isdigit():
            looks_like_IP = False
            break
    if looks_like_IP:
        return False

    return True
99539
def valid_hostnames(hostname_list):
    
    for entry in hostname_list:
        if len(entry) > 255:
            return False
        allowed = re.compile('(?!-)[A-Z\d-]{1,63}(?<!-)$', re.IGNORECASE)
        if not all(allowed.match(x) for x in entry.split(".")):
            return False
    return True
812829
def _valid_table_name(name):
    

    if name[0] not in "_" + string.ascii_letters or not set(name).issubset(
        "_" + string.ascii_letters + string.digits
    ):
        return False

    else:
        return True
399026
function isValid(name, value) {
    var tests = {
        indent: function (value) {
            return (/^(\s*|\d*)$/).test(value);
        },
        openbrace: function (value) {
            return (['end-of-line', 'separate-line']).indexOf(value) !== -1;
        },
        autosemicolon: function (value) {
            return typeof value === 'boolean';
        }
    };

    return Boolean(tests[name] && tests[name](value));
}
1107190
def validate_variable_name(self, name):
        
        if not name:
            raise SerializerError("Variable name is empty".format(name))

        if name[0] not in PROPERTY_ALLOWED_START:
            msg = "Variable name '{}' must starts with a letter"
            raise SerializerError(msg.format(name))

        for item in name:
            if item not in PROPERTY_ALLOWED_CHARS:
                msg = ("Invalid variable name '{}': it must only contains "
                       "letters, numbers and '_' character")
                raise SerializerError(msg.format(name))

        return True
1354582
def is_valid_filename(filename, return_ext=False):
    """"""
    ext = Path(filename).suffixes

    if len(ext) > 2:
        logg.warn('Your filename has more than two extensions: {}.\n'
                  'Only considering the two last: {}.'.format(ext, ext[-2:]))
        ext = ext[-2:]

    # cases for gzipped/bzipped text files
    if len(ext) == 2 and ext[0][1:] in text_exts and ext[1][1:] in ('gz', 'bz2'):
        return ext[0][1:] if return_ext else True
    elif ext and ext[-1][1:] in avail_exts:
        return ext[-1][1:] if return_ext else True
    elif ''.join(ext) == '.soft.gz':
        return 'soft.gz' if return_ext else True
    elif ''.join(ext) == '.mtx.gz':
        return 'mtx.gz' if return_ext else True
    else:
        if return_ext:
            raise ValueError('"{}" does not end on a valid extension.\n'
                             'Please, provide one of the available extensions.\n{}\n'
                             'Text files with .gz and .bz2 extensions are also supported.'
                             .format(filename, avail_exts))
        else:
            return False
1196481
def _parse_name(name):
    
    required = False

    if name[-1] == '*':
        name = name[0:-1]
        required = True

    return name, required
251185
public static void checkForValidName(final Node node, final String name)
    {
        if (!ValidationUtil.isSbeCppName(name))
        {
            handleWarning(node, "name is not valid for C++: " + name);
        }

        if (!ValidationUtil.isSbeJavaName(name))
        {
            handleWarning(node, "name is not valid for Java: " + name);
        }

        if (!ValidationUtil.isSbeGolangName(name))
        {
            handleWarning(node, "name is not valid for Golang: " + name);
        }

        if (!ValidationUtil.isSbeCSharpName(name))
        {
            handleWarning(node, "name is not valid for C#: " + name);
        }
    }
29724
def valid_qname(val):
    

    try:
        (prefix, localpart) = val.split(":")
        return valid_ncname(prefix) and valid_ncname(localpart)
    except ValueError:
        return valid_ncname(val)