<｜begin▁of▁sentence｜>### Instruction:
Given a graph whose edge set is [('A', 'B', 3), ('B', 'C', 5), ('C', 'D', 7), ('D', 'E', 2), ('E', 'A', 1)], can you compute the total cost of the path ['A', 'B', 'C', 'D', 'E'] using the 'path_weight' function in NetworkX?
### Response:
import networkx as nx

# Create a graph
G = nx.Graph()

# Add weighted edges
e = [('A', 'B', 3), ('B', 'C', 5), ('C', 'D', 7), ('D', 'E', 2), ('E', 'A', 1)]
G.add_weighted_edges_from(e)

# Define the path
path = ['A', 'B', 'C', 'D', 'E']

# Compute the path weight
weight = 'weight'
cost = nx.path_weight(G, path, weight)

print('Total cost of the path:', cost)
<|EOT|>
