def call_soon(self, func: Callable, *args: Any) -> asyncio.Handle:
        """A wrapper for the event loop's call_soon which also flushes the core's
        event queue after func is called."""

        def f() -> None:
            func(*args)
            self.core.flush()

        return self._eventloop.call_soon(f)
A wrapper for the event loop's call_soon which also flushes the core's
        event queue after func is called.
libqtile/core/manager.py