code: def _synthesize(browser, *, preferred=False):
      """Attempt to synthesize a controller based on existing controllers.
  
      This is useful to create a controller when a user specifies a path to
      an entry in the BROWSER environment variable -- we can copy a general
      controller to operate using a specific installation of the desired
      browser in this way.
  
      If we can't create a controller in this way, or if there is no
      executable for the requested browser, return [None, None].
  
      """
      cmd = browser.split()[0]
      if not shutil.which(cmd):
          return [None, None]
      name = os.path.basename(cmd)
      try:
          command = _browsers[name.lower()]
      except KeyError:
          return [None, None]
      # now attempt to clone to fit the new name:
      controller = command[1]
      if controller and name.lower() == controller.basename:
          import copy
  
          controller = copy.copy(controller)
          controller.name = browser
          controller.basename = os.path.basename(browser)
          register(
              browser, None, instance=controller, preferred=preferred
          )
          return [None, controller]
      return [None, None]
  
imports: import os
  import shlex
  import shutil
  import sys
  import subprocess
  import threading
  import warnings
label_desc: Use image node_id 6 for calling a global function with example usage: _synthesize(browser) and returns: list, list, list, list