<commit_before>''' Takes path to text file structured like so:
        example:8
        anotherexample:āçj
    And returns a dictionary with the first item of each line as the key and
    the second as the value.
'''
def parseDic(filename):
    d = {}
    with open(filename, mode="r") as f:
        for line in f:
            l = line.strip()
            if l is not None:
                lsplit = l.split(":")
                d[lsplit[0]] = lsplit[1]
    return d

''' Takes path the text file structured like so:
        a
        b
        another value
    And returns a dictionary including each item.
'''
def parseList(filename):
    l = []
    with open(filename, mode="r") as f:
        for line in f:
            l.append(line.strip())
    return l

''' Takes a list of options and creates an input menu. Returns
    the item selected by the user '''

def createMenu(options):
    for index, item in enumerate(options):
        bullet = "(" + str(index + 1) + ") "
        print(bullet + item)

    response = int(input("Enter selection: "))
    while response not in range(1, len(options) + 1):
        print("Selection not in range")
        response = int(input("Enter selection: "))

    return options[response - 1]<commit_msg>New selection function in IOHelper<commit_after>''' Takes path to text file structured like so:
        example:8
        anotherexample:āçj
    And returns a dictionary with the first item of each line as the key and
    the second as the value.
'''
def parseDic(filename):
    d = {}
    with open(filename, mode="r") as f:
        for line in f:
            l = line.strip()
            if l is not None:
                lsplit = l.split(":")
                d[lsplit[0]] = lsplit[1]
    return d

''' Takes path the text file structured like so:
        a
        b
        another value
    And returns a dictionary including each item.
'''
def parseList(filename):
    l = []
    with open(filename, mode="r") as f:
        for line in f:
            l.append(line.strip())
    return l

''' Takes a list of options and creates an input menu. Returns
    the item selected by the user '''

def createMenu(options):
    for index, item in enumerate(options):
        bullet = "(" + str(index + 1) + ") "
        print(bullet + item)

    response = int(input("Enter selection: "))
    while response not in range(1, len(options) + 1):
        print("Selection not in range")
        response = int(input("Enter selection: "))

    return options[response - 1]

def chooseOption(prompt, options):
    olist = " ("
    for o in options[:-1]:
        olist = olist + o + "/"
    olist = olist + options[-1] + "): "

    response = input(prompt + olist)

    while response not in options:
        print("Response not in options")
        response = input(prompt + olist)

    return response
{'fraction_non_alphanumeric': 0.10860366713681241, 'fraction_numerical': 0.005641748942172073, 'mean_word_length': 2.2056497175141243, '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': '165836', 'n_tokens_mistral': 831, 'n_tokens_neox': 810, 'n_words': 312}