def ensure_namespace(self, name):<EOL>
if name not in self.namespaces:<EOL><INDENT>self.namespaces[name] = ApiNamespace(name)<EOL><DEDENT>return self.namespaces[name]<EOL>
Only creates a namespace if it hasn't yet been defined.

:param str name: Name of the namespace.

:return ApiNamespace: