code: def cached_app(config=None, testing=False):
      """Return cached instance of Airflow WWW app."""
      global app
      if not app:
          app = create_app(config=config, testing=testing)
      return app
  
imports: from __future__ import annotations
  import warnings
  from datetime import timedelta
  from flask import Flask
  from flask_appbuilder import SQLA
  from flask_wtf.csrf import CSRFProtect
  from markupsafe import Markup
  from sqlalchemy.engine.url import make_url
  from airflow import settings
  from airflow.api_internal.internal_api_call import InternalApiConfig
  from airflow.configuration import conf
  from airflow.exceptions import AirflowConfigException, RemovedInAirflow3Warning
  from airflow.logging_config import configure_logging
  from airflow.models import import_all_models
  from airflow.settings import _ENABLE_AIP_44
  from airflow.utils.json import AirflowJsonProvider
  from airflow.www.extensions.init_appbuilder import init_appbuilder
  from airflow.www.extensions.init_appbuilder_links import init_appbuilder_links
  from airflow.www.extensions.init_auth_manager import get_auth_manager
  from airflow.www.extensions.init_cache import init_cache
  from airflow.www.extensions.init_dagbag import init_dagbag
  from airflow.www.extensions.init_jinja_globals import init_jinja_globals
  from airflow.www.extensions.init_manifest_files import configure_manifest_files
  from airflow.www.extensions.init_robots import init_robots
  from airflow.www.extensions.init_security import init_api_experimental_auth, init_check_user_active, init_xframe_protection
  from airflow.www.extensions.init_session import init_airflow_session_interface
  from airflow.www.extensions.init_views import init_api_auth_provider, init_api_connexion, init_api_error_handlers, init_api_experimental, init_api_internal, init_appbuilder_views, init_error_handlers, init_flash_views, init_plugins
  from airflow.www.extensions.init_wsgi_middlewares import init_wsgi_middleware
label_desc: Use image node_id 2 for calling a global function with example usage: cached_app(config, testing) and returns: app