[python] How to test if a dictionary contains a specific key?