Python 3.9 is now generally available.

google.appengine.api.namespace_manager.validate_namespace

Raises an exception if value is not a valid namespace string.

A namespace must match the regular expression ([0-9A-Za-z._-]{0,100}).

value string, the value to validate.
exception exception type to raise.

BadValueError If value is not a valid namespace string.