A quick one today; I had a dictionary for a graph which keyed nodes to the community they belong to, and wanted to invert this dictionary to yield a list of the nodes for each community. The code below is the small helper function set up for this task.