code: def apply_and_restart(disable_list, update_list, disable_all):
      check_access()
  
      disabled = json.loads(disable_list)
      assert (
          type(disabled) == list
      ), f"wrong disable_list data for apply_and_restart: {disable_list}"
  
      update = json.loads(update_list)
      assert (
          type(update) == list
      ), f"wrong update_list data for apply_and_restart: {update_list}"
  
      if update:
          save_config_state("Backup (pre-update)")
  
      update = set(update)
  
      for ext in extensions.extensions:
          if ext.name not in update:
              continue
  
          try:
              ext.fetch_and_reset_hard()
          except Exception:
              errors.report(
                  f"Error getting updates for {ext.name}", exc_info=True
              )
  
      shared.opts.disabled_extensions = disabled
      shared.opts.disable_all_extensions = disable_all
      shared.opts.save(shared.config_filename)
  
      if restart.is_restartable():
          restart.restart_program()
      else:
          restart.stop_program()
  
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 2 for calling a global function with example usage: apply_and_restart(disable_list, update_list, disable_all) without return types