<｜begin▁of▁sentence｜>### Instruction:
Imagine you're managing a nature reserve and wish to build an interactive exhibit showcasing the habitat interconnections between five different species. These species have varying interactions, represented by incoming and outgoing connections. Species A, B, C have both two inbound and outbound interactions, Species D has two outbound and one inbound interaction, E has one of each. How would you create this "web of life" diagram using Havel-Hakimi algorithm and NetworkX to illustrate the interaction dynamics based on the given in-degree sequence [2, 2, 2, 1, 1] and out-degree sequence [2, 2, 1, 2, 1]?
### Response:
import networkx as nx

# Define the in-degree and out-degree sequences
in_deg_sequence = [2, 2, 2, 1, 1]
out_deg_sequence = [2, 2, 1, 2, 1]

# Generate the directed graph
G = nx.directed_havel_hakimi_graph(in_deg_sequence, out_deg_sequence)

# Draw the graph
import matplotlib.pyplot as plt
nx.draw(G, with_labels=True)
plt.show()
<|EOT|>
