code: def ds_localhost_http_server():
      ds_proc = subprocess.Popen(
          ["datasette", "--memory", "-p", "8041"],
          stdout=subprocess.PIPE,
          stderr=subprocess.STDOUT,
          # Avoid FileNotFoundError: [Errno 2] No such file or directory:
          cwd=tempfile.gettempdir(),
      )
      wait_until_responds("http://localhost:8041/")
      # Check it started successfully
      assert not ds_proc.poll(), ds_proc.stdout.read().decode("utf-8")
      yield ds_proc
      # 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 9 for calling a global function with example usage: ds_localhost_http_server() without return types