def start(cls):
        """Start background thread if not already started"""
        if cls._thread is None:
            cls._thread = threading.Thread(target=cls._run, name="Heartbeat")
            cls._thread.daemon = True
            cls._thread.start()
def start ( cls ) : if cls . _thread is None : cls . _thread = threading . Thread ( target = cls . _run , name = "Heartbeat" ) cls . _thread . daemon = True cls . _thread . start ( )
Start background thread if not already started