How to check for a value efficiently in a list of dictionaries in python? Say I have a list of dictionaries: