def IsExtraRequire(self, token):
    """Returns whether the given goog.require token is unnecessary.

    Args:
      token: A goog.require token.

    Returns:
      True if the given token corresponds to an unnecessary goog.require
      statement, otherwise False.
    """
    namespace = tokenutil.GetStringAfterToken(token)

    if self.GetClosurizedNamespace(namespace) is None:
      return False

    if namespace in self._ignored_extra_namespaces:
      return False

    if token in self._duplicate_require_tokens:
      return True

    if namespace in self._suppressed_requires:
      return False

    # If the namespace contains a component that is initial caps, then that
    # must be the last component of the namespace.
    parts = namespace.split('.')
    if len(parts) > 1 and parts[-2][0].isupper():
      return True

    # TODO(user): There's probably a faster way to compute this.
    for ns in self._used_namespaces:
      if (not ns.alias_definition and (
          namespace == ns.namespace or namespace == ns.identifier)):
        return False

    return True
dataset/ETHPy150Open google/closure-linter/closure_linter/closurizednamespacesinfo.py/ClosurizedNamespacesInfo.IsExtraRequire/original