Tests a manifest name value for trademarks.
548221
def validate_name(err, value, source):
    ''

    ff_pattern = re.compile('(mozilla|firefox)', re.I)

    err.metadata['name'] = value

    if ff_pattern.search(value):
        err.warning(
            ('metadata_helpers', '_test_name', 'trademark'),
            'Add-on has potentially illegal name.',
            'Add-on names cannot contain the Mozilla or Firefox '
            'trademarks. These names should not be contained in add-on '
            'names if at all possible.',
            source)
389355
public Value check(ILexNameToken name)
	{
		Value v = get(name);

		if (v == null)
		{
			if (outer != null)
			{
				return outer.check(name);
			}
		}

		return v;
	}
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;
    }
913982
def should_validate_attachment_presence name
      klass   = self.name.gsub(/Test$/, '').constantize
      matcher = validate_attachment_presence name
      should matcher.description do
        assert_accepts(matcher, klass)
      end
    end
39109
private void validateDepNameUniqueness(final List<TriggerDependencyBean> dependencies) {
    final Set<String> seen = new HashSet<>();
    for (final TriggerDependencyBean dep : dependencies) {
      // set.add() returns false when there exists duplicate
      Preconditions.checkArgument(seen.add(dep.getName()), String.format("duplicate dependency"
          + ".name %s found, dependency.name should be unique", dep.getName()));
    }
  }
419894
private static boolean isPropertyName(String name) {
        return ((name.length() > 0) && Character.isUpperCase(name.charAt(0))) || ((name.length() > 1) && Character.isUpperCase(name.charAt(1)));
    }
1077048
function isValidPackageName(name) {
  const stats = validateName(name);
  return stats.validForNewPackages === true
    && stats.validForOldPackages === true;
}
916520
private static String manifestAsString(Manifest manifest) {
        ByteArrayOutputStream baos = new ByteArrayOutputStream();

        try {
            manifest.write(baos);
            return baos.toString("UTF-8");
        } catch (IOException e) {
            throw new IllegalStateException("Unable to write MANIFEST.MF to an archive Asset", e);
        } finally {
            try {
                baos.close();
            } catch (IOException e) {
            }
        }
    }
652319
def _validate(self, key, cls=None):
        """"""
        if key not in self.manifest:
            raise ValueError("Manifest %s requires '%s'."
                             % (self.manifest_path, key))
        if cls:
            if not isinstance(self.manifest[key], cls):
                raise TypeError("Manifest value '%s' should be %s, not %s"
                                % (key, cls, type(self.manifest[key])))
47424
def register(metric_name)
      metric_name = metric_name.to_s
      metric_exists = self.for(metric_name).present?

      if metric_exists
        raise(
          MetricAlreadyRegistered,
          "There's a metric already registered with the name `:#{metric_name}`, must be unique"
        )
      end

      metric_manifest = MetricManifest.new(metric_name: metric_name)

      yield(metric_manifest)

      metric_manifest.validate!

      metrics_manifests << metric_manifest
    end
1372190
function toBindingIdentifierName(name) {
  name = toIdentifier(name);
  if (name === "eval" || name === "arguments") name = "_" + name;
  return name;
}
123219
private String[] checkRealNames(final String[] names) {
	if (names.length == 1) {
	    if (names[0].equals(Tango_AllAttr)) {
		final String[] real_names = new String[dev_attr.get_attr_nb()];
		for (int i = 0; i < dev_attr.get_attr_nb(); i++) {
		    real_names[i] = dev_attr.get_attr_by_ind(i).get_name();
		}
		return real_names;
	    } else {
		return names;
	    }
	} else {
	    return names;
	}
    }
601686
def _name_matches(name, matches):
    '''
    
    '''
    for m in matches:
        if name.endswith(m):
            return True
        if name.lower().endswith('_' + m.lower()):
            return True
        if name.lower() == m.lower():
            return True
    return False
1256369
protected static final boolean looksLikeAnnotationName(final String name) {
        return name.startsWith("org.nmdp") && Character.isUpperCase(name.charAt(name.lastIndexOf(".") + 1));
    }
1213279
private static boolean containsIgnoreCase(List<String> names, String nameToFind) {
		if (CollUtil.isEmpty(names)) {
			return false;
		}
		if (StrUtil.isEmpty(nameToFind)) {
			return false;
		}
		for (String name : names) {
			if (nameToFind.equalsIgnoreCase(name)) {
				return true;
			}
		}
		return false;
	}
67043
private void maybeInstantiateVerifier() throws IOException {
        if (jv != null) {
            return;
        }

        if (verify) {
            String[] names = getMetaInfEntryNames();
            if (names != null) {
                for (int i = 0; i < names.length; i++) {
                    String name = names[i].toUpperCase(Locale.ENGLISH);
                    if (name.endsWith(".DSA") ||
                        name.endsWith(".RSA") ||
                        name.endsWith(".EC") ||
                        name.endsWith(".SF")) {
                        // Assume since we found a signature-related file
                        // that the jar is signed and that we therefore
                        // need a JarVerifier and Manifest
                        getManifest();
                        return;
                    }
                }
            }
            // No signature-related files; don't instantiate a
            // verifier
            verify = false;
        }
    }
1020089
protected static void checkMetricLabelName(String name) {
    if (!METRIC_LABEL_NAME_RE.matcher(name).matches()) {
      throw new IllegalArgumentException("Invalid metric label name: " + name);
    }
    if (RESERVED_METRIC_LABEL_NAME_RE.matcher(name).matches()) {
      throw new IllegalArgumentException("Invalid metric label name, reserved for internal use: " + name);
    }
  }