<commit_before>from pyee._base import BaseEventEmitter
from warnings import warn

try:
    from asyncio import iscoroutine, ensure_future
except ImportError:
    iscoroutine = None
    ensure_future = None


class CompatEventEmitter(BaseEventEmitter):
    """An EventEmitter exposed for compatibility with prior versions of
    pyee. This functionality is deprecated; you should instead use either
    ``AsyncIOEventEmitter``, ``TwistedEventEmitter``, ``ExecutorEventEmitter``,
    or ``BaseEventEmitter``.

    This class is similar to the ``AsyncIOEventEmitter`` class, but also allows
    for overriding the scheduler function (``ensure_future`` by default as in
    ``ASyncIOEventEmitter``) and does duck typing checks to handle Deferreds.
    In other words, by setting ``scheduler`` to
    ``twisted.internet.defer.ensureDeferred`` this will support twisted use
    cases for coroutines.

    When calling synchronous handlers, raised exceptions are ignored - as with<commit_msg>Minor update to compat EE docs<commit_after>from pyee._base import BaseEventEmitter
from warnings import warn

try:
    from asyncio import iscoroutine, ensure_future
except ImportError:
    iscoroutine = None
    ensure_future = None


class CompatEventEmitter(BaseEventEmitter):
    """An EventEmitter exposed for compatibility with prior versions of
    pyee. This functionality is deprecated; you should instead use either
    ``AsyncIOEventEmitter``, ``TwistedEventEmitter``, ``ExecutorEventEmitter``,
    ``TrioEventEmitter`` or ``BaseEventEmitter``.

    This class is similar to the ``AsyncIOEventEmitter`` class, but also allows
    for overriding the scheduler function (``ensure_future`` by default as in
    ``ASyncIOEventEmitter``) and does duck typing checks to handle Deferreds.
    In other words, by setting ``scheduler`` to
    ``twisted.internet.defer.ensureDeferred`` this will support twisted use
    cases for coroutines.

    When calling synchronous handlers, raised exceptions are ignored - as with
{'fraction_non_alphanumeric': 0.0697211155378486, 'fraction_numerical': 0.0, 'mean_word_length': 4.659154929577465, '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': '714380', 'n_tokens_mistral': 515, 'n_tokens_neox': 521, 'n_words': 209}