def set_membership(self, membership):
    """ Set membership. """
    _c_louvain._MutableVertexPartition_set_membership(self._partition, list(membership))
    self._update_internal_membership()
Set membership.