Replacing deprecated has_key() with operator in (PEP8)
Minor style update
Minor update
Removing trailing whitespaces (PEP8)