code: def test_mpfuture_result():
      future = hivemind.MPFuture()
  
      def _proc(future):
          with pytest.raises(RuntimeError):
              future.result()  # only creator process can await result
  
          future.set_result(321)
  
      p = mp.Process(target=_proc, args=(future,))
      p.start()
      p.join()
  
      assert future.result() == 321
      assert future.exception() is None
      assert future.cancel() is False
      assert (
          future.done()
          and not future.running()
          and not future.cancelled()
      )
  
      future = hivemind.MPFuture()
      with pytest.raises(concurrent.futures.TimeoutError):
          future.result(timeout=1e-3)
  
      future.set_result(["abacaba", 123])
      assert future.result() == ["abacaba", 123]
  
imports: import asyncio
  import concurrent.futures
  import multiprocessing
  import random
  import time
  from concurrent.futures import ThreadPoolExecutor
  import numpy
  import pytest
  import torch
  import hivemind
  from hivemind.compression import deserialize_torch_tensor, serialize_torch_tensor
  from hivemind.proto.runtime_pb2 import CompressionType
  from hivemind.utils import BatchTensorDescriptor, DHTExpiration, HeapEntry, MSGPackSerializer, ValueWithExpiration
  from hivemind.utils.asyncio import achain, aenumerate, aiter_with_timeout, amap_in_executor, anext, as_aiter, asingle, attach_event_on_finished, azip, cancel_and_wait, enter_asynchronously
  from hivemind.utils.mpfuture import InvalidStateError
  from hivemind.utils.performance_ema import PerformanceEMA
label_desc: Use image node_id 1 for calling a global function with example usage: test_mpfuture_result() without return types