<commit_before>import datetime
from userInfo import PAYMENT_CSV_FILE_NAME 
from userInfo import MONTHLY_PAYMENT_AMOUNT 

def calculateNextPayment():
    #get the date of our last payment
    fh = open(PAYMENT_CSV_FILE_NAME, 'rb')
    first = fh.readline()
    fh.seek(-2, 2)
    while fh.read(1) != "\n":
        fh.seek(-2, 1)
    last = fh.readline()
    lastDate = datetime.datetime.strptime(last.split(',')[0], "%Y/%m/%d %H:%M:%S")
    currentDate = datetime.datetime.now()
    delta = currentDate - lastDate
    return round((MONTHLY_PAYMENT_AMOUNT * 12.0 / 365.0) * delta.days, 2)
    
    
   <commit_msg>added default payment in case we have to payment history<commit_after>import os.path

import datetime
from userInfo import PAYMENT_CSV_FILE_NAME 
from userInfo import MONTHLY_PAYMENT_AMOUNT 

def calculateNextPayment():
    #get the date of our last payment
    num_days = 1
    if os.path.isfile(CSV_FILE_NAME):
        fh = open(PAYMENT_CSV_FILE_NAME, 'rb')
        first = fh.readline()
        fh.seek(-2, 2)
        while fh.read(1) != "\n":
            fh.seek(-2, 1)
        last = fh.readline()
        lastDate = datetime.datetime.strptime(last.split(',')[0], "%Y/%m/%d %H:%M:%S")
        currentDate = datetime.datetime.now()
        delta = currentDate - lastDate
        num_days = delta.days
        
    return round((MONTHLY_PAYMENT_AMOUNT * 12.0 / 365.0) * num_days, 2)
    
    
   
{'fraction_non_alphanumeric': 0.12473423104181432, 'fraction_numerical': 0.020552799433026223, 'mean_word_length': 2.8059299191374665, 'pattern_counts': {'":': 2, '<': 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': '5500592', 'n_tokens_mistral': 528, 'n_tokens_neox': 498, 'n_words': 113}