<｜begin▁of▁sentence｜>### Instruction:
Given a graph with edge set [(0,1), (1,2), (0,2)], how can you use the AlphaVaryingEdgeDrawer in igraph with Cairo to draw the graph such that the edges' alpha (transparency) varies from the source to the destination vertex?
### Response:
import igraph as ig
import cairo

g = ig.Graph(edges=[(0,1), (1,2), (0,2)])

# Create a Cairo surface to draw on
surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, 400, 400)
ctx = cairo.Context(surface)

# Initialize the AlphaVaryingEdgeDrawer with context and transparency settings
edge_drawer = ig.drawing.cairo.edge.AlphaVaryingEdgeDrawer(ctx, alpha_at_src=1.0, alpha_at_dest=0.1)

# Create a plot object
plot = ig.Plot(surface, bbox=(400, 400), background="white")
plot.add(g)

# Override the default edge drawer with the AlphaVaryingEdgeDrawer
plot.edge_drawer = edge_drawer

# Draw the graph with the custom edge drawer
plot.redraw()

# Save the plot to a file
surface.write_to_png('graph_with_alpha_varying_edges.png')
<|EOT|>
