<｜begin▁of▁sentence｜>### Instruction:
Given a directed graph with edge set [(0, 1), (1, 2), (2, 0), (3, 4), (4, 3), (2, 3), (4, 2)], how can we find all attracting components and their corresponding induced subgraphs using NetworkX?
### Response:
import networkx as nx

# Create a directed graph
G = nx.DiGraph()
G.add_edges_from([(0, 1), (1, 2), (2, 0), (3, 4), (4, 3), (2, 3), (4, 2)])

# Generate the attracting components
attracting_components = list(nx.attracting_components(G))

# Print the attracting components
for i, component in enumerate(attracting_components):
    print(f'Attracting Component {i}: {component}')

# If you want to get the induced subgraph of each component
attracting_subgraphs = [G.subgraph(c).copy() for c in attracting_components]

for i, sg in enumerate(attracting_subgraphs):
    print(f'Subgraph of attracting component {i}: {sg.nodes()}')
<|EOT|>
