<｜begin▁of▁sentence｜>### Instruction:
Given a string 'Hello, world!', create a surface and context in Cairo, use CairoTextDrawer to draw this text at coordinates (10, 10) aligned to the left and top, and then retrieve the text extents including X-bearing, Y-bearing, width, height, X-advance, and Y-advance of the text using the 'text_extents' method.
### Response:
from igraph.drawing.text import CairoTextDrawer
from cairo import ImageSurface, FORMAT_ARGB32, Context

# Create a surface and context to draw on
surface = ImageSurface(FORMAT_ARGB32, 600, 400)
context = Context(surface)

# Initialize the CairoTextDrawer with the context
cairo_drawer = CairoTextDrawer(context, halign='left', valign='top')

# Draw text and get its extents
cairo_drawer.draw_text((10, 10), "Hello, world!")
text_extents = cairo_drawer.text_extents("Hello, world!")

print(text_extents)
<|EOT|>
