Make this code compatible with Python 3.10.
Make this code compatible with Python 3.10.

PiperOrigin-RevId: 473457191

deepmind/deepmind-research,deepmind/deepmind-research,deepmind/deepmind-research,deepmind/deepmind-research