code: def which(editor: str) -> Optional[str]:
      
      try:
          editor_path = subprocess.check_output(['which', editor], stderr=subprocess.STDOUT).strip()
          editor_path = editor_path.decode()
      except subprocess.CalledProcessError:
          editor_path = None
      return editor_path
docs: Find the full path of a given editor.
  
      Return the full path of the given editor, or None if the editor can
      not be found.
  
      :param editor: filename of the editor to check, ie 'notepad.exe' or 'vi'
      :return: a full path or None