code: def is_in_form(dg: DeltaGenerator) -> bool:
      """True if the DeltaGenerator is inside an st.form block."""
      return current_form_id(dg) != ""
  
imports: from __future__ import annotations
  import textwrap
  from typing import TYPE_CHECKING, NamedTuple, cast
  from typing_extensions import Literal
  from streamlit import runtime
  from streamlit.errors import StreamlitAPIException
  from streamlit.proto import Block_pb2
  from streamlit.runtime.metrics_util import gather_metrics
  from streamlit.runtime.scriptrunner import ScriptRunContext, get_script_run_ctx
  from streamlit.runtime.scriptrunner.script_run_context import dg_stack
  from streamlit.runtime.state import WidgetArgs, WidgetCallback, WidgetKwargs
label_desc: Use image node_id 3 for calling a global function with example usage: is_in_form(dg) and returns: unknown