docs: def open_folder(query, default_path=None):
      """Shows a user dialog for folder selection
      
      A dialog is opened with the prompt `query`. The current path is set to the last path that was opened/created. The 
      roots of all libraries is added to the list of shortcut folders.
      
      :param str query: Prompt asking the user for a specific folder
      :param str default_path: Path to use if user does not specify one 
      :return: Path selected by the user or `default_path` if no path was specified or None if none of the paths is valid
      :rtype: str
      """
      from gi.repository import Gtk
      from os.path import expanduser, pathsep, dirname, isdir
      from rafcon.gui.singleton import main_window_controller
      from rafcon.gui.runtime_config import global_runtime_config
      last_path = global_runtime_config.get_config_value('LAST_PATH_OPEN_SAVE', "")
      selected_filename = None
      if last_path and isdir(last_path):
          selected_filename = last_path.split(pathsep)[-1]
          last_path = dirname(last_path)
      else:
          last_path = expanduser('~')
  
      dialog = Gtk.FileChooserDialog(query,
                                     None,
                                     Gtk.FileChooserAction.SELECT_FOLDER,
                                     (Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL,
                                      Gtk.STOCK_OPEN, Gtk.ResponseType.OK))
      # Allows confirming with Enter and double-click
      dialog.set_default_response(Gtk.ResponseType.OK)
      if main_window_controller:
          dialog.set_transient_for(main_window_controller.view.get_top_widget())
      dialog.set_current_folder(last_path)
      if selected_filename is not None:
          dialog.select_filename(selected_filename)
  
      dialog.set_show_hidden(False)
  
      # Add library roots to list of shortcut folders
      add_library_root_path_to_shortcut_folders_of_dialog(dialog)
  
      response = dialog.run()
  
      if response != Gtk.ResponseType.OK:
          dialog.destroy()
          if default_path and os.path.isdir(default_path):
              return default_path
          return None
  
      path = dialog.get_filename()
      dialog.destroy()
  
      if os.path.isdir(path):
          global_runtime_config.set_config_value('LAST_PATH_OPEN_SAVE', path)
          return path
      return None