code: def ensure_namespace(self, name):
          # type: (str) -> ApiNamespace
          
          if name not in self.namespaces:
              self.namespaces[name] = ApiNamespace(name)
          return self.namespaces[name]
docs: Only creates a namespace if it hasn't yet been defined.
  
          :param str name: Name of the namespace.
  
          :return ApiNamespace: