def is_dist_avail_and_initialized() -> bool:
    """Check if available and successfully initialised."""
    if not dist.is_available():  # type: ignore
        return False
    if not dist.is_initialized():  # type: ignore
        return False
    return True