code: def ds_unix_domain_socket_server(tmp_path_factory):
      # This used to use tmp_path_factory.mktemp("uds") but that turned out to
      # produce paths that were too long to use as UDS on macOS, see
      # https://github.com/simonw/datasette/issues/1407 - so I switched to
      # using tempfile.gettempdir()
      uds = str(pathlib.Path(tempfile.gettempdir()) / "datasette.sock")
      ds_proc = subprocess.Popen(
          ["datasette", "--memory", "--uds", uds],
          stdout=subprocess.PIPE,
          stderr=subprocess.STDOUT,
          cwd=tempfile.gettempdir(),
      )
      # Poll until available
      transport = httpx.HTTPTransport(uds=uds)
      client = httpx.Client(transport=transport)
      wait_until_responds(
          "http://localhost/_memory.json", client=client
      )
      # Check it started successfully
      assert not ds_proc.poll(), ds_proc.stdout.read().decode("utf-8")
      yield ds_proc, uds
      # Shut it down at the end of the pytest session
      ds_proc.terminate()
  
imports: import asyncio
  import httpx
  import os
  import pathlib
  import pytest
  import pytest_asyncio
  import re
  import subprocess
  import tempfile
  import time
  import trustme
label_desc: Use image node_id 10 for calling a global function with example usage: ds_unix_domain_socket_server(tmp_path_factory) without return types