<｜begin▁of▁sentence｜>### Instruction:
Given a path graph of 5 nodes created with 'nx.path_graph(5)', can you perform a depth-first search in pre-order starting from the source node 0 and also with a depth limit of 2 using NetworkX?
### Response:
import networkx as nx

# Create a path graph
G = nx.path_graph(5)

# Perform DFS in a pre-ordering starting from source node 0
preorder_nodes = list(nx.dfs_preorder_nodes(G, source=0))
print(preorder_nodes)

# Perform DFS in a pre-ordering starting from source node 0 with depth limit 2
preorder_nodes_limited = list(nx.dfs_preorder_nodes(G, source=0, depth_limit=2))
print(preorder_nodes_limited)
<|EOT|>
