code: 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
docs: Indicates if connection has expired.