again I would put this outside the function, call the utils function

our louvain returns a list of sets, so if you want a dict of sets
if you think you may use the code by @taynaud we could add another helper function to utils
utils.swap_dict (or something like this)
utils.listset_to_dictset(partition)
but good to reduce code replication