def _generate_base_namespace_module(self, namespace):<EOL>
self.cur_namespace = namespace<EOL>self.import_tracker.clear()<EOL>generate_module_header(self)<EOL>self.emit_placeholder('<STR_LIT>')<EOL>self.emit_raw(validators_import_with_type_ignore)<EOL>self._generate_imports_for_referenced_namespaces(namespace)<EOL>self._generate_typevars()<EOL>for annotation_type in namespace.annotation_types:<EOL><INDENT>self._generate_annotation_type_class(namespace, annotation_type)<EOL><DEDENT>for data_type in namespace.linearize_data_types():<EOL><INDENT>if isinstance(data_type, Struct):<EOL><INDENT>self._generate_struct_class(namespace, data_type)<EOL><DEDENT>elif isinstance(data_type, Union):<EOL><INDENT>self._generate_union_class(namespace, data_type)<EOL><DEDENT>else:<EOL><INDENT>raise TypeError('<STR_LIT>' % type(data_type))<EOL><DEDENT><DEDENT>for alias in namespace.linearize_aliases():<EOL><INDENT>self._generate_alias_definition(namespace, alias)<EOL><DEDENT>self._generate_routes(namespace)<EOL>self._generate_imports_needed_for_typing()<EOL>
Creates a module for the namespace. All data types and routes are
        represented as Python classes.