#NEWLINE# def as_dict( self , **kwargs ) : #NEWLINE# #INDENT# 'Return an error dict for self.args and kwargs.' #NEWLINE# ( error , reason , details , err_kwargs ) = self . args #NEWLINE# result = { key : val for ( key , val ) in { #NEWLINE# #INDENT# 'error' : error , #NEWLINE# 'reason' : reason , #NEWLINE# 'details' : details , #NEWLINE# #UNINDENT# } . items ( ) if ( val is not None ) } #NEWLINE# result . update ( err_kwargs ) #NEWLINE# result . update ( kwargs ) #NEWLINE# return self