code: def server(port):
      with subprocess.Popen(
          [
              sys.executable,
              "-m",
              "http.server",
              str(port),
              "--directory",
              "build/html",
          ],
          stderr=subprocess.DEVNULL,
          stdout=subprocess.DEVNULL,
      ) as prc:
          try:
              for _ in range(5):
                  try:
                      if requests.get(f"http://localhost:{port}").ok:
                          break
                  except requests.exceptions.ConnectionError:
                      time.sleep(0.5)
              else:
                  raise RuntimeError("Server did not start")
  
              yield
          finally:
              prc.terminate()
  
file_path: mlflow/docs/broken_links.py
imports: import contextlib
  import socket
  import subprocess
  import sys
  import time
  import requests
  from scrapy.crawler import CrawlerProcess
  from scrapy.linkextractors import LinkExtractor
  from scrapy.spiders import CrawlSpider, Rule
label_desc: Use image node_id 2 for calling a global function with example usage: server(port) without return types