<commit_before># Copyright 2014 Rackspace
# All Rights Reserved.
#
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
#    not use this file except in compliance with the License. You may obtain
#    a copy of the License at
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.

import msgpack


# The urgency levels
URGENCY_LOW = 0
URGENCY_NORMAL = 1
URGENCY_CRITICAL = 2

# A name to level map
urgency_map = {
    'low': URGENCY_LOW,
    'normal': URGENCY_NORMAL,
    'critical': URGENCY_CRITICAL,
}

# The current protocol version.  An entry for this must exist in the
# _versions dictionary.
_curr_version = 0

# Describes the known message types in a given protocol version.  For
# each version, the value is a dictionary mapping recognized message
# types to a dictionary having the keys "required" and "defaults".
# The value of "required" is a set containing the arguments that the
# message must contain, and the value of "defaults" is a dictionary
# mapping optional arguments to the default value that should be
# assumed for them.
_versions = {
    0: {
        'notify': {
            'required': set(['app_name', 'summary', 'body']),
            'defaults': {
                'urgency': URGENCY_LOW,
                'category': None,
                'id': None,
            },
        },
        'accepted': {
            'required': set(['id']),
        },
        'subscribe': {},
        'subscribed': {},
        'goodbye': {},
        'error': {<commit_msg>Add urgency_names map<commit_after># Copyright 2014 Rackspace
# All Rights Reserved.
#
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
#    not use this file except in compliance with the License. You may obtain
#    a copy of the License at
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.

import msgpack


# The urgency levels
URGENCY_LOW = 0
URGENCY_NORMAL = 1
URGENCY_CRITICAL = 2

# A name to level map
urgency_map = {
    'low': URGENCY_LOW,
    'normal': URGENCY_NORMAL,
    'critical': URGENCY_CRITICAL,
}

# A level to name map
urgency_names = dict((v, k) for k, v in urgency_map.items())

# The current protocol version.  An entry for this must exist in the
# _versions dictionary.
_curr_version = 0

# Describes the known message types in a given protocol version.  For
# each version, the value is a dictionary mapping recognized message
# types to a dictionary having the keys "required" and "defaults".
# The value of "required" is a set containing the arguments that the
# message must contain, and the value of "defaults" is a dictionary
# mapping optional arguments to the default value that should be
# assumed for them.
_versions = {
    0: {
        'notify': {
            'required': set(['app_name', 'summary', 'body']),
            'defaults': {
                'urgency': URGENCY_LOW,
                'category': None,
                'id': None,
            },
        },
        'accepted': {
            'required': set(['id']),
        },
        'subscribe': {},
        'subscribed': {},
        'goodbye': {},
        'error': {
{'fraction_non_alphanumeric': 0.0926712692511949, 'fraction_numerical': 0.006903876792352629, 'mean_word_length': 2.7745490981963927, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '5956283', 'n_tokens_mistral': 1062, 'n_tokens_neox': 1051, 'n_words': 439}