code: def register_standard_browsers():
      global _tryorder
      _tryorder = []
  
      if sys.platform == "darwin":
          register("MacOSX", None, MacOSXOSAScript("default"))
          register("chrome", None, MacOSXOSAScript("chrome"))
          register("firefox", None, MacOSXOSAScript("firefox"))
          register("safari", None, MacOSXOSAScript("safari"))
          # OS X can use below Unix support (but we prefer using the OS X
          # specific stuff)
  
      if sys.platform == "serenityos":
          # SerenityOS webbrowser, simply called "Browser".
          register("Browser", None, BackgroundBrowser("Browser"))
  
      if sys.platform[:3] == "win":
          # First try to use the default Windows browser
          register("windows-default", WindowsDefault)
  
          # Detect some common Windows browsers, fallback to IE
          iexplore = os.path.join(
              os.environ.get("PROGRAMFILES", "C:\\Program Files"),
              "Internet Explorer\\IEXPLORE.EXE",
          )
          for browser in (
              "firefox",
              "firebird",
              "seamonkey",
              "mozilla",
              "netscape",
              "opera",
              iexplore,
          ):
              if shutil.which(browser):
                  register(browser, None, BackgroundBrowser(browser))
      else:
          # Prefer X browsers if present
          if os.environ.get("DISPLAY") or os.environ.get(
              "WAYLAND_DISPLAY"
          ):
              try:
                  cmd = "xdg-settings get default-web-browser".split()
                  raw_result = subprocess.check_output(
                      cmd, stderr=subprocess.DEVNULL
                  )
                  result = raw_result.decode().strip()
              except (
                  FileNotFoundError,
                  subprocess.CalledProcessError,
                  PermissionError,
                  NotADirectoryError,
              ):
                  pass
              else:
                  global _os_preferred_browser
                  _os_preferred_browser = result
  
              register_X_browsers()
  
          # Also try console browsers
          if os.environ.get("TERM"):
              if shutil.which("www-browser"):
                  register(
                      "www-browser", None, GenericBrowser("www-browser")
                  )
              # The Links/elinks browsers <http://artax.karlin.mff.cuni.cz/~mikulas/links/>
              if shutil.which("links"):
                  register("links", None, GenericBrowser("links"))
              if shutil.which("elinks"):
                  register("elinks", None, Elinks("elinks"))
              # The Lynx browser <http://lynx.isc.org/>, <http://lynx.browser.org/>
              if shutil.which("lynx"):
                  register("lynx", None, GenericBrowser("lynx"))
              # The w3m browser <http://w3m.sourceforge.net/>
              if shutil.which("w3m"):
                  register("w3m", None, GenericBrowser("w3m"))
  
      # OK, now that we know what the default preference orders for each
      # platform are, allow user to override them with the BROWSER variable.
      if "BROWSER" in os.environ:
          userchoices = os.environ["BROWSER"].split(os.pathsep)
          userchoices.reverse()
  
          # Treat choices in same way as if passed into get() but do register
          # and prepend to _tryorder
          for cmdline in userchoices:
              if cmdline != "":
                  cmd = _synthesize(cmdline, preferred=True)
                  if cmd[1] is None:
                      register(
                          cmdline,
                          None,
                          GenericBrowser(cmdline),
                          preferred=True,
                      )
  
imports: import os
  import shlex
  import shutil
  import sys
  import subprocess
  import threading
  import warnings
label_desc: Use image node_id 8 for calling a global function with example usage: register_standard_browsers() without return types