code: def get_app() -> Application[Any]:
      """
      Get the current active (running) Application.
      An :class:`.Application` is active during the
      :meth:`.Application.run_async` call.
  
      We assume that there can only be one :class:`.Application` active at the
      same time. There is only one terminal window, with only one stdin and
      stdout. This makes the code significantly easier than passing around the
      :class:`.Application` everywhere.
  
      If no :class:`.Application` is running, then return by default a
      :class:`.DummyApplication`. For practical reasons, we prefer to not raise
      an exception. This way, we don't have to check all over the place whether
      an actual `Application` was returned.
  
      (For applications like pymux where we can have more than one `Application`,
      we'll use a work-around to handle that.)
      """
      session = _current_app_session.get()
      if session.app is not None:
          return session.app
  
      from .dummy import DummyApplication
  
      return DummyApplication()
  
file_path: catboost/contrib/python/prompt-toolkit/py3/prompt_toolkit/application/current.py
imports: from __future__ import annotations
  from contextlib import contextmanager
  from contextvars import ContextVar
  from typing import TYPE_CHECKING, Any, Generator
label_desc: Use image node_id 2 for calling a global function with example usage: get_app() and returns: DummyApplication, session