Fix python code