Porting to Python 3, change 'has_key' for 'in'.