i think this can be done as:

```python
selected_ids = {k for k, v in mapping_dict.iteritems() if v[metadata_category] == metadata_value}
```