Miscellaneous functions implemented by Python.