def _extract_namespace_ast_node(self, desc):
if len(desc) == <NUM_LIT:0> or not isinstance(desc[<NUM_LIT:0>], AstNamespace):<EOL><INDENT>if self._debug:<EOL><INDENT>self._logger.info('<STR_LIT>', desc)<EOL><DEDENT>raise InvalidSpec('<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>', desc[<NUM_LIT:0>].lineno, desc[<NUM_LIT:0>].path)<EOL><DEDENT>for item in desc[<NUM_LIT:1>:]:<EOL><INDENT>if isinstance(item, AstNamespace):<EOL><INDENT>raise InvalidSpec('<STR_LIT>',<EOL>item[<NUM_LIT:0>].lineno, item[<NUM_LIT:0>].path)<EOL><DEDENT><DEDENT>return desc.pop(<NUM_LIT:0>)<EOL>
Checks that the namespace is declared first in the spec, and that only
one namespace is declared.

Args:
    desc (List[stone.stone.parser.ASTNode]): All AST nodes in a spec
        file in the order they were defined.

Return:
    stone.frontend.ast.AstNamespace: The namespace AST node.