<commit_before>"""Configuration."""
# pylint: disable=invalid-name
from __future__ import print_function

import os as _os
import logging as _logging

import multiprocessing as _multiprocessing


_LOGGER = _logging.getLogger(__name__)

def _get_conf_value(suffix):
    """Get configuration value from PYMP/OMP env variables."""
    pymp_name = 'PYMP_' + suffix
    omp_name = 'OMP_' + suffix
    value = None
    for env_name in [pymp_name, omp_name]:
        # pylint: disable=no-member
        if _os.environ.has_key(env_name):
            _LOGGER.debug("Using %s environment variable: %s.",
                          env_name, _os.environ[env_name])
            value = _os.environ[env_name]
            break
    return value

# Initialize configuration.
_nested_env = _get_conf_value('NESTED')
if _nested_env is None:
    nested = False
else:
    assert _nested_env.lower() in ['true', 'false'], (
        'The configuration for PYMP_NESTED/OMP_NESTED must be either '
        'TRUE or FALSE. Is %s.', _nested_env)
    nested = _nested_env.lower() == 'true'

_num_threads_env = _get_conf_value('NUM_THREADS')
if _num_threads_env is None:
    # pylint: disable=no-member
    num_threads = [_multiprocessing.cpu_count()]
else:
    _num_threads_env = [int(_val) for _val in ",".split(_num_threads_env)]
    for _val in _num_threads_env:
        assert _val > 0, (
            'The PYMP_NUM_THREADS/OMP_NUM_THREADS variable must be a comma '
            'separated list of positive integers, specifying the number '
            'of threads to use in each nested level.')
    num_threads = _num_threads_env[:]

_thread_limit_env = _get_conf_value("THREAD_LIMIT")
if _thread_limit_env is None:<commit_msg>Working on travis integration.<commit_after>"""Configuration."""
# pylint: disable=invalid-name
from __future__ import print_function

import os as _os
import logging as _logging

import multiprocessing as _multiprocessing


_LOGGER = _logging.getLogger(__name__)

def _get_conf_value(suffix):
    """Get configuration value from PYMP/OMP env variables."""
    pymp_name = 'PYMP_' + suffix
    omp_name = 'OMP_' + suffix
    value = None
    for env_name in [pymp_name, omp_name]:
        # pylint: disable=no-member
        if _os.environ.has_key(env_name):
            _LOGGER.debug("Using %s environment variable: %s.",
                          env_name, _os.environ[env_name])
            value = _os.environ[env_name]
            break
    return value

# Initialize configuration.
_nested_env = _get_conf_value('NESTED')
if _nested_env is None:
    nested = False
else:
    assert _nested_env.lower() in ['true', 'false'], (
        'The configuration for PYMP_NESTED/OMP_NESTED must be either '
        'TRUE or FALSE. Is %s.', _nested_env)
    nested = _nested_env.lower() == 'true'

_num_threads_env = _get_conf_value('NUM_THREADS')
if _num_threads_env is None:
    # pylint: disable=no-member
    num_threads = [_multiprocessing.cpu_count()]
else:
    _num_threads_env = [int(_val) for _val in _num_threads_env.split(",")]
    for _val in _num_threads_env:
        assert _val > 0, (
            'The PYMP_NUM_THREADS/OMP_NUM_THREADS variable must be a comma '
            'separated list of positive integers, specifying the number '
            'of threads to use in each nested level.')
    num_threads = _num_threads_env[:]

_thread_limit_env = _get_conf_value("THREAD_LIMIT")
if _thread_limit_env is None:
{'fraction_non_alphanumeric': 0.0943065693430657, 'fraction_numerical': 0.0005839416058394161, 'mean_word_length': 3.2986198243412796, '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': '1249702', 'n_tokens_mistral': 1134, 'n_tokens_neox': 1123, 'n_words': 294}