<commit_before>try:
    # python3 vs. python2
    import configparser
except:
    import ConfigParser as configparser
import logging
import numpy.distutils.system_info as numpy_sys
import os
import sys

logger = logging.getLogger('pythran')


def init_cfg(sys_file, platform_file, user_file):
    sys_config_dir = os.path.dirname(__file__)
    sys_config_path = os.path.join(sys_config_dir, sys_file)

    platform_config_path = os.path.join(sys_config_dir, platform_file)

    user_config_dir = os.environ.get('XDG_CONFIG_HOME', '~')
    user_config_path = os.path.expanduser(
        os.path.join(user_config_dir, user_file))

    cfgp = configparser.SafeConfigParser()
    for required in (sys_config_path, platform_config_path):
        cfgp.readfp(open(required))
    cfgp.read([user_config_path])

    for key in ('CC', 'CXX'):
        value = cfgp.get('compiler', key)
        if value:
            os.environ[key] = value

    for obsolete_section in ('user', 'sys'):
        if cfgp.has_section(obsolete_section):
            logger.warn("Your pythranrc has an obsolete `%s' section",
                        obsolete_section)

    return cfgp


def make_extension(**extra):
    def parse_define(define):
        index = define.find('=')
        if index < 0:
            return (define, None)
        else:
            return define[:index], define[index + 1:]<commit_msg>Fix for issue #687<commit_after>try:
    # python3 vs. python2
    import configparser
except:
    import ConfigParser as configparser
import logging
import numpy.distutils.system_info as numpy_sys
import os
import sys

logger = logging.getLogger('pythran')


def init_cfg(sys_file, platform_file, user_file):
    sys_config_dir = os.path.dirname(__file__)
    sys_config_path = os.path.join(sys_config_dir, sys_file)

    platform_config_path = os.path.join(sys_config_dir, platform_file)

    user_config_dir = os.environ.get('XDG_CONFIG_HOME', '~')
    user_config_path = os.path.expanduser(
        os.path.join(user_config_dir, user_file))

    cfgp = configparser.SafeConfigParser()
    for required in (sys_config_path, platform_config_path):
        cfgp.readfp(open(required))
    cfgp.read([user_config_path])

    for key in ('CC', 'CXX'):
        value = cfgp.get('compiler', key)
        if value:
            os.environ[key] = str(value)

    for obsolete_section in ('user', 'sys'):
        if cfgp.has_section(obsolete_section):
            logger.warn("Your pythranrc has an obsolete `%s' section",
                        obsolete_section)

    return cfgp


def make_extension(**extra):
    def parse_define(define):
        index = define.find('=')
        if index < 0:
            return (define, None)
        else:
            return define[:index], define[index + 1:]
{'fraction_non_alphanumeric': 0.10634462869502523, 'fraction_numerical': 0.003965392934390771, 'mean_word_length': 3.057017543859649, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1729770', 'n_tokens_mistral': 893, 'n_tokens_neox': 861, 'n_words': 194}