translate auxiliary functions in python