<commit_before>import sys
import re


if sys.version_info[0] == 2:  # pragma: nocover
    string_type = basestring
else:  # pragma: nocover
    string_type = str


def strip_color(s):
    if isinstance(s, string_type):
        return re.compile(r"""
            \x1b            # escape character
            \[              # the CSI code for color
            (               # start of color definition
            [0-9]{1,3}      # the ANSI color code
            (;[0-9]{1,3})*  # optional ANSI color properties (mainly xterm)
            )?              # end of color definition
            m               # the CSI SGR (Select Graphic Rendition) command
        """, re.VERBOSE).sub('', s)
    else:
        return s<commit_msg>Excluded a line from Flake8 checks in strip color as the line is Python 2.x specific<commit_after>import sys
import re


if sys.version_info[0] == 2:  # pragma: nocover
    string_type = basestring  # noqa
else:  # pragma: nocover
    string_type = str


def strip_color(s):
    if isinstance(s, string_type):
        return re.compile(r"""
            \x1b            # escape character
            \[              # the CSI code for color
            (               # start of color definition
            [0-9]{1,3}      # the ANSI color code
            (;[0-9]{1,3})*  # optional ANSI color properties (mainly xterm)
            )?              # end of color definition
            m               # the CSI SGR (Select Graphic Rendition) command
        """, re.VERBOSE).sub('', s)
    else:
        return s
{'fraction_non_alphanumeric': 0.09658725048293625, 'fraction_numerical': 0.015453960077269801, 'mean_word_length': 1.6073825503355705, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4295827', 'n_tokens_mistral': 468, 'n_tokens_neox': 452, 'n_words': 143}