<｜begin▁of▁sentence｜>### Instruction:
As a process engineer working for a manufacturing company, you have been asked to analyze the efficiency of a complex production line. The line consists of multiple interconnected components, each influencing the overall performance. To model this system, you have identified the components as nodes and their interconnections as directed edges in a graph. You need to use the connected_components method in igraph API to identify and display both the strongly and weakly connected components within this production line graph.
### Response:
import igraph as ig

# Create a directed graph
g = ig.Graph([(0, 1), (1, 2), (2, 3), (3, 4), (4, 0), (4, 5)], directed=True)

# Calculate the strongly connected components
strongly_connected = g.connected_components(mode='strong')

# Calculate the weakly connected components
weakly_connected = g.connected_components(mode='weak')

# Print the results
print('Strongly connected components:', strongly_connected)
print('Weakly connected components:', weakly_connected.subgraphs())
<|EOT|>
