<｜begin▁of▁sentence｜>### Instruction:
Given a list of edges, can you create a custom Cairo edge drawer that defines a drawing method for directed edges and use it to draw the graph with the Kamada-Kawai layout?
### Response:
from igraph import Graph, plot
from igraph.drawing import AbstractCairoEdgeDrawer
import cairo

class CustomEdgeDrawer(AbstractCairoEdgeDrawer):
    def draw_directed_edge(self, edge, src_vertex, dest_vertex):
        # Custom drawing function for directed edges
        context.set_line_width(1)
        context.move_to(src_vertex['x'], src_vertex['y'])
        context.line_to(dest_vertex['x'], dest_vertex['y'])
        context.stroke()

def draw_graph(edges):
    g = Graph(edges=edges)
    layout = g.layout('kk')  # Kamada-Kawai layout
    visual_style = {}
    visual_style['vertex_size'] = 20
    visual_style['layout'] = layout
    surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, 600, 400)
    context = cairo.Context(surface)
    drawer = CustomEdgeDrawer(context)
    plot(g, target=surface, edge_drawer=drawer, **visual_style)

draw_graph([(0, 1), (1, 2), (2, 0)])
<|EOT|>
