<｜begin▁of▁sentence｜>### Instruction:
Given a directed graph with nodes 0, 1, 2, 3, and 4, where edges are defined as (0, 1), (1, 2), (2, 3), and (2, 4), can you perform a depth-first search starting from node 0 and print out the labeled edges encountered during the traversal?
### Response:
import networkx as nx

# Create a directed graph
G = nx.DiGraph([(0, 1), (1, 2), (2, 3), (2, 4)])

# Use dfs_labeled_edges to iterate over edges
# and get labels indicating the type of the traversal.
for edge in nx.dfs_labeled_edges(G, source=0):
    print(edge)
<|EOT|>
