<｜begin▁of▁sentence｜>### Instruction:
Given a graph with edge set [(0, 1), (1, 2), (0, 2), (2, 3)] and an undirected mode, can you use the distances function in igraph to calculate the shortest path lengths from vertex 0 to all other vertices?
### Response:
import igraph as ig

# Create a graph
g = ig.Graph(edges=[(0, 1), (1, 2), (0, 2), (2, 3)], directed=False)

# Calculate distances from vertex 0
distances = g.distances(source=0)

# Print the distances
print('Distances from vertex 0:', distances)
<|EOT|>
