<｜begin▁of▁sentence｜>### Instruction:
Given a degree sequence [3, 2, 2, 1, 2], how can you create a random simple graph that approximates this degree sequence using NetworkX's configuration model?
### Response:
import networkx as nx
from networkx.utils import random_sequence

# Define the degree sequence
degree_sequence = [3, 2, 2, 1, 2]

# Create a graph using the configuration model
G = nx.configuration_model(degree_sequence)

# Convert to a simple graph (remove parallel edges and self loops)
H = nx.Graph(G)
H.remove_edges_from(nx.selfloop_edges(H))

# Print the edges of the resulting graph
print(list(H.edges()))
<|EOT|>
