code: def _get_ws_port():
      if "LIGHTNING_APP_STATE_URL" in os.environ:
          return 8080
      return APP_SERVER_PORT
  
file_path: pytorch-lightning/src/lightning/app/frontend/panel/app_state_comm.py
imports: from __future__ import annotations
  import asyncio
  import os
  from threading import Thread
  from typing import Callable
  import websockets
  from lightning.app.core.constants import APP_SERVER_PORT
  from lightning.app.utilities.app_helpers import Logger
label_desc: Use image node_id 1 for calling a global function with example usage: _get_ws_port() and returns: APP_SERVER_PORT, int