<commit_before>"""Compatibility code for using Cheroot with various versions of Python."""

from __future__ import absolute_import, division, print_function
__metaclass__ = type

import platform
import re

import six

# Not used in this file, imported elsewhere as 'from ._compat import selectors'
try:
    import selectors
except ImportError:
    import selectors2 as selectors  # noqa: F401

try:
    import ssl
    IS_ABOVE_OPENSSL10 = ssl.OPENSSL_VERSION_INFO >= (1, 1)
    del ssl
except ImportError:
    IS_ABOVE_OPENSSL10 = None

# contextlib.suppress was added in Python 3.4
try:
    from contextlib import suppress
except ImportError:
    from contextlib import contextmanager

    @contextmanager
    def suppress(*exceptions):
        """Return a context manager that suppresses the `exceptions`."""
        try:
            yield
        except exceptions:
            pass

<commit_msg>Add LGTM ignore comments to `_compat`<commit_after>"""Compatibility code for using Cheroot with various versions of Python."""

from __future__ import absolute_import, division, print_function
__metaclass__ = type

import platform
import re

import six

try:
    import selectors  # lgtm [py/unused-import]
except ImportError:
    import selectors2 as selectors  # noqa: F401  # lgtm [py/unused-import]

try:
    import ssl
    IS_ABOVE_OPENSSL10 = ssl.OPENSSL_VERSION_INFO >= (1, 1)
    del ssl
except ImportError:
    IS_ABOVE_OPENSSL10 = None

# contextlib.suppress was added in Python 3.4
try:
    from contextlib import suppress
except ImportError:
    from contextlib import contextmanager

    @contextmanager
    def suppress(*exceptions):
        """Return a context manager that suppresses the `exceptions`."""
        try:
            yield
        except exceptions:
            pass


{'fraction_non_alphanumeric': 0.06291759465478843, 'fraction_numerical': 0.013363028953229399, 'mean_word_length': 3.3829268292682926, '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': '187026', 'n_tokens_mistral': 529, 'n_tokens_neox': 509, 'n_words': 183}