Replace dict.has_key(key) with key in dict to be compatible with new python syntax