(self, verbosity=0, width=None)
return out.getvalue().strip()
Returns the summary of the clustering.

        The summary includes the number of items and clusters, and also the
        list of members for each of the clusters if the verbosity is nonzero.

        @param verbosity: determines whether the cluster members should be
          printed. Zero verbosity prints the number of items and clusters only.
        @return: the summary of the clustering as a string.
Returns the summary of the clustering.
Returns the summary of the clustering .
def summary(self, verbosity=0, width=None):
        """Returns the summary of the clustering.

        The summary includes the number of items and clusters, and also the
        list of members for each of the clusters if the verbosity is nonzero.

        @param verbosity: determines whether the cluster members should be
          printed. Zero verbosity prints the number of items and clusters only.
        @return: the summary of the clustering as a string.
        """
        out = StringIO()
        print(
            "Clustering with %d elements and %d clusters"
            % (
                len(self._membership),
                len(self),
            ),
            file=out,
        )

        if verbosity < 1:
            return out.getvalue().strip()

        ndigits = len(str(len(self)))
        wrapper = _get_wrapper_for_width(width, subsequent_indent=" " * (ndigits + 3))

        for idx, cluster in enumerate(self._formatted_cluster_iterator()):
            wrapper.initial_indent = "[%*d] " % (ndigits, idx)
            print("\n".join(wrapper.wrap(cluster)), file=out)

        return out.getvalue().strip()
def summary ( self , verbosity = 0 , width = None ) : out = StringIO ( ) print ( "Clustering with %d elements and %d clusters" % ( len ( self . _membership ) , len ( self ) , ) , file = out , ) if verbosity < 1 : return out . getvalue ( ) . strip ( ) ndigits = len ( str ( len ( self ) ) ) wrapper = _get_wrapper_for_width ( width , subsequent_indent = " " * ( ndigits + 3 ) ) for idx , cluster in enumerate ( self . _formatted_cluster_iterator ( ) ) : wrapper . initial_indent = "[%*d] " % ( ndigits , idx ) print ( "\n" . join ( wrapper . wrap ( cluster ) ) , file = out ) return out . getvalue ( ) . strip ( )