<commit_before>from zope.interface import implements

from vumi.transports.smpp.helpers import (IDeliveryReportProcessor,
                                          IDeliverShortMessageProcessor)


class EsmeCallbacksDeliveryReportProcessor(object):
    implements(IDeliveryReportProcessor)

    def __init__(self, protocol):
        self.protocol = protocol

    def on_delivery_report_pdu(self, receipted_message_id, message_state):
        status = {
            1: 'ENROUTE',
            2: 'DELIVERED',
            3: 'EXPIRED',
            4: 'DELETED',
            5: 'UNDELIVERABLE',
            6: 'ACCEPTED',
            7: 'UNKNOWN',
            8: 'REJECTED',
        }.get(message_state, 'UNKNOWN')
        return self.protocol.esme_callbacks.delivery_report(
            receipted_message_id, status)

    def on_delivery_report_content(self, receipted_message_id, message_state):
        return self.protocol.esme_callbacks.delivery_report(
            receipted_message_id, message_state)


class EsmeCallbacksDeliverShortMessageProcessor(object):
    implements(IDeliverShortMessageProcessor)

    def __init__(self, protocol):
        self.protocol = protocol
<commit_msg>positional arguments are getting eaten by the make_cb() function in the tests<commit_after>from zope.interface import implements

from vumi.transports.smpp.helpers import (IDeliveryReportProcessor,
                                          IDeliverShortMessageProcessor)


class EsmeCallbacksDeliveryReportProcessor(object):
    implements(IDeliveryReportProcessor)

    def __init__(self, protocol):
        self.protocol = protocol

    def on_delivery_report_pdu(self, receipted_message_id, message_state):
        status = {
            1: 'ENROUTE',
            2: 'DELIVERED',
            3: 'EXPIRED',
            4: 'DELETED',
            5: 'UNDELIVERABLE',
            6: 'ACCEPTED',
            7: 'UNKNOWN',
            8: 'REJECTED',
        }.get(message_state, 'UNKNOWN')
        return self.protocol.esme_callbacks.delivery_report(
            message_id=receipted_message_id, message_state=status)

    def on_delivery_report_content(self, receipted_message_id, message_state):
        return self.protocol.esme_callbacks.delivery_report(
            message_id=receipted_message_id, message_state=message_state)


class EsmeCallbacksDeliverShortMessageProcessor(object):
    implements(IDeliverShortMessageProcessor)

    def __init__(self, protocol):
        self.protocol = protocol

{'fraction_non_alphanumeric': 0.07865168539325842, 'fraction_numerical': 0.006420545746388443, 'mean_word_length': 2.8236196319018405, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4992645', 'n_tokens_mistral': 716, 'n_tokens_neox': 701, 'n_words': 131}