def user_cleanup(self, timeout):
        """
        Checks idle time for all sessions on the node.  If any session is disconnected then the user   
        is logged off.  If the idle time exceeds the timeout parameter, the user is logged off. Timeout
        is in MINUTES.
        """
        log.debug(self.sessions)
        for session in self.sessions:
            log.debug("Reported idletime: "+session["idletime"])
            if(session["state"] == "Disc"):
                self.log_user_off(session["sessionid"])
            elif((session["idletime"] == ".") or (session["idletime"] == "none")):
                continue
            else:
                days = session["idletime"].split("+")
                if(len(days) > 1):
                    idletime = 24*60*int(days[0])
                    for i,digit in enumerate(days[1].split(":")):
                        if(i == 0):
                            idletime += 60*int(digit)
                        else:
                            idletime += int(digit)
                else:
                    idletime = 0
                    hoursandmins = days[0].split(":")
                    if(len(hoursandmins) > 1):
                        idletime += 60*int(hoursandmins[0])
                        idletime += int(hoursandmins[1])
                    else:
                        idletime += int(hoursandmins[0])
                log.debug("Calculated idle time: "+str(idletime))
                if(idletime > timeout):
                    self.log_user_off(session["sessionid"])
dataset/ETHPy150Open bmbouter/Opus/opus/lib/osutils/windows.py/Windows.user_cleanup/original