<commit_before>import struct

from apns.commands import ERROR_RESPONSE


class ErrorResponseError(Exception):
    pass


class ErrorResponseInvalidCommandError(ErrorResponseError):
    pass


class ErrorResponseInvalidCodeError(ErrorResponseError):
    pass


class ErrorResponse(object):
    CODES = {
        0: 'No errors encountered',
        1: 'Processing error',
        2: 'Missing device token',
        3: 'Missing topic',
        4: 'Missing payload',
        5: 'Invalid token size',
        6: 'Invalid topic size',
        7: 'Invalid payload size',
        8: 'Invalid token',
        10: 'Shutdown',
        255: 'Unknown'
    }

    FORMAT = '>BBI'
    COMMAND = ERROR_RESPONSE

    def __init__(self):
        self.code = self.name = self.identifier = None

    def __str__(self):
        return '<ErrorResponse: %s>' % self.name
<commit_msg>Add constants to ErrorResponse class<commit_after>import struct

from apns.commands import ERROR_RESPONSE


class ErrorResponseError(Exception):
    pass


class ErrorResponseInvalidCommandError(ErrorResponseError):
    pass


class ErrorResponseInvalidCodeError(ErrorResponseError):
    pass


class ErrorResponse(object):
    CODE_OK = 0
    CODE_PROCESSING_ERROR = 1
    CODE_MISSING_TOKEN = 2
    CODE_MISSING_TOPIC = 3
    CODE_MISSING_PAYLOAD = 4
    CODE_INVALID_TOKEN_SIZE = 5
    CODE_INVALID_TOPIC_SIZE = 6
    CODE_INVALID_PAYLOAD_SIZE = 7
    CODE_INVALID_TOKEN = 8
    CODE_SHUTDOWN = 10
    CODE_UNKNOWN = 255

    CODES = {
        CODE_OK: 'No errors encountered',
        CODE_PROCESSING_ERROR: 'Processing error',
        CODE_MISSING_TOKEN: 'Missing token',
        CODE_MISSING_TOPIC: 'Missing topic',
        CODE_MISSING_PAYLOAD: 'Missing payload',
        CODE_INVALID_TOKEN_SIZE: 'Invalid token size',
        CODE_INVALID_TOPIC_SIZE: 'Invalid topic size',
        CODE_INVALID_PAYLOAD_SIZE: 'Invalid payload size',
        CODE_INVALID_TOKEN: 'Invalid token',
        CODE_SHUTDOWN: 'Shutdown',
        CODE_UNKNOWN: 'Unknown'
    }

    FORMAT = '>BBI'
    COMMAND = ERROR_RESPONSE

    def __init__(self):
        self.code = self.name = self.identifier = None

    def __str__(self):
        return '<ErrorResponse: %s>' % self.name

{'fraction_non_alphanumeric': 0.08329581269698334, 'fraction_numerical': 0.012606933813597478, 'mean_word_length': 3.0108303249097474, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5861113', 'n_tokens_mistral': 726, 'n_tokens_neox': 669, 'n_words': 165}