code: def _get_flow_state(flow: str) -> AppState:
      """Returns an AppState scoped to the current Flow.
  
      Returns:
          AppState: An AppState scoped to the current Flow.
  
      """
      app_state = AppState()
      app_state._request_state()  # pylint: disable=protected-access
      return _reduce_to_flow_scope(app_state, flow)
  
file_path: pytorch-lightning/src/lightning/app/frontend/utils.py
imports: from __future__ import annotations
  import inspect
  import os
  from typing import Callable
  from lightning.app.core.flow import LightningFlow
  from lightning.app.utilities.state import AppState
label_desc: Use image node_id 2 for calling a global function with example usage: _get_flow_state(flow) and returns: _reduce_to_flow_scope