Use 'in' operator instead of has_key.

It's not available in Python 3 and `in` is recommended.