python check if dictionary has key and value