<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def serialize(template, options=SerializerOptions()):
 """Serialize the provided template according to the language specifications."""

    context = SerializerContext(options)
    context.serialize(flatten(template))
    return context.output