<commit_before>class Exception(RuntimeError):

    """
    Exception
    """

    def __init__(self, int ierr=0):
        if ierr < MPI_SUCCESS:      ierr = MPI_ERR_UNKNOWN
        if ierr > MPI_ERR_LASTCODE: ierr = MPI_ERR_UNKNOWN
        self.ob_mpi = ierr
        RuntimeError.__init__(self, self.ob_mpi)

    def __eq__(self, int error):
        cdef int ierr = self.ob_mpi
        return <bint> (ierr == error)
    def __ne__(self, int error):
        cdef int ierr = self.ob_mpi
        return <bint> (ierr != error)
    def __lt__(self, int error):
        cdef int ierr = self.ob_mpi
        return <bint> (ierr < error)
    def __le__(self, int error):
        cdef int ierr = self.ob_mpi
        return <bint> (ierr <= error)
    def __gt__(self, int error):
        cdef int ierr = self.ob_mpi
        return <bint> (ierr > error)
    def __ge__(self, int error):
        cdef int ierr = self.ob_mpi
        return <bint> (ierr >= error)

    def __hash__(self):
        return RuntimeError.__hash__(self)

    def __bool__(self):
        cdef int ierr = self.ob_mpi
        return ierr != MPI_SUCCESS

    def __int__(self):
        if not mpi_active():
            return self.ob_mpi
        return self.Get_error_code()

    def __repr__(self):
        return "MPI.Exception(%d)" % self.ob_mpi

    def __str__(self):
        if not mpi_active():
            return "error code: %d" % self.ob_mpi
        return self.Get_error_string()

    def Get_error_code(self):
        """
        Error code
        """
        cdef int errorcode = MPI_SUCCESS
        errorcode = self.ob_mpi
        return errorcode<commit_msg>Fix truth value testing for Exception instances in Python 2<commit_after>class Exception(RuntimeError):

    """
    Exception
    """

    def __init__(self, int ierr=0):
        if ierr < MPI_SUCCESS:      ierr = MPI_ERR_UNKNOWN
        if ierr > MPI_ERR_LASTCODE: ierr = MPI_ERR_UNKNOWN
        self.ob_mpi = ierr
        RuntimeError.__init__(self, self.ob_mpi)

    def __eq__(self, int error):
        cdef int ierr = self.ob_mpi
        return <bint> (ierr == error)
    def __ne__(self, int error):
        cdef int ierr = self.ob_mpi
        return <bint> (ierr != error)
    def __lt__(self, int error):
        cdef int ierr = self.ob_mpi
        return <bint> (ierr < error)
    def __le__(self, int error):
        cdef int ierr = self.ob_mpi
        return <bint> (ierr <= error)
    def __gt__(self, int error):
        cdef int ierr = self.ob_mpi
        return <bint> (ierr > error)
    def __ge__(self, int error):
        cdef int ierr = self.ob_mpi
        return <bint> (ierr >= error)

    def __hash__(self):
        return RuntimeError.__hash__(self)

    def __bool__(self):
        cdef int ierr = self.ob_mpi
        return ierr != MPI_SUCCESS

    __nonzero__ = __bool__

    def __int__(self):
        if not mpi_active():
            return self.ob_mpi
        return self.Get_error_code()

    def __repr__(self):
        return "MPI.Exception(%d)" % self.ob_mpi

    def __str__(self):
        if not mpi_active():
            return "error code: %d" % self.ob_mpi
        return self.Get_error_string()

    def Get_error_code(self):
        """
        Error code
        """
        cdef int errorcode = MPI_SUCCESS
        errorcode = self.ob_mpi
        return errorcode
{'fraction_non_alphanumeric': 0.09670658682634731, 'fraction_numerical': 0.0008982035928143712, 'mean_word_length': 2.099257884972171, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, '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': '2605949', 'n_tokens_mistral': 1128, 'n_tokens_neox': 1073, 'n_words': 298}