def is_expired(self):
        """ Indicates if connection has expired. """
        if time.time() - self.last_ping > HB_PING_TIME:
            self.ping()

        return (time.time() - self.last_pong) > HB_PING_TIME + HB_PONG_TIME
def is_expired ( self ) : if time . time ( ) - self . last_ping > HB_PING_TIME : self . ping ( ) return ( time . time ( ) - self . last_pong ) > HB_PING_TIME + HB_PONG_TIME
Indicates if connection has expired.