<commit_before>from settings.SharedVariables import SharedVariables


def execute_query(query, args, commit=False):
    db_wrapper = SharedVariables.database
    c = db_wrapper.get_cursor()
    if commit:
        c.execute(query, args)
        db_wrapper.get_db().commit()
        return True
    else:
        return c.execute(query, args)<commit_msg>Added commiting and executemany queries<commit_after>from settings.SharedVariables import SharedVariables


def execute_query(query, args, commit=False, execute_many=False):
    db_wrapper = SharedVariables.database
    c = db_wrapper.get_cursor()
    if execute_many:
        c.executemany(query, args)
    else:
        data = c.execute(query, args)

    if commit:
        db_wrapper.get_db().commit()
        return True
    return data
{'fraction_non_alphanumeric': 0.08585858585858586, 'fraction_numerical': 0.0, 'mean_word_length': 3.357142857142857, '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': '4536853', 'n_tokens_mistral': 233, 'n_tokens_neox': 225, 'n_words': 54}