def get_global_namespace(decls):
    """
    Get the global namespace (::) from a declaration tree.

    Args:
        decls (list[declaration_t]): a list of declarations

    Returns:
        namespace_t: the global namespace_t object (::)

    """
    found = [
        decl for decl in scopedef.make_flatten(decls) if decl.name == '::' and
        isinstance(decl, namespace_t)]
    if len(found) == 1:
        return found[0]
    raise RuntimeError("Unable to find global namespace.")
Get the global namespace (::) from a declaration tree.

    Args:
        decls (list[declaration_t]): a list of declarations

    Returns:
        namespace_t: the global namespace_t object (::)