code: def FromPartition(cls, partition, **kwargs):
      
      new_partition = cls(partition.graph, partition.membership, **kwargs)
      return new_partition
docs: Create a new partition from an existing partition.
  
      Parameters
      ----------
      partition
        The :class:`~VertexPartition.MutableVertexPartition` to replicate.
  
      **kwargs
        Any remaining keyword arguments will be passed on to the constructor of
        the new partition.
  
      Notes
      -----
      This may for example come in handy when determining the quality of a
      partition using a different method. Suppose that we already have a
      partition ``p`` and that we want to determine the Significance of that
      partition. We can then simply use
  
      >>> p = la.find_partition(ig.Graph.Famous('Zachary'),
      ...                       la.ModularityVertexPartition)
      >>> sig = la.SignificanceVertexPartition.FromPartition(p).quality()