# Path: pushkin/sender/nordifier/constants.py
# SN_GUEST = 0
# SN_FACEBOOK = 1
# SN_GOOGLE = 2
# PLATFORM_ANDROID = 1
# PLATFORM_IPHONE = 2
# PLATFORM_IPAD = 5
# PLATFORM_ANDROID_TABLET = 6
# PLATFORM_BY_PROVIDER = {
#     PLATFORM_ANDROID: 1,
#     PLATFORM_ANDROID_TABLET: 1,
#     PLATFORM_IPHONE: 2,
#     PLATFORM_IPAD: 2,
# }
# NOTIFICATION_CONTROL_GROUP = -2
# NOTIFICATION_READY = -1
# NOTIFICATION_SUCCESS = 0
# NOTIFICATION_UNKNOWN_ERROR = 1
# NOTIFICATION_CONNECTION_ERROR = 2
# NOTIFICATION_EXPIRED = 3
# NOTIFICATION_UNKNOWN_PLATFORM = 4
# NOTIFICATION_SENDER_QUEUE_LIMIT = 5
# NOTIFICATION_GCM_FATAL_ERROR = 100
# NOTIFICATION_GCM_UNAVAILABLE = 101
# NOTIFICATION_GCM_INVALID_REGISTRATION_ID = 102
# NOTIFICATION_GCM_DEVICE_UNREGISTERED = 103
# NOTIFICATION_APNS_MALFORMED_ERROR = 200
# NOTIFICATION_APNS_DEVICE_UNREGISTERED = 201
# TIME_TO_LIVE_HOURS = 6
# 
# Path: pushkin/sender/senders.py
# class NotificationSender(ProcessPool):
# class NotificationOperation():
# class NotificationPostProcessor(Thread):
# class NotificationStatistics:
# class ApnNotificationSender(NotificationSender):
# class GcmNotificationSender(NotificationSender):
#     NUM_WORKERS_DEFAULT = 50
#     UPDATE_CANONICALS = 1
#     UPDATE_UNREGISTERED_DEVICES = 2
#     OPERATION_QUEUE = multiprocessing.Queue()
#     PLATFORMS = (constants.PLATFORM_IPHONE,
#                  constants.PLATFORM_IPAD)
#     PLATFORMS = (constants.PLATFORM_ANDROID,
#                  constants.PLATFORM_ANDROID_TABLET)
#     def __init__(self, **kwargs):
#     def limit_exceeded(self, notification):
#     def queue_size(self):
#     def log_notifications(self, notifications):
#     def __init__(self, operation, data):
#     def __init__(self):
#     def queue_size(self):
#     def update_canonicals(self, canonical_ids):
#     def update_unregistered_devices(self, unregistered_devices):
#     def run(self):
#     def __init__(self, name, logger, last_averages=100, log_time_seconds=30):
#     def start(self):
#     def stop(self):
#     def process(self):
#     def process(self):
# 
# Path: pushkin/context.py
# PERSIST_LOGGER_PREFFIX = 'persist_'
# def setup_loggers():
# def setup_configuration(configuration_filename):
# def start_processors():
# 
# Path: pushkin/config.py
# DATABASE_CONFIG_SECTION = 'Database'
# SERVER_SPECIFIC_CONFIG_SECTION = 'ServerSpecific'
# EVENT_CONFIG_SECTION = 'Event'
# LOG_CONFIG_SECTION = 'Log'
# SERVER_CONFIG_SECTION = 'Server'
# MESSENGER_CONFIG_SECTION = 'Messenger'
# REQUEST_PROCESSOR_CONFIG_SECTION = 'RequestProcessor'
# SENDER_CONFIG_SECTION = 'Sender'
# REQUEST_HANDLER_SECTION = 'RequestHandler'
# def init(configuration_file):


import json
import sys
from pushkin.sender.nordifier import constants
from pushkin.sender import senders
from pushkin import context
from pushkin import config
                                     cls_name)
                if not issubclass(sender_cls, senders.NotificationSender):
                    raise AttributeError(
                        u"{} must be a subclass of senders.NotificationSender"
                        u"".format(sender_cls))
            except (ImportError, AttributeError, TypeError) as e:
                err = u"Failed to load sender '{}': {}: {}"
                sys.exit(err.format(sender_name, type(e).__name__, e))

            try:
                platforms = sender_cls.PLATFORMS
            except AttributeError:
                err = u"Failed to load sender: missed property {}.PLATFORMS"
                sys.exit(err.format(sender_name))

            if not platforms:
                err = u"Failed to load sender: empty {}.PLATFORMS"
                sys.exit(err.format(sender_name))

            sender_ins = sender_cls(**kwargs)

            for platform in map(int, platforms):
                if platform in self.sender_name_by_platform:
                    rival_name = self.sender_name_by_platform[platform]
                    err = (u"Failed to load sender '{}': platform '{}' "
                           u"is already registered by another sender '{}'")
                    sys.exit(err.format(sender_name, platform, rival_name))

                self.sender_name_by_platform[platform] = sender_name


# Path: pushkin/sender/nordifier/constants.py
# SN_GUEST = 0
# SN_FACEBOOK = 1
# SN_GOOGLE = 2
# PLATFORM_ANDROID = 1
# PLATFORM_IPHONE = 2
# PLATFORM_IPAD = 5
# PLATFORM_ANDROID_TABLET = 6
# PLATFORM_BY_PROVIDER = {
#     PLATFORM_ANDROID: 1,
#     PLATFORM_ANDROID_TABLET: 1,
#     PLATFORM_IPHONE: 2,
#     PLATFORM_IPAD: 2,
# }
# NOTIFICATION_CONTROL_GROUP = -2
# NOTIFICATION_READY = -1
# NOTIFICATION_SUCCESS = 0
# NOTIFICATION_UNKNOWN_ERROR = 1
# NOTIFICATION_CONNECTION_ERROR = 2
# NOTIFICATION_EXPIRED = 3
# NOTIFICATION_UNKNOWN_PLATFORM = 4
# NOTIFICATION_SENDER_QUEUE_LIMIT = 5
# NOTIFICATION_GCM_FATAL_ERROR = 100
# NOTIFICATION_GCM_UNAVAILABLE = 101
# NOTIFICATION_GCM_INVALID_REGISTRATION_ID = 102
# NOTIFICATION_GCM_DEVICE_UNREGISTERED = 103
# NOTIFICATION_APNS_MALFORMED_ERROR = 200
# NOTIFICATION_APNS_DEVICE_UNREGISTERED = 201
# TIME_TO_LIVE_HOURS = 6
# 
# Path: pushkin/sender/senders.py
# class NotificationSender(ProcessPool):
# class NotificationOperation():
# class NotificationPostProcessor(Thread):
# class NotificationStatistics:
# class ApnNotificationSender(NotificationSender):
# class GcmNotificationSender(NotificationSender):
#     NUM_WORKERS_DEFAULT = 50
#     UPDATE_CANONICALS = 1
#     UPDATE_UNREGISTERED_DEVICES = 2
#     OPERATION_QUEUE = multiprocessing.Queue()
#     PLATFORMS = (constants.PLATFORM_IPHONE,
#                  constants.PLATFORM_IPAD)
#     PLATFORMS = (constants.PLATFORM_ANDROID,
#                  constants.PLATFORM_ANDROID_TABLET)
#     def __init__(self, **kwargs):
#     def limit_exceeded(self, notification):
#     def queue_size(self):
#     def log_notifications(self, notifications):
#     def __init__(self, operation, data):
#     def __init__(self):
#     def queue_size(self):
#     def update_canonicals(self, canonical_ids):
#     def update_unregistered_devices(self, unregistered_devices):
#     def run(self):
#     def __init__(self, name, logger, last_averages=100, log_time_seconds=30):
#     def start(self):
#     def stop(self):
#     def process(self):
#     def process(self):
# 
# Path: pushkin/context.py
# PERSIST_LOGGER_PREFFIX = 'persist_'
# def setup_loggers():
# def setup_configuration(configuration_filename):
# def start_processors():
# 
# Path: pushkin/config.py
# DATABASE_CONFIG_SECTION = 'Database'
# SERVER_SPECIFIC_CONFIG_SECTION = 'ServerSpecific'
# EVENT_CONFIG_SECTION = 'Event'
# LOG_CONFIG_SECTION = 'Log'
# SERVER_CONFIG_SECTION = 'Server'
# MESSENGER_CONFIG_SECTION = 'Messenger'
# REQUEST_PROCESSOR_CONFIG_SECTION = 'RequestProcessor'
# SENDER_CONFIG_SECTION = 'Sender'
# REQUEST_HANDLER_SECTION = 'RequestHandler'
# def init(configuration_file):


# Path: pushkin/sender/sender_manager.py
import json
import sys
from pushkin.sender.nordifier import constants
from pushkin.sender import senders
from pushkin import context
from pushkin import config

                                     cls_name)
                if not issubclass(sender_cls, senders.NotificationSender):
                    raise AttributeError(
                        u"{} must be a subclass of senders.NotificationSender"
                        u"".format(sender_cls))
            except (ImportError, AttributeError, TypeError) as e:
                err = u"Failed to load sender '{}': {}: {}"
                sys.exit(err.format(sender_name, type(e).__name__, e))

            try:
                platforms = sender_cls.PLATFORMS
            except AttributeError:
                err = u"Failed to load sender: missed property {}.PLATFORMS"
                sys.exit(err.format(sender_name))

            if not platforms:
                err = u"Failed to load sender: empty {}.PLATFORMS"
                sys.exit(err.format(sender_name))

            sender_ins = sender_cls(**kwargs)

            for platform in map(int, platforms):
                if platform in self.sender_name_by_platform:
                    rival_name = self.sender_name_by_platform[platform]
                    err = (u"Failed to load sender '{}': platform '{}' "
                           u"is already registered by another sender '{}'")
                    sys.exit(err.format(sender_name, platform, rival_name))

                self.sender_name_by_platform[platform] = sender_name


            if config.main_log_level == context.logging.DEBUG: