<｜begin▁of▁sentence｜>### Instruction:
Given a weighted directed graph which you can read from graph_data.gml, can you use the average_path_length function in igraph to calculate the average path length in the graph, considering it as directed and using weights for the calculation?
### Response:
from igraph import Graph

# Read the graph
graph = Graph.Read('graph_data.gml')

# Calculate the average path length
avg_path_len = graph.average_path_length(directed=True, unconn=True, weights='weight')

# Print the average path length
print('Average path length:', avg_path_len)
<|EOT|>
