code: def _open_in_browser(content):
      """Open a page in the user's web browser.
  
      This function starts a local server in a separate thread, opens the page
      with webbrowser, and shuts down the server once it has served one request.
      """
      queue = Queue()
  
      class Handler(BaseHTTPRequestHandler):
          def log_message(self, *args):
              del args
  
          def do_GET(self):
              if not self.path.endswith("index.html"):
                  self.send_error(
                      HTTPStatus.NOT_FOUND, "File not found"
                  )
                  return
              self.send_response(HTTPStatus.OK)
              self.send_header("Content-type", "text/html")
              self.send_header("Content-Length", str(len(content)))
              self.end_headers()
              self.wfile.write(content)
              queue.put("done")
  
      server = TCPServer(("", 0), Handler)
      _, port = server.server_address
  
      server_thread = Thread(target=server.serve_forever, daemon=True)
      server_thread.start()
  
      url = f"http://localhost:{port}/index.html"
      webbrowser.open(url)
      try:
          queue.get(timeout=BROWSER_TIMEOUT_SECONDS)
      except Empty:
          raise RuntimeError(
              "Failed to open nilearn plot or report in a web browser."
          )
      server.shutdown()
      server_thread.join()
  
imports: import warnings
  import weakref
  import webbrowser
  from html import escape
  from http import HTTPStatus
  from http.server import BaseHTTPRequestHandler
  from queue import Empty, Queue
  from socketserver import TCPServer
  from threading import Thread
  from nilearn._utils import remove_parameters
label_desc: Use image node_id 2 for calling a global function with example usage: _open_in_browser(content) without return types