<commit_before>import collections
import copy

import six

from .configparser_imports import ConfigParser


class _NotSet(object):
    def __nonzero__(self):
        return False

    def __bool__(self):
        return False

    def __str__(self):
        return ''

    def __repr__(self):
        return '<NotSet>'

    def __deepcopy__(self, memodict):
        return self

    def __copy__(self):
        return self


not_set = _NotSet()


def resolve_config_path(*path):
    for p in path:
        if not isinstance(p, six.string_types):
            raise TypeError('Config path segments should be strings, got a {}: {}'.format(type(p), p))
        if not p:
            raise ValueError('Config path segments should be non-empty strings, got an empty one')

    if len(path) == 0:
        raise ValueError('Config empty must not be empty')

    return tuple(path)


def old_resolve_config_path(*path):
    if len(path) == 0:
        raise ValueError('Expected at least 1 config path segment, got none')

    resolution = []
    for arg in path:
        if isinstance(arg, (list, tuple)):
            resolution.extend(resolve_config_path(*arg))
            continue
        if not isinstance(arg, six.string_types):
            raise TypeError('ConfigItem path segments should be strings, got a {}'.format(type(arg)))
        resolution.extend(arg.split('.'))

    if len(resolution) == 1:
        resolution = [ConfigItem.DEFAULT_SECTION, resolution[0]]

    return tuple(resolution)


def resolve_config_prefix(*prefix):
    if len(prefix) == 0:
        return tuple()

    if len(prefix) == 1 and '.' not in prefix[0]:
        return tuple(prefix)

    return resolve_config_path(*prefix)


def parse_bool_str(bool_str):
    return str(bool_str).lower().strip() in ('yes', 'y', 'yeah', 't', 'true', '1', 'yup')<commit_msg>Dead code<commit_after>import collections
import copy

import six

from .configparser_imports import ConfigParser


class _NotSet(object):
    def __nonzero__(self):
        return False

    def __bool__(self):
        return False

    def __str__(self):
        return ''

    def __repr__(self):
        return '<NotSet>'

    def __deepcopy__(self, memodict):
        return self

    def __copy__(self):
        return self


not_set = _NotSet()


def resolve_config_path(*path):
    for p in path:
        if not isinstance(p, six.string_types):
            raise TypeError('Config path segments should be strings, got a {}: {}'.format(type(p), p))
        if not p:
            raise ValueError('Config path segments should be non-empty strings, got an empty one')

    if len(path) == 0:
        raise ValueError('Config empty must not be empty')

    return tuple(path)


def resolve_config_prefix(*prefix):
    if len(prefix) == 0:
        return tuple()

    if len(prefix) == 1 and '.' not in prefix[0]:
        return tuple(prefix)

    return resolve_config_path(*prefix)


def parse_bool_str(bool_str):
    return str(bool_str).lower().strip() in ('yes', 'y', 'yeah', 't', 'true', '1', 'yup')
{'fraction_non_alphanumeric': 0.11410720157842814, 'fraction_numerical': 0.0046037487668530086, 'mean_word_length': 2.840909090909091, 'pattern_counts': {'":': 0, '<': 5, '<?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': '3354474', 'n_tokens_mistral': 921, 'n_tokens_neox': 882, 'n_words': 281}