code: def test_read_blocks_write():
      in_event = threading.Event()
      block_event = threading.Event()
      lock = ReadWriteLock()
  
      other = threading.Thread(
          target=read, args=(lock, in_event, block_event)
      )
      try:
          other.start()
          in_event.wait()
          result = lock.acquire_write(timeout=0.1)
          assert result is False
  
          block_event.set()
          with lock.write():
              pass
      finally:
          block_event.set()
          other.join()
  
file_path: distributed/distributed/shuffle/tests/test_read_write_lock.py
imports: from __future__ import annotations
  import threading
  import pytest
  from distributed.shuffle._disk import ReadWriteLock
label_desc: Use image node_id 6 for calling a global function with example usage: test_read_blocks_write() without return types