<commit_before># This file is part of LiSE, a framework for life simulation games.
# Copyright (c) <NAME>,  <EMAIL>
"""Exception classes for use in LiSE."""
try:
    from sqlalchemy.exc import OperationalError as alchemyOpError
    from sqlite3 import OperationalError as liteOpError
    OperationalError = (alchemyOpError, liteOpError)
except ImportError:
    from sqlite3 import OperationalError


try:
    from sqlalchemy.exc import IntegrityError as alchemyIntegError
    from sqlite3 import IntegrityError as liteIntegError
    IntegrityError = (alchemyIntegError, liteIntegError)
except ImportError:
    from sqlite3 import IntegrityError


class NonUniqueError(Exception):
    """For when you tried to look up the only one of something but there wasn't just one"""


class AmbiguousAvatarError(NonUniqueError, KeyError):
    """An AvatarMapping can't decide what you want."""


class AmbiguousUserError(NonUniqueError, AttributeError):
    """A user descriptor can't decide what you want."""


class RuleError(ValueError):
    pass


class RedundantRuleError(RuleError):<commit_msg>In LiSE.exc, use IntegrityError from allegedb.query<commit_after># This file is part of LiSE, a framework for life simulation games.
# Copyright (c) <NAME>,  <EMAIL>
"""Exception classes for use in LiSE."""
from allegedb.query import IntegrityError, TimeError

try:
    from sqlalchemy.exc import OperationalError as alchemyOpError
    from sqlite3 import OperationalError as liteOpError
    OperationalError = (alchemyOpError, liteOpError)
except ImportError:
    from sqlite3 import OperationalError


class NonUniqueError(Exception):
    """For when you tried to look up the only one of something but there wasn't just one"""


class AmbiguousAvatarError(NonUniqueError, KeyError):
    """An AvatarMapping can't decide what you want."""


class AmbiguousUserError(NonUniqueError, AttributeError):
    """A user descriptor can't decide what you want."""


class RuleError(ValueError):
    pass


class RedundantRuleError(RuleError):
{'fraction_non_alphanumeric': 0.0731586752347998, 'fraction_numerical': 0.002965892239248641, 'mean_word_length': 5.04179104477612, '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': '3550055', 'n_tokens_mistral': 591, 'n_tokens_neox': 554, 'n_words': 211}