Python 3.9 is now generally available.

google.appengine.api.namespace_manager.set_namespace

Set the default namespace for the current HTTP request.

namespace A string naming the new namespace to use. A value of None will unset the default namespace value.