Find the key(s) that map to a value in a dictionary?

I am struggling a bit to write an expression that, given an input VALUE, yields one or more keys in a dictionary that map to that value. Kind of a reverse lookup.

For example, supposing the dictionary is:

living_room:  1
hallway: 2
garage: 1
bedroom: 3

(I am avoiding jinja syntax for now).

Is there a way to, say, figure out which, if any, key(s) map to the value ‘1’?

Thank you

{% set d = {'living_room': 1, 'hallway': 2, 'garage': 1, 'bedroom': 3 } %}

{{ d.items() | selectattr(1, 'eq', 1) | map(attribute=0) | list}}

That’s exactly what I needed. Thank you. For filters like these, I find the Jinja designer documentation so terse that it can be hard to make sense. Thank you so much for this.