<commit_before>import os

import mock


from celery import states
try:
    from celery.tests.utils import AppCase
except ImportError:
    # AppCase was moved in Celery 3.1
    from celery.tests.case import AppCase
# eager_tasks was removed in celery 3.1
from jobtastic.tests.utils import eager_tasks
from jobtastic import JobtasticTask

USING_CELERY_2_X = False
try:
    from kombu.transport.pyamqp import (
        Channel as AmqpChannel,
    )
    from kombu.exceptions import StdChannelError, StdConnectionError
except ImportError:
    USING_CELERY_2_X = True
    from kombu.transport.amqplib import (
        Channel as AmqpChannel,
    )
    from kombu.exceptions import StdChannelError
    # Kombu 2.1 doesn' thave a StdConnectionError, but the 2.1 amqp Transport
    # uses an IOError, so we'll just test with that
    StdConnectionError = IOError


class ParrotTask(JobtasticTask):
    """<commit_msg>Compatibility with kombu >2.1 for Celery 3.0<commit_after>import os

import mock


from celery import states
try:
    from celery.tests.utils import AppCase
except ImportError:
    # AppCase was moved in Celery 3.1
    from celery.tests.case import AppCase
# eager_tasks was removed in celery 3.1
from jobtastic.tests.utils import eager_tasks
from jobtastic import JobtasticTask

try:
    from kombu.transport.pyamqp import (
        Channel as AmqpChannel,
    )
except ImportError:
    from kombu.transport.amqplib import (
        Channel as AmqpChannel,
    )
# Kombu>=2.1 doesn't have StdConnectionError or StdChannelError, but the 2.1
# amqp Transport uses an IOError, so we'll just test with that.
try:
    from kombu.exceptions import StdChannelError
except ImportError:
    StdChannelError = IOError
try:
    from kombu.exceptions import StdChannelError
except ImportError:
    StdConnectionError = IOError


class ParrotTask(JobtasticTask):
    """
{'fraction_non_alphanumeric': 0.05463310123192287, 'fraction_numerical': 0.011783610069630423, 'mean_word_length': 3.717171717171717, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '238055', 'n_tokens_mistral': 603, 'n_tokens_neox': 576, 'n_words': 191}