<｜begin▁of▁sentence｜>### Instruction:
Given a directed graph with an edge set [(0, 1), (1, 2), (2, 0), (1, 3), (3, 4), (4, 1)], can you calculate the triad census, which quantifies how many of each type of triad (three nodes connected in various ways) are present in the graph?
### Response:
from igraph import Graph

# Create a graph with predefined edges
edges = [(0, 1), (1, 2), (2, 0), (1, 3), (3, 4), (4, 1)]
g = Graph(edges=edges, directed=True)

# Calculate the triad census
triad_census = g.triad_census()

# Print the triad census
print(triad_census)
<|EOT|>
