Python 3.9 is now generally available.

google.appengine.ext.ndb.toplevel

A sync tasklet that sets a fresh default Context.

Use this for toplevel view functions such as webapp.RequestHandler.get() or Django view functions.