<commit_before>import sys
import os

try:
    from subprocess import check_call
except ImportError:
    # BBB for python <2.5
    def check_call(*popenargs, **kwargs):
        from subprocess import call
        from subprocess import CalledProcessError
        retcode = call(*popenargs, **kwargs)
        cmd = kwargs.get("args")
        if cmd is None:
            cmd = popenargs[0]
        if retcode:
            raise CalledProcessError(retcode, cmd)
        return retcode


try:
    from subprocess import check_output
except ImportError:
    # BBB for python <2.7
    def check_output(*popenargs, **kwargs):
        from subprocess import CalledProcessError
        from subprocess import PIPE
        from subprocess import Popen
        if 'stdout' in kwargs:
            raise ValueError(
                    'stdout argument not allowed, it will be overridden.')
        process = Popen(stdout=PIPE, *popenargs, **kwargs)
        output, unused_err = process.communicate()
        retcode = process.poll()
        if retcode:
            cmd = kwargs.get("args")
            if cmd is None:
                cmd = popenargs[0]
            raise CalledProcessError(retcode, cmd)
        return output


# Python 3 compatibility imports
if sys.version_info >= (3,):
    from urllib.parse import quote as url_quote
else:
    from urllib import quote as url_quote


# Fake byte literals for Python <= 2.5
def b(s, encoding='utf-8'):
    if sys.version_info >= (3,):
        return s.encode(encoding)
    return s


# Encode path to fs encoding under Python 3
def fsencode(path, encoding=None):
    if sys.version_info >= (3,):
        if isinstance(path, str):
            if encoding is None:
                encoding = sys.getfilesystemencoding()
            return path.encode(encoding, 'surrogateescape')
    return path


# Decode path from fs encoding under Python 3
def fsdecode(path, encoding=None):
    if sys.version_info >= (3,):
        if not isinstance(path, str):
            if encoding is None:
                encoding = sys.getfilesystemencoding()
            return path.decode(encoding, 'surrogateescape')
    return path


# Convert path to POSIX path on Windows
def posix(path):
    if sys.platform == 'win32':
        # mysys-git reinterprets filenames as UTF-8
        if sys.version_info >= (3,):
            path = path.encode('utf-8').decode('cp1252')
        else:
            path = path.decode('cp1252').encode('utf-8')
        return path.replace(os.sep, '/')
    return path


__all__ = ['check_call', 'check_output', 'url_quote', 'b', 'fsencode', 'fsdecode', 'posix']
<commit_msg>Undo bad idea.<commit_after>import sys
import os

try:
    from subprocess import check_call
except ImportError:
    # BBB for python <2.5
    def check_call(*popenargs, **kwargs):
        from subprocess import call
        from subprocess import CalledProcessError
        retcode = call(*popenargs, **kwargs)
        cmd = kwargs.get("args")
        if cmd is None:
            cmd = popenargs[0]
        if retcode:
            raise CalledProcessError(retcode, cmd)
        return retcode


try:
    from subprocess import check_output
except ImportError:
    # BBB for python <2.7
    def check_output(*popenargs, **kwargs):
        from subprocess import CalledProcessError
        from subprocess import PIPE
        from subprocess import Popen
        if 'stdout' in kwargs:
            raise ValueError(
                    'stdout argument not allowed, it will be overridden.')
        process = Popen(stdout=PIPE, *popenargs, **kwargs)
        output, unused_err = process.communicate()
        retcode = process.poll()
        if retcode:
            cmd = kwargs.get("args")
            if cmd is None:
                cmd = popenargs[0]
            raise CalledProcessError(retcode, cmd)
        return output


# Python 3 compatibility imports
if sys.version_info >= (3,):
    from urllib.parse import quote as url_quote
else:
    from urllib import quote as url_quote


# Fake byte literals for Python <= 2.5
def b(s, encoding='utf-8'):
    if sys.version_info >= (3,):
        return s.encode(encoding)
    return s


# Encode path to fs encoding under Python 3
def fsencode(path):
    if sys.version_info >= (3,):
        if isinstance(path, str):
            return path.encode(sys.getfilesystemencoding(), 'surrogateescape')
    return path


# Decode path from fs encoding under Python 3
def fsdecode(path):
    if sys.version_info >= (3,):
        if not isinstance(path, str):
            return path.decode(sys.getfilesystemencoding(), 'surrogateescape')
    return path


# Convert path to POSIX path on Windows
def posix(path):
    if sys.platform == 'win32':
        # mysys-git reinterprets filenames as UTF-8
        if sys.version_info >= (3,):
            path = path.encode('utf-8').decode('cp1252')
        else:
            path = path.decode('cp1252').encode('utf-8')
        return path.replace(os.sep, '/')
    return path


__all__ = ['check_call', 'check_output', 'url_quote', 'b', 'fsencode', 'fsdecode', 'posix']

{'fraction_non_alphanumeric': 0.09824768655247096, 'fraction_numerical': 0.011813349084465446, 'mean_word_length': 2.4324324324324325, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 13, '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': '205770', 'n_tokens_mistral': 1508, 'n_tokens_neox': 1455, 'n_words': 464}