<commit_before>import json
import mongodb_consistent_backup
import sys

from argparse import Action
from pkgutil import walk_packages
from yconf import BaseConfiguration
from yconf.util import NestedDict


def parse_config_bool(item):
    try:
        if isinstance(item, bool):
            return item
        elif isinstance(item, str):
            if item.rstrip().lower() is "true":
                return True
    except:
        return False
    return False


class PrintVersions(Action):
    def __init__(self, option_strings, dest, nargs=0, **kwargs):
        super(PrintVersions, self).__init__(option_strings=option_strings, dest=dest, nargs=nargs, **kwargs)

    def __call__(self, parser, namespace, values, option_string=None):<commit_msg>Make shared func for parsing config bools #3<commit_after>import json
import mongodb_consistent_backup
import sys

from argparse import Action
from pkgutil import walk_packages
from yconf import BaseConfiguration
from yconf.util import NestedDict


def parse_config_bool(item):
    try:
        if isinstance(item, bool):
            return item
        elif isinstance(item, str):
            if item.rstrip().lower() is "true":
                return True
        return False
    except:
        return False


class PrintVersions(Action):
    def __init__(self, option_strings, dest, nargs=0, **kwargs):
        super(PrintVersions, self).__init__(option_strings=option_strings, dest=dest, nargs=nargs, **kwargs)

    def __call__(self, parser, namespace, values, option_string=None):
{'fraction_non_alphanumeric': 0.07981829980532122, 'fraction_numerical': 0.001946787800129786, 'mean_word_length': 3.5352941176470587, 'pattern_counts': {'":': 2, '<': 3, '<?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': '2355385', 'n_tokens_mistral': 435, 'n_tokens_neox': 419, 'n_words': 132}