cleaning python code