<commit_before># -*- coding: utf-8 -*-
from i8c import I8Error

class I8XError(I8Error):
    """Base class for all runtime errors.
    """
    def __init__(self, msg, prefix="i8x"):
        I8Error.__init__(self, msg, prefix)

class InputFileError(I8XError):
    """An error occurred processing one of our input files.
    """
    def __init__(self, filename, msg):
        I8XError.__init__(self, msg, filename)

class ELFFileError(InputFileError):
    """An error occurred processing an ELF file.
    """

class TestFileError(InputFileError):
    """An error occurred processing a Python test file.
    """

class HeaderFileError(InputFileError):
    """An error occurred processing a C header file.
    """
    def __init__(self, filename, linenumber):
        I8XError.__init__(self,
                          u"expected ‘#define NAME VALUE’",
                          "%s:%d" % (filename, linenumber))

class NoteError(I8XError):
    """An error was detected while decoding a note.
    """
    def __init__(self, es, msg):
        I8XError.__init__(self, msg, "%s[0x%08x]" % (es.filename, es.start))

class CorruptNoteError(NoteError):
    """A corrupt note was detected.
    """
    def __init__(self, elfslice):
        NoteError.__init__(self, elfslice, "corrupt note")

class UnhandledNoteError(NoteError):
    """An unhandled note was detected.
    """
    def __init__(self, elfslice):
        NoteError.__init__(self, elfslice, "unhandled note")

class FunctionLookupError(I8XError):
    """An error occurred during function lookup.
    """
    def __init__(self, msg, reference=None):
        if reference is None:
            I8XError.__init__(self, msg)
        else:
            I8XError.__init__(self, msg, reference.referrer)

class UndefinedFunctionError(FunctionLookupError):
    """The requested function was not defined.
    """
    def __init__(self, signature, reference=None):
        FunctionLookupError.__init__(
            self, "undefined function ‘%s’" % signature, reference)

class AmbiguousFunctionError(FunctionLookupError):
    """Multiple copies of the requested function were found.
    """
    def __init__(self, signature, reference=None):
        FunctionLookupError.__init__(
            self, "function ‘%s’ defined more than once" % signature,
            reference)
<commit_msg>Mark two strings as unicode<commit_after># -*- coding: utf-8 -*-
from i8c import I8Error

class I8XError(I8Error):
    """Base class for all runtime errors.
    """
    def __init__(self, msg, prefix="i8x"):
        I8Error.__init__(self, msg, prefix)

class InputFileError(I8XError):
    """An error occurred processing one of our input files.
    """
    def __init__(self, filename, msg):
        I8XError.__init__(self, msg, filename)

class ELFFileError(InputFileError):
    """An error occurred processing an ELF file.
    """

class TestFileError(InputFileError):
    """An error occurred processing a Python test file.
    """

class HeaderFileError(InputFileError):
    """An error occurred processing a C header file.
    """
    def __init__(self, filename, linenumber):
        I8XError.__init__(self,
                          u"expected ‘#define NAME VALUE’",
                          "%s:%d" % (filename, linenumber))

class NoteError(I8XError):
    """An error was detected while decoding a note.
    """
    def __init__(self, es, msg):
        I8XError.__init__(self, msg, "%s[0x%08x]" % (es.filename, es.start))

class CorruptNoteError(NoteError):
    """A corrupt note was detected.
    """
    def __init__(self, elfslice):
        NoteError.__init__(self, elfslice, "corrupt note")

class UnhandledNoteError(NoteError):
    """An unhandled note was detected.
    """
    def __init__(self, elfslice):
        NoteError.__init__(self, elfslice, "unhandled note")

class FunctionLookupError(I8XError):
    """An error occurred during function lookup.
    """
    def __init__(self, msg, reference=None):
        if reference is None:
            I8XError.__init__(self, msg)
        else:
            I8XError.__init__(self, msg, reference.referrer)

class UndefinedFunctionError(FunctionLookupError):
    """The requested function was not defined.
    """
    def __init__(self, signature, reference=None):
        FunctionLookupError.__init__(
            self, u"undefined function ‘%s’" % signature, reference)

class AmbiguousFunctionError(FunctionLookupError):
    """Multiple copies of the requested function were found.
    """
    def __init__(self, signature, reference=None):
        FunctionLookupError.__init__(
            self, u"function ‘%s’ defined more than once" % signature,
            reference)

{'fraction_non_alphanumeric': 0.11363636363636363, 'fraction_numerical': 0.007718696397941681, 'mean_word_length': 3.1029023746701845, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7358837', 'n_tokens_mistral': 1342, 'n_tokens_neox': 1334, 'n_words': 390}