<commit_before># Kaggel Auxillary Functions
# AGC 2013

def progress(i, num_tasks):
    '''
    A simple textual progress bar
    
    Ins
    --
    i = should be an iterable value to measure the progress of your taks
    num_tasks = total number of tasks

    outs 
    --
    A progress bar like [#########  ]
    '''
    import sys
    progress = "\r["
    for _ in range (0,i):
        progress += "#"
    for _ in range (i, num_tasks):
        progress += " "
    progress += "]"
    sys.stdout.write(progress)
    sys.stdout.flush()
    

def regress_pred_output(test_data,z,y=""):
    """ 
    Returns a dataframe of independ var predictions of a test file based on your regression of a train file.
    
    Parameters
    --
    Test_data: must be the test data sheet opened through pandas: ie. in a dataframe 
    z: should be results object from training regeresion from the SciPy statsmodels resuts object
    y: should be the dependent var in a string from your traing data, if left blank; the function will try to parse it for you.(will only work w/o spaces in the variable name) 
    --
   
    Returns
    --
    Returns a merged dataframe
    AGC 2013<commit_msg>Updated formating to PEP-8 Standards<commit_after># Kaggel Auxillary Functions
# AGC 2013

def progress(i, num_tasks):
    '''
    A simple textual progress bar
    
    Ins
    --
    i = should be an iterable value to measure the progress of your taks
    num_tasks = total number of tasks

    outs 
    --
    A progress bar like [#########  ]
    '''
    import sys

    progress = "\r["
    
    for _ in range (0,i):
        progress += "#"
    
    for _ in range (i, num_tasks):
        progress += " "
    
    progress += "]"
    
    sys.stdout.write(progress)
    sys.stdout.flush()
    

def regress_pred_output(test_data,z,y=""):
    """ 
    Returns a dataframe of independ var predictions of a test file based on your regression of a train file.
    
    Parameters
    --
    Test_data: must be the test data sheet opened through pandas: ie. in a dataframe 
    z: should be results object from training regeresion from the SciPy statsmodels resuts object
    y: should be the dependent var in a string from your traing data, if left blank; the function will try to parse it for you.(will only work w/o spaces in the variable name) 
    --
   
    Returns
    --
    Returns a merged dataframe
    AGC 2013
{'fraction_non_alphanumeric': 0.0802828618968386, 'fraction_numerical': 0.007903494176372712, 'mean_word_length': 2.344923504867872, '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': '1397734', 'n_tokens_mistral': 727, 'n_tokens_neox': 688, 'n_words': 295}