<commit_before>def ask_question(q_str, special='None', default=None):
    """
    function that ask the question, and parses the answer to prefered format
    q_str = string containing the question to be asked
    returns string, bool (spec='bool'), int (spec='int') or float (spec='float')
    """

    import sys
    
    while True:
        question = str(input(q_str)) if sys.version_info[0] == 3 else str(raw_input(q_str))
        funcs = {'None': [str, {}], 'bool': [bool, {'y': True, 'yes': True, 'n': False, 'no': False}], 'int': [int, {}], 'float': [float, {}] }
        
        if not question and default:
            question = str(default)
        if question in funcs[special][1]:
            return funcs[special][1][question]
        elif special is not 'bool':
            try:
                return funcs[special][0](question)
            except ValueError:
                pass
        else:
            print("Input not recognised. Please try again.")<commit_msg>minor changes<commit_after>def ask_question(q_str, special='None', default=None):
    """
    function that ask the question, and parses the answer to prefered format
    q_str = string containing the question to be asked
    returns string, bool (spec='bool'), int (spec='int') or float (spec='float')
    """

    import sys
    
    while True:
        question = str(input(q_str)) if sys.version_info[0] == 3 else str(raw_input(q_str))
        funcs = {'None': [str, {}], 'bool': [bool, {'y': True, 'yes': True, 'n': False, 'no': False}], 'int': [int, {}], 'float': [float, {}] }
        
        if not question and default:
            question = str(default)
        if question in funcs[special][1]:
            return funcs[special][1][question]
        elif special is not 'bool':
            try:
                return funcs[special][0](question)
            except ValueError:
                pass
        print("Input not recognised. Please try again.")
{'fraction_non_alphanumeric': 0.1408811475409836, 'fraction_numerical': 0.005122950819672131, 'mean_word_length': 2.456637168141593, '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': '4915589', 'n_tokens_mistral': 563, 'n_tokens_neox': 555, 'n_words': 183}