<｜begin▁of▁sentence｜>### Instruction:
Given a graph with the weighted edge set [(1, 2, 6), (1, 3, 2), (2, 3, 1), (2, 4, 7), (3, 5, 9), (4, 5, 3)], use NetworkX to find the maximum weight matching. The graph is undirected.
### Response:
import networkx as nx 

# Create a weighted undirected graph 
G = nx.Graph()
edges = [(1, 2, 6), (1, 3, 2), (2, 3, 1), (2, 4, 7), (3, 5, 9), (4, 5, 3)]
G.add_weighted_edges_from(edges)

# Use the max_weight_matching API 
matching = nx.max_weight_matching(G, maxcardinality=False)

# Output the matching 
print('Maximum weight matching:', sorted(matching))
<|EOT|>
