ME: abstracted functionality for getting key by value in a dict