<commit_before># Copyright (C) 2001,2002 Python Software Foundation
# Author: <EMAIL> (<NAME>)

"""email package exception classes.
"""




class MessageError(Exception):
    """Base class for errors in the email package."""


class MessageParseError(MessageError):
    """Base class for message parsing errors."""


class HeaderParseError(MessageParseError):
    """Error while parsing headers."""


class BoundaryError(MessageParseError):
    """Couldn't find terminating boundary."""


class MultipartConversionError(MessageError, TypeError):
    """Conversion to a multipart is prohibited."""<commit_msg>Add MessageDefect and subclasses.<commit_after># Copyright (C) 2001-2004 Python Software Foundation
# Author: <EMAIL> (<NAME>)

"""email package exception classes."""




class MessageError(Exception):
    """Base class for errors in the email package."""


class MessageParseError(MessageError):
    """Base class for message parsing errors."""


class HeaderParseError(MessageParseError):
    """Error while parsing headers."""


class BoundaryError(MessageParseError):
    """Couldn't find terminating boundary."""


class MultipartConversionError(MessageError, TypeError):
    """Conversion to a multipart is prohibited."""




# These are parsing defects which the parser was able to work around.
class MessageDefect:
    """Base class for a message defect."""

    def __init__(self, line=None):
        self.line = line

class NoBoundaryInMultipart(MessageDefect):
    """A message claimed to be a multipart but had no boundary parameter."""

class StartBoundaryNotFound(MessageDefect):
    """The claimed start boundary was never found."""

class FirstHeaderLineIsContinuation(MessageDefect):
    """A message had a continuation line as its first header line."""

class MisplacedEnvelopeHeader(MessageDefect):
    """A 'Unix-from' header was found in the middle of a header block."""

class MalformedHeader(MessageDefect):
    """Found a header that was missing a colon, or was otherwise malformed"""
{'fraction_non_alphanumeric': 0.10863095238095238, 'fraction_numerical': 0.007936507936507936, 'mean_word_length': 5.002976190476191, 'pattern_counts': {'":': 0, '<': 7, '<?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': '1025890', 'n_tokens_mistral': 546, 'n_tokens_neox': 495, 'n_words': 197}