<｜begin▁of▁sentence｜>### Instruction:
Given the in-degree sequence [1, 2, 1, 1, 1] and out-degree sequence [0, 1, 2, 1, 1] of a directed graph, can you check if there exists at least one directed graph that can realize these in- and out-degree sequences using NetworkX?
### Response:
import networkx as nx

# Example directed graph
G = nx.DiGraph([(1, 2), (1, 3), (2, 3), (3, 4), (4, 2), (5, 1), (5, 4)])

# Construct degree sequences
in_sequence = [d for n, d in G.in_degree()]
out_sequence = [d for n, d in G.out_degree()]

# Check if the degree sequences are digraphic
is_digraphic = nx.is_digraphical(in_sequence, out_sequence)
print(f'The degree sequences are digraphic: {is_digraphic}')
<|EOT|>
