code: def _set_future(
      future: asyncio.Future, result: _pulsar.Result, value: Any
  ):
      def complete():
          if result == _pulsar.Result.Ok:
              future.set_result(value)
          else:
              future.set_exception(PulsarException(result))
  
      future.get_loop().call_soon_threadsafe(complete)
  
file_path: pulsar-client-python/pulsar/asyncio.py
imports: import asyncio
  import functools
  from typing import Any
  import _pulsar
  import pulsar
label_desc: Use image node_id 1 for calling a global function with example usage: _set_future(future, result, value) without return types