@not_implemented_for('undirected')
def kosaraju_strongly_connected_components(G, source=None):
    with nx.utils.reversed(G):
        post = list(nx.dfs_postorder_nodes(G, source=source))

    seen = set()
    while post:
        r = post.pop()
        if r in seen:
            continue
        c = nx.dfs_preorder_nodes(G, r)
        new = {v for v in c if v not in seen}
        yield new
        seen.update(new)
Generate nodes in strongly connected components of graph.
dataset/ETHPy150Open networkx/networkx/networkx/algorithms/components/strongly_connected.py/kosaraju_strongly_connected_components