code: def test_client_sync(client):
      with get_task_stream(client=client) as ts:
          sleep(0.1)  # to smooth over time differences on the scheduler
          # to smooth over time differences on the scheduler
          futures = client.map(inc, range(10))
          wait(futures)
  
      assert len(ts.data) == 10
  
file_path: distributed/distributed/diagnostics/tests/test_task_stream.py
imports: from __future__ import annotations
  import os
  from time import sleep
  import pytest
  from tlz import frequencies
  from distributed import get_task_stream
  from distributed.client import wait
  from distributed.diagnostics.task_stream import TaskStreamPlugin
  from distributed.metrics import time
  from distributed.utils_test import div, gen_cluster, inc, slowinc
label_desc: Use image node_id 1 for calling a global function with example usage: test_client_sync(client) without return types