code: def test_with_external_client(
      make_dummy_ta: Callable[..., TargetFunctionRunner]
  ) -> None:
      """
      Expects
      -------
      * A user Client passed directly to a DaskParallelRunner will not not be closed
        upon completion.
      * It will also not create an additional scheduler file
      """
      client = Client()
  
      # We use the same client twice just to be sure
      for _ in range(2):
          single_worker = make_dummy_ta(target, n_workers=2)
          runner = DaskParallelRunner(
              single_worker=single_worker,
              dask_client=client,
          )
  
          # Calling close should not do anything to
          # the client
          runner.close()
  
          assert runner._scheduler_file is None
          assert client.status == "running"
  
      assert client.status == "running"
      client.close()
  
file_path: SMAC3/tests/test_runner/test_dask_runner.py
imports: from __future__ import annotations
  from typing import Callable
  import time
  import pytest
  from ConfigSpace import ConfigurationSpace
  from dask.distributed import Client
  from smac.runhistory import TrialInfo, TrialValue
  from smac.runner.abstract_runner import StatusType
  from smac.runner.dask_runner import DaskParallelRunner
  from smac.runner.target_function_runner import TargetFunctionRunner
  from smac.scenario import Scenario
label_desc: Use image node_id 9 for calling a global function with example usage: test_with_external_client(make_dummy_ta) without return types