def main(data_file_name, iterations, output_dir, min_elo, p_in, p_out, burnin):

    with PgnFile(data_file_name) as pgnfile:
        graph = ChessGraph(pgnfile, min_elo=min_elo)

    detector = CommunityDetector(p_in=p_in, p_out=p_out)

    labels = detector.run(graph, iterations=iterations)

    assert len(labels) == iterations + 1

    chosen_index, communities = CommunityDetector.estimate_partitions(labels, burnin=burnin)
    graph.communities = communities
    graph.render_community_graph(show_single_nodes=False)

    return 0
def main(data_file_name, iterations, output_dir, min_elo, p_in, p_out, burnin):

    with PgnFile(data_file_name) as pgnfile:
        graph = ChessGraph(pgnfile, min_elo=min_elo)

    detector = CommunityDetector(p_in=p_in, p_out=p_out)

    labels = detector.run(graph, iterations=iterations)

    assert len(labels) == iterations + 1

    chosen_index, communities = CommunityDetector.estimate_partitions(
        labels, burnin=burnin)
    graph.communities = communities
    graph.render_community_graph(show_single_nodes=False)

    return 0