class_docstr: The `PanelFrontend` enables you to serve Panel code as a Frontend for your LightningFlow.
  
  Reference: https://lightning.ai/lightning-docs/workflows/add_web_ui/panel/
  
  Args:
      entry_point: The path to a .py or .ipynb file, or a pure function. The file or function must contain your Panel
          code. The function can optionally accept an ``AppStateWatcher`` argument.
  
  Raises:
      TypeError: Raised if the ``entry_point`` provided is a class method
  
  Example:
  
  To use the `PanelFrontend`, you must first install the `panel` package:
  
  .. code-block:: bash
  
      pip install panel
  
  Create the files `panel_app_basic.py` and `app_basic.py` with the content below.
  
  **panel_app_basic.py**
  
  .. code-block:: python
  
      import panel as pn
  
      pn.panel("Hello **Panel ⚡** World").servable()
  
  **app_basic.py**
  
  .. code-block:: python
  
      from lightning.app import LightningFlow, LightningApp
      from lightning.app.frontend.panel import PanelFrontend
  
  
      class LitPanel(LightningFlow):
          def configure_layout(self):
              return PanelFrontend("panel_app_basic.py")
  
  
      class LitApp(LightningFlow):
          def __init__(self):
              super().__init__()
              self.lit_panel = LitPanel()
  
          def configure_layout(self):
              return {"name": "home", "content": self.lit_panel}
  
  
      app = LightningApp(LitApp())
  
  Start the Lightning server with `lightning run app app_basic.py`.
  
  For development you can get Panel autoreload by setting the ``PANEL_AUTORELOAD``
  environment variable to 'yes', i.e. run
  ``PANEL_AUTORELOAD=yes lightning run app app_basic.py``
code: def _get_popen_args(self, host: str, port: int) -> list:
      if callable(self.entry_point):
          path = str(
              pathlib.Path(__file__).parent / "panel_serve_render_fn.py"
          )
      else:
          path = pathlib.Path(self.entry_point)
  
      abs_path = str(path)
      # The app is served at http://localhost:{port}/{flow}/{entry_point}
      # Lightning embeds http://localhost:{port}/{flow} but this redirects to the above and
      # seems to work fine.
      command = [
          sys.executable,
          "-m",
          "panel",
          "serve",
          abs_path,
          "--port",
          str(port),
          "--address",
          host,
          "--prefix",
          self.flow.name,
          "--allow-websocket-origin",
          _get_allowed_hosts(),
      ]
      if _has_panel_autoreload():
          command.append("--autoreload")
      _logger.debug("PanelFrontend command %s", command)
      return command
  
imports: from __future__ import annotations
  import inspect
  import os
  import pathlib
  import subprocess
  import sys
  from typing import Callable, TextIO
  from lightning.app.frontend.frontend import Frontend
  from lightning.app.frontend.utils import _get_frontend_environment
  from lightning.app.utilities.app_helpers import Logger
  from lightning.app.utilities.cloud import is_running_in_cloud
  from lightning.app.utilities.imports import requires
  from lightning.app.utilities.log import get_logfile
label_desc: Use image node_id 6 for calling the PanelFrontend obj's underlying member method code with example usage: obj._get_popen_args(host, port) and returns: command