<｜begin▁of▁sentence｜>### Instruction:
Given a path graph with 5 nodes, can you use NetworkX to generate a dictionary of successors in a depth-first search starting from node 0, with a maximum search depth of 2? The path graph's edges are as follows: [(0, 1), (1, 2), (2, 3), (3, 4)].
### Response:
import networkx as nx

G = nx.path_graph(5)
successors = nx.dfs_successors(G, source=0, depth_limit=2)
print(successors)
<|EOT|>
