<commit_before>from affine import Affine
import numpy as np
import pickle
import smtplib

def pickle_file(obj=None, name=None):
    """
    Pass name without .pkl extension
    """
    pkl_file = open(name + ".pkl", "wb")
    pickle.dump(obj, pkl_file)
    pkl_file.close()

def robust(mod_data, mod_yc_data, method=None, lam_0_g=None, lam_1_g=None):
    """
    Function to run model with guesses, also generating 
    method : string
        method to pass to Affine.solve()
    mod_data : pandas DataFrame 
        model data
    mod_yc_data : pandas DataFrame
        model yield curve data
    lam_0_g : array
        Guess for lambda 0
    lam_1_g : array
        Guess for lambda 1
    """
        
    # subset to pre 2005
    mod_data = mod_data[:217]
    mod_yc_data = mod_yc_data[:214]
<commit_msg>Needed dt import for util.py<commit_after>import numpy as np
import pickle
import smtplib
import dt

from affine import Affine

def pickle_file(obj=None, name=None):
    """
    Pass name without .pkl extension
    """
    pkl_file = open(name + ".pkl", "wb")
    pickle.dump(obj, pkl_file)
    pkl_file.close()

def robust(mod_data, mod_yc_data, method=None, lam_0_g=None, lam_1_g=None):
    """
    Function to run model with guesses, also generating 
    method : string
        method to pass to Affine.solve()
    mod_data : pandas DataFrame 
        model data
    mod_yc_data : pandas DataFrame
        model yield curve data
    lam_0_g : array
        Guess for lambda 0
    lam_1_g : array
        Guess for lambda 1
    """
        
    # subset to pre 2005
    mod_data = mod_data[:217]
    mod_yc_data = mod_yc_data[:214]

{'fraction_non_alphanumeric': 0.08211678832116788, 'fraction_numerical': 0.019464720194647202, 'mean_word_length': 2.6636971046770603, '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': '3444496', 'n_tokens_mistral': 588, 'n_tokens_neox': 551, 'n_words': 166}