<｜begin▁of▁sentence｜>### Instruction:
Given a directed graph with weighted edges [(1, 2, 3), (1, 3, 2), (2, 3, 5), (3, 4, 4)], how can you use NetworkX to find the maximum branching of this graph?
### Response:
import networkx as nx

# Create a directed graph
G = nx.DiGraph()
# Add edges with weights
G.add_weighted_edges_from([(1, 2, 3), (1, 3, 2), (2, 3, 5), (3, 4, 4)])

# Find a maximum branching of the graph
B = nx.maximum_branching(G)

# Print the edges of the maximum branching
print(B.edges(data=True))
<|EOT|>
