<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
Action file that holds all the different configuration for a
specific dataset.

Import the specific cleaning and plotting methods that are
in the same folder
"""

import cleaning
import plotting


def main():
    pass


if __name__ == "__main__":
    main()
<commit_msg>Starting to write the action_file<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-

import re
import os
import csv
import json
import glob
import pandas as pd
import numpy as np

from config import CleaningConfig
from cleaning import CleaningData
import generate_notebook
import plotting

"""
Action file that holds all the different configuration for a
specific dataset.

Import the specific cleaning and plotting methods that are
in the same folder
"""



def main():
    import matplotlib
    # from include import plotting
    # When using Ipython within vim
    matplotlib.use('TkAgg')
    import matplotlib.pyplot as plt

    #  When using this script with ipython and vim
    plt.ion()
    plt.show()
    pd.set_option('display.max_rows', 300)

    # Load dataset
    df = pd.read_csv(CleaningConfig.raw_data)
    cleaning_process = CleaningData(df)
    cleaning_process.cleaning()
    cleaning_process.write_df()
    cleaning_process.write_config_file()
    for q in cleaning_process.survey_structure:
        print(cleaning_process.survey_structure[q]['original_question'])
        # print(q['original_question'])



if __name__ == "__main__":
    main()

{'fraction_non_alphanumeric': 0.08344370860927153, 'fraction_numerical': 0.0033112582781456954, 'mean_word_length': 3.7968253968253967, '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': '1205093', 'n_tokens_mistral': 453, 'n_tokens_neox': 437, 'n_words': 152}