Python: Added common header, and reformatted code