<commit_before>from PyQt4 import QtCore, QtGui
import os
import time
import psutil

class JobMonitorThread(QtCore.QThread):
    
    def __init__(self):
        QtCore.QThread.__init__(self)
    
    def setup(self, parent=None, job_monitor_interface=None, refresh_rate_s=2):
        self.parent = parent
        self.job_monitor_interafce = job_monitor_interface
        self.job_monitor_interface = self.parent.job_monitor_interface
        self.refresh_rate_s = refresh_rate_s
        
    def run(self):
        while(True):
            time.sleep(self.refresh_rate_s)
            self._checking_status_of_jobs()
        
    def stop(self):
        self.terminate()

    def _checking_status_of_jobs(self):
        _job_list= self.parent.job_list
        for _row, _job in enumerate(_job_list):
            _pid = _job['pid']
            process = psutil.Process(_pid)
            if process is None:
                self.job_monitor_interafce.ui.tableWidget.removeCellWidget(_row, 2)
                _item = QtGui.QTableWidgetItem("Done!")
                self.job_monitor_interafce.ui.tableWidget.setItem(_row, 2, _item)
            else:
                print("status of job {} : {}".format(_pid, process.status()))
                if not process.is_running() == 0:
                    self.job_monitor_interafce.ui.tableWidget.removeCellWidget(_row, 2)
                    _item = QtGui.QTableWidgetItem("Done!")
                    self.job_monitor_interafce.ui.tableWidget.setItem(_row, 2, _item)
                
            
            
            <commit_msg>Changed the way the pid are checked<commit_after>from PyQt4 import QtCore, QtGui
import os
import time
import psutil

class JobMonitorThread(QtCore.QThread):
    
    def __init__(self):
        QtCore.QThread.__init__(self)
    
    def setup(self, parent=None, job_monitor_interface=None, refresh_rate_s=2):
        self.parent = parent
        self.job_monitor_interafce = job_monitor_interface
        self.job_monitor_interface = self.parent.job_monitor_interface
        self.refresh_rate_s = refresh_rate_s
        
    def run(self):
        while(True):
            time.sleep(self.refresh_rate_s)
            self._checking_status_of_jobs()
        
    def stop(self):
        self.terminate()

    def _checking_status_of_jobs(self):
        _job_list= self.parent.job_list
        for _row, _job in enumerate(_job_list):
            _pid = _job['pid']
            process = psutil.Process(_pid)
            if process is None:
                self.job_monitor_interafce.ui.tableWidget.removeCellWidget(_row, 2)
                _item = QtGui.QTableWidgetItem("Done!")
                self.job_monitor_interafce.ui.tableWidget.setItem(_row, 2, _item)
            else:
                if not process.status() == 'sleeping':
                    self.job_monitor_interafce.ui.tableWidget.removeCellWidget(_row, 2)
                    _item = QtGui.QTableWidgetItem("Done!")
                    self.job_monitor_interafce.ui.tableWidget.setItem(_row, 2, _item)
                
            
            
            
{'fraction_non_alphanumeric': 0.08583414004517587, 'fraction_numerical': 0.004194901581155212, 'mean_word_length': 2.0632411067193677, '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': '7644532', 'n_tokens_mistral': 940, 'n_tokens_neox': 903, 'n_words': 157}