<s> from openid . message import Message <EOL> class Extension ( object ) : <EOL> """<STR_LIT>""" <EOL> ns_uri = None <EOL> ns_alias = None <EOL> def getExtensionArgs ( self ) : <EOL> """<STR_LIT>""" <EOL> raise NotImplementedError <EOL> def toMessage ( self , message = None ) : <EOL> """<STR_LIT>""" <EOL> if message is None : <EOL> message = Message ( ) <EOL> try : <EOL> message . namespaces . addAlias ( self . ns_uri , self . ns_alias ) <EOL> except KeyError : <EOL> if message . namespaces . getAlias ( self . ns_uri ) != self . ns_alias : <EOL> raise <EOL> message . updateArgs ( self . ns_uri , self . getExtensionArgs ( ) ) <EOL> return message </s>
