code: def _future_set_result_unless_cancelled(future, value):
      if not future.cancelled():
          future.set_result(value)
  
imports: from __future__ import annotations
  import asyncio
  import inspect
  import logging
  import multiprocessing
  import os
  import re
  import threading
  import weakref
  from collections.abc import Callable
  from queue import Queue
  from typing import TYPE_CHECKING
  from tornado.concurrent import Future
  from tornado.ioloop import IOLoop
  import dask
  from distributed.utils import get_mp_context, wait_for
label_desc: Use image node_id 2 for calling a global function with example usage: _future_set_result_unless_cancelled(future, value) without return types