def serialize_type_with_template(oftype, accessor, types):
 template = Template(type_description(oftype, types)['template'])
 mapping = {'ARG': accessor}
 return template.substitute(mapping)

def serialize_type_with_template ( oftype , accessor , types ) : template = Template ( type_description ( oftype , types ) [ 'template' ] ) mapping = { 'ARG' : accessor } return template . substitute ( mapping )
returns a serialization template for the given type with all placeholders replaced with the actual values .