<commit_before>from __future__ import (absolute_import, division, print_function,
                        unicode_literals)

import os
import sys
from os.path import join
import subprocess

import conda.config as cc

import conda_build.config
from conda_build.config import (PY3K, build_prefix,
                                _get_python)
from conda_build import source


# Python 2.x backward compatibility
if sys.version_info < (3, 0):
    str = unicode


def get_perl_ver():
    return str(conda_build.config.CONDA_PERL)

def get_py_ver():
    return '.'.join(str(conda_build.config.CONDA_PY))

def get_stdlib_dir():
    return join(build_prefix, 'Lib' if sys.platform == 'win32' else
                                'lib/python%s' % get_py_ver())

def get_sp_dir():
    return join(STDLIB_DIR, 'site-packages')

def get_git_build_info(src_dir):
    d = {'GIT_BUILD': True}
    key_name = lambda a: "GIT_BUILD_{}".format(a)
    keys = [key_name("VERSION"), key_name("NUMBER"), key_name("HASH")]
    process = subprocess.Popen(["git", "describe", "--tags", "HEAD"],
                               stdout=subprocess.PIPE)
    output = process.communicate()[0].strip()
    parts = output.rsplit('-', 2)
    parts_length = len(parts)
    if parts_length is 3:
        d.update(dict(zip(keys, parts)))
    elif parts_length is 1:
        d.update(dict(zip(keys, [parts[0], "0", ""])))

    if key_name('NUMBER') in d and key_name('HASH') in d:
        d[key_name('STR')] = '{}_{}'.format(d[key_name('NUMBER')],
                                            d[key_name('HASH')])
    return d

# The UPPERCASE names are here for backwards compatibility. They will not
# change correctly if conda_build.config.CONDA_PY changes. Use get_py_ver(),<commit_msg>Use a string here to avoid complaints from subprocess<commit_after>from __future__ import (absolute_import, division, print_function,
                        unicode_literals)

import os
import sys
from os.path import join
import subprocess

import conda.config as cc

import conda_build.config
from conda_build.config import (PY3K, build_prefix,
                                _get_python)
from conda_build import source


# Python 2.x backward compatibility
if sys.version_info < (3, 0):
    str = unicode


def get_perl_ver():
    return str(conda_build.config.CONDA_PERL)

def get_py_ver():
    return '.'.join(str(conda_build.config.CONDA_PY))

def get_stdlib_dir():
    return join(build_prefix, 'Lib' if sys.platform == 'win32' else
                                'lib/python%s' % get_py_ver())

def get_sp_dir():
    return join(STDLIB_DIR, 'site-packages')

def get_git_build_info(src_dir):
    d = {'GIT_BUILD': '1'}
    key_name = lambda a: "GIT_BUILD_{}".format(a)
    keys = [key_name("VERSION"), key_name("NUMBER"), key_name("HASH")]
    process = subprocess.Popen(["git", "describe", "--tags", "HEAD"],
                               stdout=subprocess.PIPE)
    output = process.communicate()[0].strip()
    parts = output.rsplit('-', 2)
    parts_length = len(parts)
    if parts_length is 3:
        d.update(dict(zip(keys, parts)))
    elif parts_length is 1:
        d.update(dict(zip(keys, [parts[0], "0", ""])))

    if key_name('NUMBER') in d and key_name('HASH') in d:
        d[key_name('STR')] = '{}_{}'.format(d[key_name('NUMBER')],
                                            d[key_name('HASH')])
    return d

# The UPPERCASE names are here for backwards compatibility. They will not
# change correctly if conda_build.config.CONDA_PY changes. Use get_py_ver(),
{'fraction_non_alphanumeric': 0.12821236938717875, 'fraction_numerical': 0.007060152499293985, 'mean_word_length': 2.9224806201550386, 'pattern_counts': {'":': 0, '<': 5, '<?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': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7020593', 'n_tokens_mistral': 1169, 'n_tokens_neox': 1134, 'n_words': 281}