def METHOD_NAME(fut):
    with suppress(CancelledError):
        handle = fut.result()
    if not fut.cancelled() \
            and not result_future.done() \
            and handle == download.handle \
            and handle.is_valid() \
            and not isinstance(download.tdef, torrentdef.TorrentDefNoMetainfo):
        result_future.set_result(func(*args, **kwargs))