Figured out how to randomize community detection in Python