[python] How do I check that multiple keys are in a dict in a single pass?