<commit_before>import os
import re
import argparse
#
import tabular_predDB.settings as S
import tabular_predDB.python_utils.file_utils as fu
import tabular_predDB.python_utils.data_utils as du


default_table_data_filename = 'table_data.pkl.gz'
default_table_filename = os.path.join(S.path.web_resources_data_dir,
  'dha.csv')

default_initialize_args_dict = dict(
    command='initialize',
    initialization='from_the_prior',
    )

default_analyze_args_dict = dict(
    command='analyze',
    kernel_list=(),
    n_steps=1,
    c=(),
    r=(),
    )

# read the data, create metadata
def pickle_table_data(in_filename_or_dict, pkl_filename):
    table_data = None
    if isinstance(in_filename_or_dict, str):
        T, M_r, M_c = du.read_model_data_from_csv(in_filename_or_dict, gen_seed=0)
        table_data = dict(T=T, M_r=M_r, M_c=M_c)
    else:
        table_data = in_filename_or_dict
    fu.pickle(table_data, pkl_filename)
    return table_data

# cat the data into the script, as hadoop would
def run_script_local(infile, script_name, outfile):
    cmd_str = 'cat %s | python %s > %s'
    cmd_str %= (infile, script_name, outfile)<commit_msg>add max_time default to default_analyze_args_dict<commit_after>import os
import re
import argparse
#
import tabular_predDB.settings as S
import tabular_predDB.python_utils.file_utils as fu
import tabular_predDB.python_utils.data_utils as du


default_table_data_filename = 'table_data.pkl.gz'
default_table_filename = os.path.join(S.path.web_resources_data_dir,
  'dha.csv')

default_initialize_args_dict = dict(
    command='initialize',
    initialization='from_the_prior',
    )

default_analyze_args_dict = dict(
    command='analyze',
    kernel_list=(),
    n_steps=1,
    c=(),
    r=(),
    max_time=-1,
    )

# read the data, create metadata
def pickle_table_data(in_filename_or_dict, pkl_filename):
    table_data = None
    if isinstance(in_filename_or_dict, str):
        T, M_r, M_c = du.read_model_data_from_csv(in_filename_or_dict, gen_seed=0)
        table_data = dict(T=T, M_r=M_r, M_c=M_c)
    else:
        table_data = in_filename_or_dict
    fu.pickle(table_data, pkl_filename)
    return table_data

# cat the data into the script, as hadoop would
def run_script_local(infile, script_name, outfile):
    cmd_str = 'cat %s | python %s > %s'
    cmd_str %= (infile, script_name, outfile)
{'fraction_non_alphanumeric': 0.09521794329242489, 'fraction_numerical': 0.0021159542953872196, 'mean_word_length': 4.43448275862069, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '3820675', 'n_tokens_mistral': 870, 'n_tokens_neox': 864, 'n_words': 176}