def METHOD_NAME() -> bool:
    """
    General implementation of checking if we are in a proper thread.
    If Qt is available and Application is created then assign :py:func:`in_qt_main_thread` to `in_main_thread`.
    If Qt liba are not available then assign :py:func:`in_main_thread_py` to in_main_thread.
    IF Qt libs are available but there is no Application ti wil emmit warning and return result of in_main_thread_py.
    Returns
    -------
    thread_flag : bool
        True if we are in the main thread, False otherwise.
    """
    global in_main_thread
    try:
        from napari._qt.utils import in_qt_main_thread
        res = in_qt_main_thread()
        in_main_thread = in_qt_main_thread
    except ImportError:
        in_main_thread = in_main_thread_py
        return in_main_thread_py()
    except AttributeError:
        warnings.warn(
            "Qt libs are available but no QtApplication instance is created"
        )
        return in_main_thread_py()
    return res