<｜begin▁of▁sentence｜>### Instruction:
{'description': 'Given a directed graph with edge set [(0, 1), (1, 2), (3, 3)], how many attracting components are present in the graph?', 'inputData': 'A directed graph defined by the edge set [(0, 1), (1, 2), (3, 3)]', 'problemSolved': "This code calculates the number of attracting components in a directed graph using the NetworkX function 'number_attracting_components'."}
### Response:
import networkx as nx

# Create a directed graph
diG = nx.DiGraph()

diG.add_edges_from([(0, 1), (1, 2), (3, 3)])

# Calculate the number of attracting components
attracting_components = nx.number_attracting_components(diG)

print('Number of attracting components:', attracting_components)
<|EOT|>
