code: def curstate() -> State:
      """Return the current State object
  
      Returns:
        State : the current default State object
  
      """
      global _STATE
      if _STATE is None:
          _STATE = State()
      return _STATE
  
imports: from __future__ import annotations
  import logging
  import os
  from dataclasses import dataclass
  from typing import TYPE_CHECKING, cast
  from ..core.types import PathLike
  from ..document import Document
  from ..resources import Resources, ResourcesMode
label_desc: Use image node_id 1 for calling a global function with example usage: curstate() and returns: _STATE