<｜begin▁of▁sentence｜>### Instruction:
Given a directed graph with edges [(0, 1, 5), (1, 2, 2), (2, 3, -3), (1, 3, 10), (3, 2, 8)], how can you compute the shortest path distances between all pairs of nodes, taking edge weights into account?
### Response:
import networkx as nx

# Create a directed graph
G = nx.DiGraph()

# Add weighted edges
g.add_weighted_edges_from([(0, 1, 5), (1, 2, 2), (2, 3, -3), (1, 3, 10), (3, 2, 8)])

# Run Floyd-Warshall algorithm
distances = nx.floyd_warshall(G, weight='weight')

# Convert to a dictionary
results = {source: dict(target) for source, target in distances.items()}

# Print the results
print(results)
<|EOT|>
