#NEWLINE# def _serialize( self , value , key , obj ) : #NEWLINE# #INDENT# 'Output the URL for the endpoint, given the kwargs passed to\n        ``__init__``.\n        ' #NEWLINE# param_values = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for ( name , attr_tpl ) in iteritems ( self . params ) : #NEWLINE# #INDENT# attr_name = _tpl ( str ( attr_tpl ) ) #NEWLINE# if attr_name : #NEWLINE# #INDENT# attribute_value = utils . get_value ( attr_name , obj , default = missing ) #NEWLINE# if ( attribute_value is not missing ) : #NEWLINE# #INDENT# param_values [ name ] = attribute_value #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# err = AttributeError ( '{attr_name!r} is not a valid attribute of {obj!r}' . format ( attr_name = attr_name , obj = obj ) ) #NEWLINE# if has_forced_error : #NEWLINE# #INDENT# raise ForcedError ( err ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise err #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# param_values [ name ] = attr_tpl #NEWLINE# #UNINDENT# #UNINDENT# try : #NEWLINE# #INDENT# return url_for ( value . endpoint , ** param_values ) #NEWLINE# #UNINDENT# except BuildError as err : #NEWLINE# #INDENT# if has_forced_error : #NEWLINE# #INDENT# raise ForcedError ( err ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise err