<｜begin▁of▁sentence｜>### Instruction:
As a Medical Transcriptionist, you've been asked to transcribe a doctor's dictation about a patient's medical history, examination, and treatment plan into a written document using transcription software. The doctor has provided the text "Sample text" and specified that it should be formatted within a bounding box measuring 600 units wide and 400 units high. Your task is to use the CairoTextDrawer's draw method with the wrap parameter to accurately format the text within the specified dimensions and save it as an image named 'text_drawn.png' to ensure the completeness and confidentiality of the patient's medical records.
### Response:
import igraph as ig
from igraph.drawing.text import CairoTextDrawer
from cairo import ImageSurface, Context

# Create an igraph graph
g = ig.Graph.Tree(3, 2)

# Initialize Cairo surface and context
surface = ImageSurface(cairo.FORMAT_ARGB32, 600, 400)
context = Context(surface)

# Create a CairoTextDrawer
ctd = CairoTextDrawer(context, bbox=(0, 0, 600, 400))

# Draw the text within the bounding box
text_to_draw = 'Sample text'
ctd.draw(text_to_draw, wrap=True)

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