<commit_before>import string
import keyword
import os

from collections import OrderedDict
from enum import Enum
from typing import (
    Any,
    Dict,
    List,
    Mapping,
    MutableMapping,
    MutableSequence,
    MutableSet,
    Sequence,
    Set,
    Tuple,
)
from cattr._compat import is_py2, bytes, unicode

import attr

from attr import make_class, NOTHING
from hypothesis import strategies as st, settings, HealthCheck

settings.register_profile(
    "CI", settings(suppress_health_check=[HealthCheck.too_slow])
)

if "CI" in os.environ:
    settings.load_profile("CI")


if is_py2:
    # we exclude float checks from py2, because their stringification is not
    # consistent
    primitive_strategies = st.sampled_from(
        [(st.integers(), int), (st.text(), unicode), (st.binary(), bytes)]
    )
else:
    primitive_strategies = st.sampled_from(
        [
            (st.integers(), int),
            (st.floats(allow_nan=False), float),
            (st.text(), unicode),
            (st.binary(), bytes),
        ]
    )


@st.composite
def enums_of_primitives(draw):
    """Generate enum classes with primitive values."""
    if is_py2:
        names = draw(
            st.sets(
                st.text(alphabet=string.ascii_letters, min_size=1), min_size=1
            )
        )
    else:<commit_msg>Skip testing integers on Py2.<commit_after>import string
import keyword
import os

from collections import OrderedDict
from enum import Enum
from typing import (
    Any,
    Dict,
    List,
    Mapping,
    MutableMapping,
    MutableSequence,
    MutableSet,
    Sequence,
    Set,
    Tuple,
)
from cattr._compat import is_py2, bytes, unicode

import attr

from attr import make_class, NOTHING
from hypothesis import strategies as st, settings, HealthCheck

settings.register_profile(
    "CI", settings(suppress_health_check=[HealthCheck.too_slow])
)

if "CI" in os.environ:
    settings.load_profile("CI")


if is_py2:
    # we exclude float checks from py2, because their stringification is not
    # consistent
    primitive_strategies = st.sampled_from(
        [(st.text(), unicode), (st.binary(), bytes)]
    )
else:
    primitive_strategies = st.sampled_from(
        [
            (st.integers(), int),
            (st.floats(allow_nan=False), float),
            (st.text(), unicode),
            (st.binary(), bytes),
        ]
    )


@st.composite
def enums_of_primitives(draw):
    """Generate enum classes with primitive values."""
    if is_py2:
        names = draw(
            st.sets(
                st.text(alphabet=string.ascii_letters, min_size=1), min_size=1
            )
        )
    else:
{'fraction_non_alphanumeric': 0.10128495842781557, 'fraction_numerical': 0.0049130763416477706, 'mean_word_length': 2.661134163208852, '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': '4073621', 'n_tokens_mistral': 839, 'n_tokens_neox': 805, 'n_words': 215}