def beat(self):
        self.pongstream.flush() 
        self.last_ping = self.lifetime
        
        toc = time.time()
        self.lifetime += self.tic-toc
        self.tic = toc
        # self.log.debug("heartbeat::%s"%self.lifetime)
        goodhearts = self.hearts.intersection(self.responses)
        missed_beats = self.hearts.difference(goodhearts)
        heartfailures = self.on_probation.intersection(missed_beats)
        newhearts = self.responses.difference(goodhearts)
        list(map(self.handle_new_heart, newhearts))
        list(map(self.handle_heart_failure, heartfailures))
        self.on_probation = missed_beats.intersection(self.hearts)
        self.responses = set()
        # print self.on_probation, self.hearts
        # self.log.debug("heartbeat::beat %.3f, %i beating hearts"%(self.lifetime, len(self.hearts)))
        self.pingstream.send(asbytes(str(self.lifetime)))
dataset/ETHPy150Open ipython/ipython-py3k/IPython/parallel/controller/heartmonitor.py/HeartMonitor.beat/swapped operands of `-`