<commit_before># This file is part of Pyrakoon, a distributed key-value store client.
#
# Copyright (C) 2010 Incubaid BVBA
#
# Licensees holding a valid Incubaid license may use this file in
# accordance with Incubaid's Arakoon commercial license agreement. For
# more information on how to enter into this agreement, please contact
# Incubaid (contact details can be found on www.arakoon.org/licensing).
#
# Alternatively, this file may be redistributed and/or modified under
# the terms of the GNU Affero General Public License version 3, as
# published by the Free Software Foundation. Under this license, this
# file is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.
#
# See the GNU Affero General Public License for more details.
# You should have received a copy of the
# GNU Affero General Public License along with this program (file "COPYING").
# If not, see <http://www.gnu.org/licenses/>.

'''Exceptions raised by `pyrakoon.client.Client` methods'''

import inspect

class ArakoonError(Exception):
    '''Base type for all Arakoon client errors'''

    CODE = None
    '''Error code sent by the Arakoon server''' #pylint: disable-msg=W0105

class NoMagic(ArakoonError):
    '''Server received a command without the magic mask'''

    CODE = 0x0001

class TooManyDeadNodes(ArakoonError):
    '''Too many nodes in the cluster are unavailable to process the request'''

    CODE = 0x0002

class NoHello(ArakoonError):
    '''No *Hello* message was sent to the server after connecting'''

    CODE = 0x0003

class NotMaster(ArakoonError):
    '''This node is not a master node'''

    CODE = 0x0004

class NotFound(KeyError, ArakoonError): #pylint: disable-msg=R0901
    '''Key not found'''

    CODE = 0x0005

class WrongCluster(ValueError, ArakoonError):
    '''Wrong cluster ID passed'''

    CODE = 0x0006

class AssertionFailed(ArakoonError):
    '''Assertion failed'''

    CODE = 0x0007

class ReadOnly(ArakoonError):
    '''Node is read-only'''

    CODE = 0x0008

class OutsideInterval(ValueError, ArakoonError):
    '''Request outside interval handled by node'''

    CODE = 0x0009

class GoingDown(ArakoonError):
    '''Node is going down'''

    CODE = 0x0010

class NotSupported(ArakoonError):
    '''Unsupported operation'''

    CODE = 0x0020

class UnknownFailure(ArakoonError):
    '''Unknown failure'''
<commit_msg>Extend error definitions<commit_after># This file is part of Pyrakoon, a distributed key-value store client.
#
# Copyright (C) 2010 Incubaid BVBA
#
# Licensees holding a valid Incubaid license may use this file in
# accordance with Incubaid's Arakoon commercial license agreement. For
# more information on how to enter into this agreement, please contact
# Incubaid (contact details can be found on www.arakoon.org/licensing).
#
# Alternatively, this file may be redistributed and/or modified under
# the terms of the GNU Affero General Public License version 3, as
# published by the Free Software Foundation. Under this license, this
# file is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.
#
# See the GNU Affero General Public License for more details.
# You should have received a copy of the
# GNU Affero General Public License along with this program (file "COPYING").
# If not, see <http://www.gnu.org/licenses/>.

'''Exceptions raised by `pyrakoon.client.Client` methods'''

import inspect

class ArakoonError(Exception):
    '''Base type for all Arakoon client errors'''

    CODE = None
    '''Error code sent by the Arakoon server''' #pylint: disable-msg=W0105

class NoMagic(ArakoonError):
    '''Server received a command without the magic mask'''

    CODE = 0x0001

class TooManyDeadNodes(ArakoonError):
    '''Too many nodes in the cluster are unavailable to process the request'''

    CODE = 0x0002

class NoHello(ArakoonError):
    '''No *Hello* message was sent to the server after connecting'''

    CODE = 0x0003

class NotMaster(ArakoonError):
    '''This node is not a master node'''

    CODE = 0x0004

class NotFound(KeyError, ArakoonError): #pylint: disable-msg=R0901
    '''Key not found'''

    CODE = 0x0005

class WrongCluster(ValueError, ArakoonError):
    '''Wrong cluster ID passed'''

    CODE = 0x0006

class AssertionFailed(ArakoonError):
    '''Assertion failed'''

    CODE = 0x0007

class ReadOnly(ArakoonError):
    '''Node is read-only'''

    CODE = 0x0008

class OutsideInterval(ValueError, ArakoonError):
    '''Request outside interval handled by node'''

    CODE = 0x0009

class GoingDown(ArakoonError):
    '''Node is going down'''

    CODE = 0x0010

class NotSupported(ArakoonError):
    '''Unsupported operation'''

    CODE = 0x0020

class NoLongerMaster(ArakoonError):
    '''No longer master'''

    CODE = 0x0021

class UnknownFailure(ArakoonError):
    '''Unknown failure'''

{'fraction_non_alphanumeric': 0.09011164274322168, 'fraction_numerical': 0.028110047846889953, 'mean_word_length': 4.17750257997936, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, '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': '306446', 'n_tokens_mistral': 1575, 'n_tokens_neox': 1396, 'n_words': 585}