<commit_before># -*- coding: utf-8 -*-
"""
@file
@brief  various basic functions often needed
"""

import sys
import os
import re
import random
from pyquickhelper.loghelper.flog import fLOG, GetSepLine
from pyquickhelper.filehelper.synchelper import explore_folder_iterfile


_keep_var_character = re.compile("[^a-zA-Z0-9_]")


def _clean_name_variable(st):
    """
    Cleans a string.

    @param      st      string to clean
    @return             another string
    """
    res = _keep_var_character.split(st)
    if res is None:
        raise Exception("unable to clean " + st)
    return "_".join(res)


def _get_format_zero_nb_integer(nb):<commit_msg>Update default_functions.py<commit_after># -*- coding: utf-8 -*-
"""
@file
@brief  various basic functions often needed
"""

import os
import re
import random
from pyquickhelper.loghelper.flog import fLOG, GetSepLine
from pyquickhelper.filehelper.synchelper import explore_folder_iterfile


_keep_var_character = re.compile("[^a-zA-Z0-9_]")


def _clean_name_variable(st):
    """
    Cleans a string.

    @param      st      string to clean
    @return             another string
    """
    res = _keep_var_character.split(st)
    if res is None:
        raise Exception("unable to clean " + st)
    return "_".join(res)


def _get_format_zero_nb_integer(nb):
{'fraction_non_alphanumeric': 0.10219530658591976, 'fraction_numerical': 0.004542013626040878, 'mean_word_length': 3.3061889250814334, 'pattern_counts': {'":': 0, '<': 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': '410402', 'n_tokens_mistral': 431, 'n_tokens_neox': 422, 'n_words': 112}