code: def test_locking_disabled(tmp_path):
      base_dir = str(tmp_path)
  
      with dask.config.set(
          {"distributed.worker.use-file-locking": False}
      ):
          with mock.patch("locket.lock_file") as lock_file:
              assert_contents = functools.partial(
                  assert_directory_contents, base_dir
              )
  
              ws = WorkSpace(base_dir)
              assert_contents([])
              a = ws.new_work_dir(name="aa")
              assert_contents(["aa"])
              b = ws.new_work_dir(name="bb")
              assert_contents(["aa", "bb"])
              ws._purge_leftovers()
              assert_contents(["aa", "bb"])
  
              a.release()
              assert_contents(["bb"])
              del b
              with profile.lock:
                  gc.collect()
              assert_contents([])
  
          lock_file.assert_not_called()
  
imports: from __future__ import annotations
  import functools
  import gc
  import os
  import queue
  import shutil
  import subprocess
  import sys
  from time import sleep
  from unittest import mock
  import pytest
  import dask
  from distributed import profile
  from distributed.compatibility import WINDOWS
  from distributed.diskutils import WorkSpace
  from distributed.metrics import time
  from distributed.utils import get_mp_context
  from distributed.utils_test import captured_logger
label_desc: Use image node_id 6 for calling a global function with example usage: test_locking_disabled(tmp_path) without return types