#NEWLINE# def _serialize( self , data , content_type ) : #NEWLINE# #INDENT# 'Serialize the given dict to the provided content_type.\n\n        Uses self._serialization_metadata if it exists, which is a dict mapping\n        MIME types to information needed to serialize to that type.\n\n        ' #NEWLINE# _metadata = getattr ( type ( self ) , '_serialization_metadata' , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# serializer = Serializer ( msg ) #NEWLINE# try : #NEWLINE# #INDENT# return serializer . serialize ( data , content_type ) #NEWLINE# #UNINDENT# except exception . InvalidContentType : #NEWLINE# #INDENT# msg = ( _ ( 'The requested content type %s is invalid.' ) % content_type ) #NEWLINE# raise webob . exc . HTTPNotAcceptable ( msg )