# Path: randtalkbot/errors.py
# class EmptyLanguagesError(Exception):
#     pass
# 
# class SexError(Exception):
#     def __init__(self, sex):
#         super(SexError, self).__init__(
#             'Unknown sex: \"{}\" -- is not a valid sex name.'.format(sex),
#             )
#         self.name = sex
# 
# class StrangerError(Exception):
#     pass
# 
# Path: randtalkbot/i18n.py
# def get_languages_codes(names):
#     """Raises:
#         LanguageNotFoundError: If unable to recognize some language.
# 
#     Returns:
#         list<str>: Deduplicated list of languages' codes.
#     """
#     names = ''.join([c for c in names if c not in QUOTES])
# 
#     if names.strip().lower() in SAME_LANGUAGE_NAMES:
#         return ['same']
# 
#     names = [name.strip() for name in names.split(',')]
#     compact_names = filter(bool, names)
#     languages_codes = map(_get_language_code, compact_names)
#     unique_languages_codes = _get_deduplicated(languages_codes)
#     return unique_languages_codes
# 
# def get_languages_names(codes):
#     """Raises:
#         LanguageNotFoundError: If unable to recognize some language.
# 
#     Returns:
#         str: Comma-separated list of languages' names.
#     """
#     names = map(_get_language_name, codes)
#     return ', '.join(names)
# 
# class LanguageNotFoundError(Exception):
#     def __init__(self, name):
#         super(LanguageNotFoundError, self).__init__('Language \"{0}\" wasn\'t found.'.format(name))
#         self.name = name
# 
# SUPPORTED_LANGUAGES_NAMES = list(zip(*SUPPORTED_LANGUAGES_NAMES_CHOICES))[1]
# 
# Path: randtalkbot/stranger.py
# SEX_NAMES = list(zip(*SEX_CHOICES))[1]
# 
# Path: randtalkbot/stranger_sender_service.py
# class StrangerSenderService:
#     _instance = None
# 
#     def __init__(self, bot):
#         self._bot = bot
#         self._stranger_senders = {}
# 
#     @classmethod
#     def get_instance(cls, bot=None):
#         if cls._instance is None:
#             if bot is None:
#                 raise StrangerSenderServiceError(
#                     'Instance wasn\'t initialized. Provide arguments to construct one.',
#                     )
#             else:
#                 cls._instance = cls(bot)
# 
#         return cls._instance
# 
#     def get_cache_size(self):
#         return len(self._stranger_senders)
# 
#     def get_or_create_stranger_sender(self, stranger):
#         try:
#             return self._stranger_senders[stranger.telegram_id]
#         except KeyError:
#             stranger_sender = StrangerSender(self._bot, stranger)
#             self._stranger_senders[stranger.telegram_id] = stranger_sender
#             return stranger_sender
# 
# Path: randtalkbot/wizard.py
# class Wizard:
#     async def activate(self):
#         raise NotImplementedError()
# 
#     async def deactivate(self):
#         raise NotImplementedError()
# 
#     async def handle(self, message):
#         """Raises:
#             NotImplementedError: Abstract method needs to be implemented.
# 
#         Returns:
#             bool: `True` if message was interpreted in this method. `False` if message still needs
#                 interpretation.
#         """
#         raise NotImplementedError()


import logging
from telepot.exception import TelegramError
from .errors import EmptyLanguagesError, SexError, StrangerError
from .i18n import get_languages_codes, get_languages_names, LanguageNotFoundError, \
    SUPPORTED_LANGUAGES_NAMES
from .stranger import SEX_NAMES
from .stranger_sender_service import StrangerSenderService
from .wizard import Wizard
# RandTalkBot Bot matching you with a random person on Telegram.
# Copyright (C) 2016 quasiyoke
#
# You should have received a copy of the GNU Affero General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.


def _(string_instance):
    return string_instance

LOGGER = logging.getLogger('randtalkbot.stranger_setup_wizard')
SEX_KEYBOARD = {

# Path: randtalkbot/errors.py
# class EmptyLanguagesError(Exception):
#     pass
# 
# class SexError(Exception):
#     def __init__(self, sex):
#         super(SexError, self).__init__(
#             'Unknown sex: \"{}\" -- is not a valid sex name.'.format(sex),
#             )
#         self.name = sex
# 
# class StrangerError(Exception):
#     pass
# 
# Path: randtalkbot/i18n.py
# def get_languages_codes(names):
#     """Raises:
#         LanguageNotFoundError: If unable to recognize some language.
# 
#     Returns:
#         list<str>: Deduplicated list of languages' codes.
#     """
#     names = ''.join([c for c in names if c not in QUOTES])
# 
#     if names.strip().lower() in SAME_LANGUAGE_NAMES:
#         return ['same']
# 
#     names = [name.strip() for name in names.split(',')]
#     compact_names = filter(bool, names)
#     languages_codes = map(_get_language_code, compact_names)
#     unique_languages_codes = _get_deduplicated(languages_codes)
#     return unique_languages_codes
# 
# def get_languages_names(codes):
#     """Raises:
#         LanguageNotFoundError: If unable to recognize some language.
# 
#     Returns:
#         str: Comma-separated list of languages' names.
#     """
#     names = map(_get_language_name, codes)
#     return ', '.join(names)
# 
# class LanguageNotFoundError(Exception):
#     def __init__(self, name):
#         super(LanguageNotFoundError, self).__init__('Language \"{0}\" wasn\'t found.'.format(name))
#         self.name = name
# 
# SUPPORTED_LANGUAGES_NAMES = list(zip(*SUPPORTED_LANGUAGES_NAMES_CHOICES))[1]
# 
# Path: randtalkbot/stranger.py
# SEX_NAMES = list(zip(*SEX_CHOICES))[1]
# 
# Path: randtalkbot/stranger_sender_service.py
# class StrangerSenderService:
#     _instance = None
# 
#     def __init__(self, bot):
#         self._bot = bot
#         self._stranger_senders = {}
# 
#     @classmethod
#     def get_instance(cls, bot=None):
#         if cls._instance is None:
#             if bot is None:
#                 raise StrangerSenderServiceError(
#                     'Instance wasn\'t initialized. Provide arguments to construct one.',
#                     )
#             else:
#                 cls._instance = cls(bot)
# 
#         return cls._instance
# 
#     def get_cache_size(self):
#         return len(self._stranger_senders)
# 
#     def get_or_create_stranger_sender(self, stranger):
#         try:
#             return self._stranger_senders[stranger.telegram_id]
#         except KeyError:
#             stranger_sender = StrangerSender(self._bot, stranger)
#             self._stranger_senders[stranger.telegram_id] = stranger_sender
#             return stranger_sender
# 
# Path: randtalkbot/wizard.py
# class Wizard:
#     async def activate(self):
#         raise NotImplementedError()
# 
#     async def deactivate(self):
#         raise NotImplementedError()
# 
#     async def handle(self, message):
#         """Raises:
#             NotImplementedError: Abstract method needs to be implemented.
# 
#         Returns:
#             bool: `True` if message was interpreted in this method. `False` if message still needs
#                 interpretation.
#         """
#         raise NotImplementedError()


# Path: randtalkbot/stranger_setup_wizard.py
import logging
from telepot.exception import TelegramError
from .errors import EmptyLanguagesError, SexError, StrangerError
from .i18n import get_languages_codes, get_languages_names, LanguageNotFoundError, \
    SUPPORTED_LANGUAGES_NAMES
from .stranger import SEX_NAMES
from .stranger_sender_service import StrangerSenderService
from .wizard import Wizard

# RandTalkBot Bot matching you with a random person on Telegram.
# Copyright (C) 2016 quasiyoke
#
# You should have received a copy of the GNU Affero General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.


def _(string_instance):
    return string_instance

LOGGER = logging.getLogger('randtalkbot.stranger_setup_wizard')
SEX_KEYBOARD = {

    'keyboard': [SEX_NAMES[:2], SEX_NAMES[2:], ],