<｜begin▁of▁sentence｜>### Instruction:
Given a 400x400 pixel image context, how would you initialize a Descartes coordinate system with a bounding box that fits the image and set bounds of (0, 0) to (100, 100), then draw the coordinate system, convert a local coordinate (50, 50) to context coordinates and save the drawing to an image file named 'coordinate_system.png'?
### Response:
import cairo
from igraph.drawing.cairo.coord import DescartesCoordinateSystem

# Set up the Cairo context
width, height = 400, 400
surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, width, height)
ctx = cairo.Context(surface)

# Initialize DescartesCoordinateSystem with given bounding box
bbox = (0, 0, width, height)
bounds = (0, 0, 100, 100)  # Example bounds
coordsys = DescartesCoordinateSystem(ctx, bbox, bounds)

# Draw the coordinate system onto the context
coordsys.draw()

# Convert the point (50, 50) in Descartes coordinate system to context coordinates
context_point = coordsys.local_to_context((50, 50))
print(f'Context coordinates: {context_point}')

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