(graph, resolution, state)
return res
Run the louvain clustering on `graph`.
Run the louvain clustering on `graph`.
Run the louvain clustering on graph .
def run_on_graph(graph, resolution, state):
    # type: (nx.Graph, float, TaskState) -> Results
    """
    Run the louvain clustering on `graph`.
    """
    state = state  # type: TaskState
    res = Results(resolution=resolution)
    louvain = Louvain(resolution=resolution, random_state=0)
    state.set_status("Detecting communities...")
    if state.is_interuption_requested():
        return res
    partition = louvain(graph)
    res.partition = partition
    state.set_partial_results(("partition", res.partition))
    return res
def run_on_graph ( graph , resolution , state ) : # type: (nx.Graph, float, TaskState) -> Results state = state # type: TaskState res = Results ( resolution = resolution ) louvain = Louvain ( resolution = resolution , random_state = 0 ) state . set_status ( "Detecting communities..." ) if state . is_interuption_requested ( ) : return res partition = louvain ( graph ) res . partition = partition state . set_partial_results ( ( "partition" , res . partition ) ) return res