<｜begin▁of▁sentence｜>### Instruction:
Using the networkx library, how can you generate and visualize a random lobster graph with 10 nodes, where level 1 edges are added with a probability of 0.7 and level 2 edges with a probability of 0.2, ensuring reproducibility by setting the seed to 42?
### Response:
import networkx as nx
import matplotlib.pyplot as plt

# Parameters
n = 10  # number of nodes
p1 = 0.7 # probability of adding an edge at level 1
p2 = 0.2 # probability of adding an edge at level 2
seed = 42 # seed for reproducibility

# Generate a random lobster graph
lobster = nx.random_lobster(n, p1, p2, seed=seed)

# Draw the graph
nx.draw(lobster, with_labels=True)
plt.show()
<|EOT|>
