<commit_before>import pytest
import requests_mock as rm_module


# RHEL 7 ships pytest 2.7 which doesn't have the 'bool' type to addini. This
# broke pytest for EPEL: https://bugzilla.redhat.com/show_bug.cgi?id=1605138
# If it's older than 2.9 we handle bool conversion ourselves. Remove this when
# we can rely on a newer pytest.
#
# Version 3 is also where the @yield_fixture decorator was deprecated and you
# can now just use @fixture, so we handle both of those cases as well.

try:
    from distutils import version
    _pytest_version = version.StrictVersion(pytest.__version__)
    _pytest29 = _pytest_version >= version.StrictVersion('2.9.0')
    _pytest30 = _pytest_version >= version.StrictVersion('3.0.0')
except Exception:
    _pytest29 = False
    _pytest30 = False


if not _pytest29:
    _case_type = None
    _case_default = 'false'

    # Copied from pytest 2.9.0 where bool was introduced. It's what happens
    # internally if we specify a bool type argument.
    def _strtobool(val):
        """Convert a string representation of truth to true (1) or false (0).

        True values are 'y', 'yes', 't', 'true', 'on', and '1'; false values
        are 'n', 'no', 'f', 'false', 'off', and '0'.  Raises ValueError if
        'val' is anything else.
<commit_msg>Avoid using distutils to check pytest version.<commit_after>import pytest
import requests_mock as rm_module


# RHEL 7 ships pytest 2.7 which doesn't have the 'bool' type to addini. This
# broke pytest for EPEL: https://bugzilla.redhat.com/show_bug.cgi?id=1605138
# If it's older than 2.9 we handle bool conversion ourselves. Remove this when
# we can rely on a newer pytest.
#
# Version 3 is also where the @yield_fixture decorator was deprecated and you
# can now just use @fixture, so we handle both of those cases as well.

try:
    _pytest_version = tuple([
        int(x) for x in pytest.__version__.split('.')[:2]
    ])
    _pytest29 = _pytest_version >= (2, 9)
    _pytest30 = _pytest_version >= (3, 0)
except Exception:
    _pytest29 = False
    _pytest30 = False


if not _pytest29:
    _case_type = None
    _case_default = 'false'

    # Copied from pytest 2.9.0 where bool was introduced. It's what happens
    # internally if we specify a bool type argument.
    def _strtobool(val):
        """Convert a string representation of truth to true (1) or false (0).

        True values are 'y', 'yes', 't', 'true', 'on', and '1'; false values
        are 'n', 'no', 'f', 'false', 'off', and '0'.  Raises ValueError if
        'val' is anything else.

{'fraction_non_alphanumeric': 0.0995279307631786, 'fraction_numerical': 0.02793076317859953, 'mean_word_length': 3.332197614991482, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 2, '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': '5094033', 'n_tokens_mistral': 861, 'n_tokens_neox': 838, 'n_words': 323}