def __init__(self, graph, membership=None, modularity=None, params=None, modularity_params=None):
    'Creates a clustering object for a given graph.\n\n        @param graph: the graph that will be associated to the clustering\n        @param membership: the membership list. The length of the list must\n          be equal to the number of vertices in the graph. If C{None}, every\n          vertex is assumed to belong to the same cluster.\n        @param modularity: the modularity score of the clustering. If C{None},\n          it will be calculated when needed.\n        @param params: additional parameters to be stored in this object.\n        @param modularity_params: arguments that should be passed to\n          L{Graph.modularity} when the modularity is (re)calculated. If the\n          original graph was weighted, you should pass a dictionary\n          containing a C{weight} key with the appropriate value here.\n        '
    if (membership is None):
        Clustering.__init__(self, ([0] * graph.vcount()), params)
    else:
        if (len(membership) != graph.vcount()):
            raise ValueError('membership list has invalid length')
        Clustering.__init__(self, membership, params)
    self._graph = graph
    self._modularity = modularity
    self._modularity_dirty = (modularity is None)
    if (modularity_params is None):
        self._modularity_params = {}
    else:
        self._modularity_params = dict(modularity_params)
Creates a clustering object for a given graph.

@param graph: the graph that will be associated to the clustering
@param membership: the membership list. The length of the list must
  be equal to the number of vertices in the graph. If C{None}, every
  vertex is assumed to belong to the same cluster.
@param modularity: the modularity score of the clustering. If C{None},
  it will be calculated when needed.
@param params: additional parameters to be stored in this object.
@param modularity_params: arguments that should be passed to
  L{Graph.modularity} when the modularity is (re)calculated. If the
  original graph was weighted, you should pass a dictionary
  containing a C{weight} key with the appropriate value here.
def __init__(self, graph, membership=None, modularity=None, params=None, modularity_params=None):
    'Creates a clustering object for a given graph.\n\n        @param graph: the graph that will be associated to the clustering\n        @param membership: the membership list. The length of the list must\n          be equal to the number of vertices in the graph. If C{None}, every\n          vertex is assumed to belong to the same cluster.\n        @param modularity: the modularity score of the clustering. If C{None},\n          it will be calculated when needed.\n        @param params: additional parameters to be stored in this object.\n        @param modularity_params: arguments that should be passed to\n          L{Graph.modularity} when the modularity is (re)calculated. If the\n          original graph was weighted, you should pass a dictionary\n          containing a C{weight} key with the appropriate value here.\n        '
    if (membership is None):
        Clustering.__init__(self, ([0] * graph.vcount()), params)
    else:
        if (len(membership) != graph.vcount()):
            raise ValueError('membership list has invalid length')
        Clustering.__init__(self, membership, params)
    self._graph = graph
    self._modularity = modularity
    self._modularity_dirty = (modularity is None)
    if (modularity_params is None):
        self._modularity_params = {}
    else:
        self._modularity_params = dict(modularity_params)