<commit_before>import sys
def calc_growth(tbl, tbl_prev, years_ago=1):
        
    tbl = tbl.sortlevel()
    tbl_prev = tbl_prev.sortlevel()
    
    '''Growth value'''
    col_name = "wage_growth_val"
    if years_ago > 1:
        col_name = "{0}_{1}".format(col_name, years_ago)
    tbl[col_name] = tbl["wage"] - tbl_prev["wage"]
    
    col_name = "num_emp_val"
    if years_ago > 1:
        col_name = "{0}_{1}".format(col_name, years_ago)
    tbl[col_name] = tbl["num_emp"] - tbl_prev["num_emp"]
    
    # print tbl_prev.index.is_unique
    # print tbl.index.is_unique

    '''Growth rate'''
    col_name = "wage_growth_rate"
    if years_ago > 1:
        col_name = "{0}_{1}".format(col_name, years_ago)
    tbl[col_name] = (tbl["wage"] / tbl_prev["wage"]) ** (1.0/years_ago) - 1
    
    col_name = "num_emp_rate"
    if years_ago > 1:
        col_name = "{0}_{1}".format(col_name, years_ago)
    tbl[col_name] = (tbl["num_emp"] / tbl_prev["num_emp"]) ** (1.0/years_ago) - 1
    
    return tbl<commit_msg>renaming cols<commit_after>import sys
def calc_growth(tbl, tbl_prev, years_ago=1):
        
    tbl = tbl.sortlevel()
    tbl_prev = tbl_prev.sortlevel()
    
    '''Growth value'''
    col_name = "wage_growth_val"
    if years_ago > 1:
        col_name = "{0}_{1}".format(col_name, years_ago)
    tbl[col_name] = tbl["wage"] - tbl_prev["wage"]
    
    col_name = "num_emp_growth_val"
    if years_ago > 1:
        col_name = "{0}_{1}".format(col_name, years_ago)
    tbl[col_name] = tbl["num_emp"] - tbl_prev["num_emp"]
    
    # print tbl_prev.index.is_unique
    # print tbl.index.is_unique

    '''Growth rate'''
    col_name = "wage_growth_pct"
    if years_ago > 1:
        col_name = "{0}_{1}".format(col_name, years_ago)
    tbl[col_name] = (tbl["wage"] / tbl_prev["wage"]) ** (1.0/years_ago) - 1
    
    col_name = "num_emp_growth_pct"
    if years_ago > 1:
        col_name = "{0}_{1}".format(col_name, years_ago)
    tbl[col_name] = (tbl["num_emp"] / tbl_prev["num_emp"]) ** (1.0/years_ago) - 1
    
    return tbl
{'fraction_non_alphanumeric': 0.16144814090019569, 'fraction_numerical': 0.018590998043052837, 'mean_word_length': 2.947876447876448, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '896084', 'n_tokens_mistral': 876, 'n_tokens_neox': 809, 'n_words': 136}