<｜begin▁of▁sentence｜>### Instruction:
Given a target number of nodes and the exponent for the power law distribution, how can one generate a graph using NetworkX where the degree sequence follows a power law distribution?
### Response:
import networkx as nx

n = 10  # Number of nodes
alpha = 2  # Exponent for the power law distribution

sequence = nx.utils.powerlaw_sequence(n, alpha)
print('Power law sequence:', sequence)

G = nx.expected_degree_graph(sequence, selfloops=False)

print(G.edges())
<|EOT|>
