# Path: openid/extension.py
# class Extension(object):
#     """An interface for OpenID extensions.
# 
#     @ivar ns_uri: The namespace to which to add the arguments for this
#         extension
#     """
#     ns_uri = None
#     ns_alias = None
# 
#     def getExtensionArgs(self):
#         """Get the string arguments that should be added to an OpenID
#         message for this extension.
# 
#         @returns: A dictionary of completely non-namespaced arguments
#             to be added. For example, if the extension's alias is
#             'uncle', and this method returns {'meat':'Hot Rats'}, the
#             final message will contain {'openid.uncle.meat':'Hot Rats'}
#         """
#         raise NotImplementedError
# 
#     def toMessage(self, message=None):
#         """Add the arguments from this extension to the provided
#         message, or create a new message containing only those
#         arguments.
# 
#         @returns: The message with the extension arguments added
#         """
#         if message is None:
#             warnings.warn('Passing None to Extension.toMessage is deprecated. '
#                           'Creating a message assuming you want OpenID 2.',
#                           DeprecationWarning, stacklevel=2)
#             message = message_module.Message(message_module.OPENID2_NS)
# 
#         implicit = message.isOpenID1()
# 
#         try:
#             message.namespaces.addAlias(self.ns_uri, self.ns_alias,
#                                         implicit=implicit)
#         except KeyError:
#             if message.namespaces.getAlias(self.ns_uri) != self.ns_alias:
#                 raise
# 
#         message.updateArgs(self.ns_uri, self.getExtensionArgs())
#         return message


import re
import warnings
import six
from openid.extension import Extension
        self.max_auth_age = None

        if max_auth_age_str:
            try:
                self.max_auth_age = int(max_auth_age_str)
            except ValueError:
                pass

    def preferredTypes(self, supported_types):
        """Given a list of authentication policy URIs that a provider
        supports, this method returns the subsequence of those types
        that are preferred by the relying party.

        @param supported_types: A sequence of authentication policy
            type URIs that are supported by a provider

        @returns: The sub-sequence of the supported types that are
            preferred by the relying party. This list will be ordered
            in the order that the types appear in the supported_types
            sequence, and may be empty if the provider does not prefer
            any of the supported authentication types.

        @returntype: List[six.text_type]
        """
        return [i for i in supported_types if i in self.preferred_auth_policies]


Request.ns_uri = ns_uri



# Path: openid/extension.py
# class Extension(object):
#     """An interface for OpenID extensions.
# 
#     @ivar ns_uri: The namespace to which to add the arguments for this
#         extension
#     """
#     ns_uri = None
#     ns_alias = None
# 
#     def getExtensionArgs(self):
#         """Get the string arguments that should be added to an OpenID
#         message for this extension.
# 
#         @returns: A dictionary of completely non-namespaced arguments
#             to be added. For example, if the extension's alias is
#             'uncle', and this method returns {'meat':'Hot Rats'}, the
#             final message will contain {'openid.uncle.meat':'Hot Rats'}
#         """
#         raise NotImplementedError
# 
#     def toMessage(self, message=None):
#         """Add the arguments from this extension to the provided
#         message, or create a new message containing only those
#         arguments.
# 
#         @returns: The message with the extension arguments added
#         """
#         if message is None:
#             warnings.warn('Passing None to Extension.toMessage is deprecated. '
#                           'Creating a message assuming you want OpenID 2.',
#                           DeprecationWarning, stacklevel=2)
#             message = message_module.Message(message_module.OPENID2_NS)
# 
#         implicit = message.isOpenID1()
# 
#         try:
#             message.namespaces.addAlias(self.ns_uri, self.ns_alias,
#                                         implicit=implicit)
#         except KeyError:
#             if message.namespaces.getAlias(self.ns_uri) != self.ns_alias:
#                 raise
# 
#         message.updateArgs(self.ns_uri, self.getExtensionArgs())
#         return message


# Path: openid/extensions/draft/pape2.py
import re
import warnings
import six
from openid.extension import Extension

        self.max_auth_age = None

        if max_auth_age_str:
            try:
                self.max_auth_age = int(max_auth_age_str)
            except ValueError:
                pass

    def preferredTypes(self, supported_types):
        """Given a list of authentication policy URIs that a provider
        supports, this method returns the subsequence of those types
        that are preferred by the relying party.

        @param supported_types: A sequence of authentication policy
            type URIs that are supported by a provider

        @returns: The sub-sequence of the supported types that are
            preferred by the relying party. This list will be ordered
            in the order that the types appear in the supported_types
            sequence, and may be empty if the provider does not prefer
            any of the supported authentication types.

        @returntype: List[six.text_type]
        """
        return [i for i in supported_types if i in self.preferred_auth_policies]


Request.ns_uri = ns_uri



class Response(Extension):