Given a dictionary like so:
my_map = {\'a\': 1, \'b\': 2}
How can one invert this map to get:
inv_map = {1: \'a\', 2: \'b\'
I would do it that way in python 2.
inv_map = {my_map[x] : x for x in my_map}