code: def _main() -> None:
      """Run the render_fn with the current flow_state."""
      import justpy as jp
  
      # Fetch the information of which flow attaches to this justpy instance
      flow_name = os.environ["LIGHTNING_FLOW_NAME"]
  
      # Call the provided render function.
      # Pass it the state, scoped to the current flow.
      render_fn = _get_render_fn_from_environment()
      host = os.environ["LIGHTNING_HOST"]
      port = int(os.environ["LIGHTNING_PORT"])
      entry_fn = render_fn(_get_state)
      if not isinstance(entry_fn, Callable):  # type: ignore
          raise Exception(
              "You need to return a function with JustPy Frontend."
          )
  
      jp.app.add_jproute(f"/{flow_name}", entry_fn)
  
      jp.justpy(_webpage, host=host, port=port)
  
file_path: pytorch-lightning/src/lightning/app/frontend/just_py/just_py_base.py
imports: import os
  import pydoc
  from typing import Any, Callable
  from lightning.app.frontend.utils import _reduce_to_flow_scope
  from lightning.app.utilities.state import AppState
label_desc: Use image node_id 4 for calling a global function with example usage: _main() without return types