check if key exists in list of dictionary python