code: def get_persistent_state() -> Dict:
      path = get_persistent_path()
      if not path.exists():
          return {}
      logger.debug("Loading state from %s", path)
      with path.open("r") as f:
          state = json.load(f)
      path.unlink()
      return state
  
file_path: dstack/gateway/src/dstack/gateway/services/persistent.py
imports: import json
  import logging
  from functools import lru_cache
  from pathlib import Path
  from typing import Dict
label_desc: Use image node_id 2 for calling a global function with example usage: get_persistent_state() and returns: state, dict