#NEWLINE# def _generate_func_serialize_stream_event_context( self , stream ) : #NEWLINE# #INDENT# self . _reset_per_func_state ( ) #NEWLINE# self . _generate_func_serialize_stream_event_context_proto ( stream ) #NEWLINE# tmpl = templates . _FUNC_SERIALIZE_STREAM_EVENT_CONTEXT_BODY_BEGIN #NEWLINE# self . _cg . add_lines ( tmpl ) #NEWLINE# self . _cg . indent ( ) #NEWLINE# func = stream . _generate_func_serialize_event_from_entity #NEWLINE# if ( stream . event_context_type is not None ) : #NEWLINE# #INDENT# func ( _PREFIX_SEC , stream . event_context_type ) #NEWLINE# #UNINDENT# self . _cg . unindent ( ) #NEWLINE# tmpl = templates . _FUNC_SERIALIZE_STREAM_EVENT_CONTEXT_BODY_END #NEWLINE# self . _cg . add_lines ( tmpl )