translated to python