from typing import Any


def _is_magic_coroutine(target: Any) -> bool:
    """
    Check if target is a magic coroutine.

    :param target: An object to check against.
    :return: If the object is a magic coroutine.
    """
    try:
        return bool(
            target and target.__qualname__.endswith("coroutine.<locals>.magic"),
        )
    except Exception:
        return False