code: def test_close_sync(client):
      sem = Semaphore()
      sem.close()
  
      with pytest.raises(
          RuntimeError,
          match="Semaphore .* not known or already closed.",
      ):
          sem.acquire()
  
imports: from __future__ import annotations
  import asyncio
  import logging
  import pickle
  import signal
  from datetime import timedelta
  from time import sleep
  import pytest
  import dask
  from dask.distributed import Client
  from distributed import Semaphore, fire_and_forget
  from distributed.core import ConnectionPool
  from distributed.metrics import time
  from distributed.utils_test import BrokenComm, captured_logger, cluster, gen_cluster, slowidentity
label_desc: Use image node_id 3 for calling a global function with example usage: test_close_sync(client) without return types