Formatting code as python