def GetMissingRequires(self):
    """Returns the dict of missing required namespaces for the current file.

    For each non-private identifier used in the file, find either a
    goog.require, goog.provide or a created identifier that satisfies it.
    goog.require statements can satisfy the identifier by requiring either the
    namespace of the identifier or the identifier itself. goog.provide
    statements can satisfy the identifier by providing the namespace of the
    identifier. A created identifier can only satisfy the used identifier if
    it matches it exactly (necessary since things can be defined on a
    namespace in more than one file). Note that provided namespaces should be
    a subset of created namespaces, but we check both because in some cases we
    can't always detect the creation of the namespace.

    Returns:
      Returns a dictionary of key as string and value integer where each
      string(key) is a namespace that should be required by this file, but is
      not and integer(value) is first line number where it's used.
    """
    external_dependencies = set(self._required_namespaces)

    # Assume goog namespace is always available.
    external_dependencies.add('goog')
    # goog.module is treated as a builtin, too (for goog.module.get).
    external_dependencies.add('goog.module')

    created_identifiers = set()
    for unused_namespace, identifier, unused_line_number in (
        self._created_namespaces):
      created_identifiers.add(identifier)

    missing_requires = dict()
    illegal_alias_statements = dict()

    def ShouldRequireNamespace(namespace, identifier):
      """Checks if a namespace would normally be required."""
      return (
          not self._IsPrivateIdentifier(identifier) and
          namespace not in external_dependencies and
          self._provided_namespaces not in namespace and
          identifier not in external_dependencies and
          identifier not in created_identifiers and
          namespace not in missing_requires)

    # First check all the used identifiers where we know that their namespace
    # needs to be provided (unless they are optional).
    for ns in self._used_namespaces:
      namespace = ns.namespace
      identifier = ns.identifier
      if (not ns.alias_definition and
          ShouldRequireNamespace(namespace, identifier)):
        missing_requires[namespace] = ns.GetLine()

    # Now that all required namespaces are known, we can check if the alias
    # definitions (that are likely being used for typeannotations that don't
    # need explicit goog.require statements) are already covered. If not
    # the user shouldn't use the alias.
    for ns in self._used_namespaces:
      if (not ns.alias_definition or
          not ShouldRequireNamespace(ns.namespace, ns.identifier)):
        continue
      if self._FindNamespace(ns.identifier, self._provided_namespaces,
                             created_identifiers, external_dependencies,
                             missing_requires):
        continue
      namespace = ns.identifier.rsplit('.', 1)[0]
      illegal_alias_statements[namespace] = ns.token

    return missing_requires, illegal_alias_statements
dataset/ETHPy150Open google/closure-linter/closure_linter/closurizednamespacesinfo.py/ClosurizedNamespacesInfo.GetMissingRequires/swapped operands of `not in`