<｜begin▁of▁sentence｜>### Instruction:
Given in-degree sequence [2, 2, 2, 1] and out-degree sequence [2, 1, 2, 2], use the directed_configuration_model function from NetworkX to generate a random directed graph with these degree sequences, then remove any parallel edges and self-loops from the graph. What would be the resulting set of edges?
### Response:
import networkx as nx

# Define the in-degree and out-degree sequences
in_degree_sequence = [2, 2, 2, 1]
out_degree_sequence = [2, 1, 2, 2]

# Create a directed configuration model graph
D = nx.directed_configuration_model(in_degree_sequence, out_degree_sequence, seed=42)

# Remove parallel edges and self-loops
D = nx.DiGraph(D)
D.remove_edges_from(nx.selfloop_edges(D))

# Print the edges of the graph
print(D.edges())
<|EOT|>
