<commit_before>import sys
from os.path import join
import os
import pandas as pd


def save_binary(data_dir,
                active_days = 'active_days.csv',
                cycles = 'cycles.csv',
                tracking = 'tracking.csv',
                users = 'users.csv'):
    """
    loads the data from the csv files
    then pickles them.
    """

    df_active_days = pd.read_csv(join(data_dir, active_days))
    df_cycles = pd.read_csv(join(data_dir, cycles))
    df_users = pd.read_csv(join(data_dir, users))
    df_tracking = pd.read_csv(join(data_dir, tracking))
    os.makedirs('../binary', exist_ok=True)
    df_active_days.to_pickle('../binary/active_days.pkl')
    df_cycles.to_pickle('../binary/cycles.pkl')
    df_users.to_pickle('../binary/users.pkl')
    df_tracking.to_pickle('../binary/tracking.pkl')


if __name__ == '__main__':
    data_fname = sys.argv[-1]
    save_binary(data_fname)<commit_msg>Update save_binary to newer version<commit_after>import sys
from os.path import join
import os
import pandas as pd


def save_binary(data_dir,
                binary_dir = 'binary',
                active_days = 'active_days.csv',
                cycles = 'cycles.csv',
                tracking = 'tracking.csv',
                users = 'users.csv'):
    """
    loads the data from the csv files
    then pickles them.
    """

    df_active_days = pd.read_csv(join(data_dir, active_days))
    df_cycles = pd.read_csv(join(data_dir, cycles))
    df_users = pd.read_csv(join(data_dir, users))
    df_tracking = pd.read_csv(join(data_dir, tracking))
    os.makedirs(binary_dir, exist_ok=True)
    df_active_days.to_pickle(os.path.join(binary_dir, 'active_days.pkl'))
    df_cycles.to_pickle(os.path.join(binary_dir, 'cycles.pkl'))
    df_users.to_pickle(os.path.join(binary_dir, 'users.pkl'))
    df_tracking.to_pickle(os.path.join(binary_dir, 'tracking.pkl'))


if __name__ == '__main__':
    data_fname = sys.argv[-1]
    save_binary(data_fname)
{'fraction_non_alphanumeric': 0.12754065040650406, 'fraction_numerical': 0.0010162601626016261, 'mean_word_length': 3.0265848670756648, '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': '4779989', 'n_tokens_mistral': 714, 'n_tokens_neox': 679, 'n_words': 121}