<commit_before>import asyncio

from asyncio import coroutines


def _format_coroutine(coro):
    if asyncio.iscoroutine(coro) and not hasattr(coro, 'cr_code'):
        # Most likely a Cython coroutine
        coro_name = '{}()'.format(coro.__qualname__ or coro.__name__)
        if coro.cr_running:
            return '{} running'.format(coro_name)
        else:
            return coro_name

    return _old_format_coroutine(coro)


_old_format_coroutine = coroutines._format_coroutine
coroutines._format_coroutine = _format_coroutine<commit_msg>Fix patched _format_coroutine to support Cython generators<commit_after>import asyncio

from asyncio import coroutines


def _format_coroutine(coro):
    if asyncio.iscoroutine(coro) \
            and not hasattr(coro, 'cr_code') \
            and not hasattr(coro, 'gi_code'):

        # Most likely a Cython coroutine
        coro_name = '{}()'.format(coro.__qualname__ or coro.__name__)

        running = False
        try:
            running = coro.cr_running
        except AttributeError:
            try:
                running = coro.gi_running
            except AttributeError:
                pass

        if running:
            return '{} running'.format(coro_name)
        else:
            return coro_name

    return _old_format_coroutine(coro)


_old_format_coroutine = coroutines._format_coroutine
coroutines._format_coroutine = _format_coroutine
{'fraction_non_alphanumeric': 0.07274011299435028, 'fraction_numerical': 0.0, 'mean_word_length': 2.661498708010336, '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': '4777097', 'n_tokens_mistral': 437, 'n_tokens_neox': 441, 'n_words': 94}