code: def test_as_completed_with_results_no_raise(client):
      x = client.submit(throws, 1)
      y = client.submit(inc, 5)
      z = client.submit(inc, 1)
  
      ac = as_completed(
          [x, y, z], with_results=True, raise_errors=False
      )
      y.cancel()
      res = list(ac)
  
      dd = {r[0]: r[1:] for r in res}
      assert dd.keys() == {x, y, z}
      assert x.status == "error"
      assert y.status == "cancelled"
      assert z.status == "finished"
  
      assert isinstance(dd[y][0], CancelledError) or dd[y][0] == 6
      assert isinstance(dd[x][0][1], RuntimeError)
      assert dd[z][0] == 2
  
imports: from __future__ import annotations
  import asyncio
  import queue
  import random
  from collections.abc import Iterator
  from operator import add
  from time import sleep
  import pytest
  from distributed import TimeoutError
  from distributed.client import _as_completed, _first_completed, as_completed, wait
  from distributed.metrics import time
  from distributed.utils import CancelledError
  from distributed.utils_test import gen_cluster, inc, slowinc, throws
label_desc: Use image node_id 12 for calling a global function with example usage: test_as_completed_with_results_no_raise(client) without return types