'''
import sys
sys.path.append('..')
'''
from master_utils import *
import numpy as np
import os
import MySQLdb
from lda import LDA
from sklearn.decomposition import  LatentDirichletAllocation
import datetime
import lda_t1


       
class BugEvent:
    def __init__(self, start, end, topic, id, final):
        self.start_date = start
        self.end_date = end        
        self.bug_id = id
        self.final_fixer = final
        
class TossingItem:      
    def __init__(self, time, user):        
        self.sq_timestamp = time
        self.sq_user = user
        self.time_passed = 0 #in seconds
        
    def ComputeTime(self, prev_tossing):
        time_n = datetime.datetime.fromtimestamp(float(self.sq_timestamp))
        time_p = datetime.datetime.fromtimestamp(float(prev_tossing.sq_timestamp))
        
        length = time_n - time_p
        self.time_passed = length.total_seconds()
        
    def __str__(self):       
        s = self.sq_timestamp + '##' + self.sq_user + '##' + str(self.time_passed) + '#;;#'
        return s
        

        

            
            
    
