@classmethod
def stop_daemon(cls, wait=False):
    """ Stop the watchdog observer thread.

        Args:
            wait (`bool`): whether to wait for the thread to have joined before returning
        """
    cls.observer.unschedule_all()
    if cls.observer.is_alive():
        cls.observer.stop()
    while wait and cls.observer.is_alive():
        cls.observer.join()
    cls.observer = None
    cls.monitor = None
