import _asyncio


def _in_loop(loop):
    """Returns True if loop is the running event loop for the current thread."""
    try:
        return _asyncio.get_running_loop() is loop
    except RuntimeError:
        return False