def on_main_thread(): """Checks if we are on the main thread or not.""" return threading.current_thread() is threading.main_thread()