code: def test_unpublish_sync(client):
      data = client.scatter([0, 1, 2])
      client.publish_dataset(data=data)
      client.unpublish_dataset(name="data")
  
      with pytest.raises(KeyError) as exc_info:
          client.get_dataset(name="data")
  
      assert "not found" in str(exc_info.value)
      assert "data" in str(exc_info.value)
  
file_path: distributed/distributed/tests/test_publish.py
imports: from __future__ import annotations
  import asyncio
  import pytest
  from dask import delayed
  from distributed import Client
  from distributed.client import futures_of
  from distributed.metrics import time
  from distributed.protocol import Serialized
  from distributed.utils_test import gen_cluster, inc
label_desc: Use image node_id 1 for calling a global function with example usage: test_unpublish_sync(client) without return types