code: def test_as_completed(client):
      ac = client.submit(Counter, actor=True).result()
      futures = [ac.increment() for _ in range(10)]
      max = 0
  
      for future in as_completed(futures):
          value = future.result()
          if value > max:
              max = value
  
      assert all(future.done() for future in futures)
      assert max == 10
  
imports: from __future__ import annotations
  import asyncio
  import operator
  from time import sleep
  import pytest
  import dask
  from distributed import Actor, BaseActorFuture, Client, Future, Nanny, as_completed, get_client, wait, worker_client
  from distributed.metrics import time
  from distributed.utils import LateLoopEvent
  from distributed.utils_test import cluster, double, gen_cluster, inc
  from distributed.worker import get_worker
label_desc: Use image node_id 10 for calling a global function with example usage: test_as_completed(client) without return types