<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def to_json(data):
 """Return data as a JSON string."""

    return json.dumps(data, default=lambda x: x.__dict__, sort_keys=True, indent=4)