code: def restore_config_state(confirmed, config_state_name, restore_type):
      if config_state_name == "Current":
          return "<span>Select a config to restore from.</span>"
      if not confirmed:
          return "<span>Cancelled.</span>"
  
      check_access()
  
      config_state = config_states.all_config_states[config_state_name]
  
      print(
          f"*** Restoring webui state from backup: {restore_type} ***"
      )
  
      if restore_type == "extensions" or restore_type == "both":
          shared.opts.restore_config_state_file = config_state[
              "filepath"
          ]
          shared.opts.save(shared.config_filename)
  
      if restore_type == "webui" or restore_type == "both":
          config_states.restore_webui_config(config_state)
  
      shared.state.request_restart()
  
      return ""
  
imports: import json
  import os
  import threading
  import time
  from datetime import datetime, timezone
  import git
  import gradio
  import html
  import shutil
  import errno
  from modules import extensions, shared, paths, config_states, errors, restart
  from modules.paths_internal import config_states_dir
  from modules.call_queue import wrap_gradio_gpu_call
label_desc: Use image node_id 4 for calling a global function with example usage: restore_config_state(confirmed, config_state_name, restore_type) and returns: str, str, str