<commit_before>"""Definitions of common exceptions for `polys` module. """

from ..utilities import public


@public
class BasePolynomialError(Exception):
    """Base class for polynomial related exceptions. """

    def new(self, *args):
        raise NotImplementedError("abstract base class")


@public
class ExactQuotientFailed(BasePolynomialError):

    def __init__(self, f, g, dom=None):
        self.f, self.g, self.domain = f, g, dom

    def __str__(self):  # pragma: no cover
        from ..printing import sstr

        if self.domain is None:
            return "%s does not divide %s" % (sstr(self.g), sstr(self.f))
        else:
            return "%s does not divide %s in %s" % (sstr(self.g), sstr(self.f), sstr(self.domain))

    def new(self, f, g):<commit_msg>Improve test coverage for polyerrors.py<commit_after>"""Definitions of common exceptions for `polys` module. """

from ..utilities import public


@public
class BasePolynomialError(Exception):
    """Base class for polynomial related exceptions. """

    def new(self, *args):
        raise NotImplementedError("abstract base class")  # pragma: no cover


@public
class ExactQuotientFailed(BasePolynomialError):

    def __init__(self, f, g, dom=None):
        self.f, self.g, self.domain = f, g, dom

    def __str__(self):  # pragma: no cover
        from ..printing import sstr

        if self.domain is None:
            return "%s does not divide %s" % (sstr(self.g), sstr(self.f))
        else:
            return "%s does not divide %s in %s" % (sstr(self.g), sstr(self.f), sstr(self.domain))

    def new(self, f, g):
{'fraction_non_alphanumeric': 0.12764632627646327, 'fraction_numerical': 0.0, 'mean_word_length': 3.047858942065491, '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': '4198117', 'n_tokens_mistral': 517, 'n_tokens_neox': 499, 'n_words': 162}