@not_implemented_for('undirected')
def weakly_connected_component_subgraphs(G, copy=True):
 for comp in weakly_connected_components(G):
  if copy:
   (yield G.subgraph(comp).copy())
  else:
   (yield G.subgraph(comp))

@ not_implemented_for ( 'undirected' ) def weakly_connected_component_subgraphs ( G , copy = True ) : for comp in weakly_connected_components ( G ) : if copy : ( yield G . subgraph ( comp ) . copy ( ) ) else : ( yield G . subgraph ( comp ) )
generate weakly connected components as subgraphs .