def intra_community_edges(G, partition):
    return sum(G.subgraph(block).size() for block in partition)
Returns the number of intra-community edges according to the given
dataset/ETHPy150Open networkx/networkx/networkx/algorithms/community/quality.py/intra_community_edges