code: def test_get_task_stream_save(client, tmp_path):
      bkm = pytest.importorskip("bokeh.models")
      tmpdir = str(tmp_path)
      fn = os.path.join(tmpdir, "foo.html")
  
      with get_task_stream(plot="save", filename=fn) as ts:
          wait(client.map(inc, range(10)))
      with open(fn) as f:
          data = f.read()
      assert "inc" in data
      assert "bokeh" in data
  
      assert isinstance(ts.figure, bkm.Plot)
  
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 2 for calling a global function with example usage: test_get_task_stream_save(client, tmp_path) without return types