def unschedule_all(self):
        """Unschedules all watches and detaches all associated event
        handlers."""
        with self._lock:
            self._handlers.clear()
            self._clear_emitters()
            self._watches.clear()
Unschedules all watches and detaches all associated event
        handlers.
src/watchdog/observers/api.py