Fix invalid names in Python code.

import the relevant Python modules correctly.