# Path: twitter-winner/oauthlib/oauth2/rfc6749/endpoints/base.py
# class BaseEndpoint(object):
#     def __init__(self):
#         self._available = True
#         self._catch_errors = False
# 
#     @property
#     def available(self):
#         return self._available
# 
#     @available.setter
#     def available(self, available):
#         self._available = available
# 
#     @property
#     def catch_errors(self):
#         return self._catch_errors
# 
#     @catch_errors.setter
#     def catch_errors(self, catch_errors):
#         self._catch_errors = catch_errors
# 
# def catch_errors_and_unavailability(f):
#     @functools.wraps(f)
#     def wrapper(endpoint, uri, *args, **kwargs):
#         if not endpoint.available:
#             e = TemporarilyUnavailableError()
#             log.info('Endpoint unavailable, ignoring request %s.' % uri)
#             return {}, e.json, 503
# 
#         if endpoint.catch_errors:
#             try:
#                 return f(endpoint, uri, *args, **kwargs)
#             except OAuth2Error:
#                 raise
#             except FatalClientError:
#                 raise
#             except Exception as e:
#                 error = ServerError()
#                 log.warning('Exception caught while processing request, %s.' % e)
#                 return {}, error.json, 500
#         else:
#             return f(endpoint, uri, *args, **kwargs)
#     return wrapper


from oauthlib.common import Request, log
from .base import BaseEndpoint, catch_errors_and_unavailability
    unrecognized request parameters.  Request and response parameters
    MUST NOT be included more than once::

        # Delegated to each grant type.

    .. _`Appendix B`: http://tools.ietf.org/html/rfc6749#appendix-B
    """

    def __init__(self, default_grant_type, default_token_type, grant_types):
        BaseEndpoint.__init__(self)
        self._grant_types = grant_types
        self._default_token_type = default_token_type
        self._default_grant_type = default_grant_type

    @property
    def grant_types(self):
        return self._grant_types

    @property
    def default_grant_type(self):
        return self._default_grant_type

    @property
    def default_grant_type_handler(self):
        return self.grant_types.get(self.default_grant_type)

    @property
    def default_token_type(self):
        return self._default_token_type


# Path: twitter-winner/oauthlib/oauth2/rfc6749/endpoints/base.py
# class BaseEndpoint(object):
#     def __init__(self):
#         self._available = True
#         self._catch_errors = False
# 
#     @property
#     def available(self):
#         return self._available
# 
#     @available.setter
#     def available(self, available):
#         self._available = available
# 
#     @property
#     def catch_errors(self):
#         return self._catch_errors
# 
#     @catch_errors.setter
#     def catch_errors(self, catch_errors):
#         self._catch_errors = catch_errors
# 
# def catch_errors_and_unavailability(f):
#     @functools.wraps(f)
#     def wrapper(endpoint, uri, *args, **kwargs):
#         if not endpoint.available:
#             e = TemporarilyUnavailableError()
#             log.info('Endpoint unavailable, ignoring request %s.' % uri)
#             return {}, e.json, 503
# 
#         if endpoint.catch_errors:
#             try:
#                 return f(endpoint, uri, *args, **kwargs)
#             except OAuth2Error:
#                 raise
#             except FatalClientError:
#                 raise
#             except Exception as e:
#                 error = ServerError()
#                 log.warning('Exception caught while processing request, %s.' % e)
#                 return {}, error.json, 500
#         else:
#             return f(endpoint, uri, *args, **kwargs)
#     return wrapper


# Path: twitter-winner/oauthlib/oauth2/rfc6749/endpoints/token.py
from oauthlib.common import Request, log
from .base import BaseEndpoint, catch_errors_and_unavailability

    unrecognized request parameters.  Request and response parameters
    MUST NOT be included more than once::

        # Delegated to each grant type.

    .. _`Appendix B`: http://tools.ietf.org/html/rfc6749#appendix-B
    """

    def __init__(self, default_grant_type, default_token_type, grant_types):
        BaseEndpoint.__init__(self)
        self._grant_types = grant_types
        self._default_token_type = default_token_type
        self._default_grant_type = default_grant_type

    @property
    def grant_types(self):
        return self._grant_types

    @property
    def default_grant_type(self):
        return self._default_grant_type

    @property
    def default_grant_type_handler(self):
        return self.grant_types.get(self.default_grant_type)

    @property
    def default_token_type(self):
        return self._default_token_type


    @catch_errors_and_unavailability