def serialize({{ location }}, output):
    cdef bytearray {{ buffer_name }} = bytearray()
    cdef dict datum
{{ serialization_code|indent(4, True) }}
    output.write({{ buffer_name }})



def deserialize(fo):
{{ deserialization_code|indent(4, True) }}
    return {{ location }}


{{ necessary_defs }}
