<｜begin▁of▁sentence｜>### Instruction:
{'description': 'Given an undirected graph with an edge set [(1, 2), (2, 3), (3, 4)], how can you create a directed view of the same graph using NetworkX?', 'problem_it_solves': 'Converts an undirected graph to a directed version, allowing you to work with directed edges without changing the original graph.'}
### Response:
import networkx as nx

# Create an undirected graph
G = nx.Graph()
G.add_edges_from([(1, 2), (2, 3), (3, 4)])

# Create a directed view of the graph
H = G.to_directed()

# Display edges of the directed graph
print(list(H.edges()))
<|EOT|>
