docstr: Configure the UI layout of this LightningFlow.
  
  You can either
  
  1.  Return a single :class:`~lightning.app.frontend.frontend.Frontend` object to serve a user interface
      for this Flow.
  2.  Return a single dictionary to expose the UI of a child flow.
  3.  Return a list of dictionaries to arrange the children of this flow in one or multiple tabs.
  
  **Example:** Serve a static directory (with at least a file index.html inside).
  
  .. code-block:: python
  
      from lightning.app.frontend import StaticWebFrontend
  
  
      class Flow(LightningFlow):
          ...
  
          def configure_layout(self):
              return StaticWebFrontend("path/to/folder/to/serve")
  
  **Example:** Serve a streamlit UI (needs the streamlit package to be installed).
  
  .. code-block:: python
  
      from lightning.app.frontend import StaticWebFrontend
  
  
      class Flow(LightningFlow):
          ...
  
          def configure_layout(self):
              return StreamlitFrontend(render_fn=my_streamlit_ui)
  
  
      def my_streamlit_ui(state):
          # add your streamlit code here!
          import streamlit as st
  
  
  **Example:** Arrange the UI of my children in tabs (default UI by Lightning).
  
  .. code-block:: python
  
      class Flow(LightningFlow):
          def configure_layout(self):
              return [
                  dict(name="First Tab", content=self.child0),
                  dict(name="Second Tab", content=self.child1),
                  dict(name="Lightning", content="https://lightning.ai"),
              ]
  
  If you don't implement ``configure_layout``, Lightning will collect all children and display their UI in a tab
  (if they have their own ``configure_layout`` implemented).
  
  Note:
      This hook gets called at the time of app creation and then again as part of the loop. If desired, the
      returned layout configuration can depend on the state. The only exception are the flows that return a
      :class:`~lightning.app.frontend.frontend.Frontend`. These need to be provided at the time of app creation
      in order for the runtime to start the server.
  
  **Learn more about adding UI**
  
  .. raw:: html
  
      <div class="display-card-container">
          <div class="row">
  
  .. displayitem::
      :header: Add a web user interface (UI)
      :description: Learn more how to integrate several UIs.
      :col_css: col-md-4
      :button_link: ../../../workflows/add_web_ui/index.html
      :height: 180
      :tag: Basic
  
  .. raw:: html
  
          </div>
      </div>
      <br />
docstr_tok: ["Configure","the","UI","layout","of","this","LightningFlow",".","You","can","either","1",".","Return","a","single",":","class",":","`","~lightning.app.frontend.frontend.Frontend","`","object","to","serve","a","user","interface","for","this","Flow",".","2",".","Return","a","single","dictionary","to","expose","the","UI","of","a","child","flow",".","3",".","Return","a","list","of","dictionaries","to","arrange","the","children","of","this","flow","in","one","or","multiple","tabs",".","*","*","Example",":","*","*","Serve","a","static","directory","(","with","at","least","a","file","index.html","inside",")",".","..","code-block",":",":","python","from","lightning.app.frontend","import","StaticWebFrontend","class","Flow","(","LightningFlow",")",":","...","def","configure_layout","(","self",")",":","return","StaticWebFrontend","(","``","path\/to\/folder\/to\/serve","''",")","*","*","Example",":","*","*","Serve","a","streamlit","UI","(","needs","the","streamlit","package","to","be","installed",")",".","..","code-block",":",":","python","from","lightning.app.frontend","import","StaticWebFrontend","class","Flow","(","LightningFlow",")",":","...","def","configure_layout","(","self",")",":","return","StreamlitFrontend","(","render_fn=my_streamlit_ui",")","def","my_streamlit_ui","(","state",")",":","#","add","your","streamlit","code","here","!","import","streamlit","as","st","*","*","Example",":","*","*","Arrange","the","UI","of","my","children","in","tabs","(","default","UI","by","Lightning",")",".","..","code-block",":",":","python","class","Flow","(","LightningFlow",")",":","def","configure_layout","(","self",")",":","return","[","dict","(","name=","''","First","Tab","''",",","content=self.child0",")",",","dict","(","name=","''","Second","Tab","''",",","content=self.child1",")",",","dict","(","name=","''","Lightning","''",",","content=","''","https",":","\/\/lightning.ai","''",")",",","]","If","you","do","n't","implement","``","configure_layout","``",",","Lightning","will","collect","all","children","and","display","their","UI","in","a","tab","(","if","they","have","their","own","``","configure_layout","``","implemented",")",".","Note",":","This","hook","gets","called","at","the","time","of","app","creation","and","then","again","as","part","of","the","loop",".","If","desired",",","the","returned","layout","configuration","can","depend","on","the","state",".","The","only","exception","are","the","flows","that","return","a",":","class",":","`","~lightning.app.frontend.frontend.Frontend","`",".","These","need","to","be","provided","at","the","time","of","app","creation","in","order","for","the","runtime","to","start","the","server",".","*","*","Learn","more","about","adding","UI","*","*","..","raw",":",":","html","<","div","class=","''","display-card-container","''",">","<","div","class=","''","row","''",">","..","displayitem",":",":",":","header",":","Add","a","web","user","interface","(","UI",")",":","description",":","Learn","more","how","to","integrate","several","UIs",".",":","col_css",":","col-md-4",":","button_link",":","..","\/","..","\/","..","\/workflows\/add_web_ui\/index.html",":","height",":","180",":","tag",":","Basic","..","raw",":",":","html","<","\/div",">","<","\/div",">","<","br","\/",">"]
code: def configure_layout(
      self,
  ) -> Union[Dict[str, Any], List[Dict[str, Any]], Frontend]:
      """Configure the UI layout of this LightningFlow.
  
      You can either
  
      1.  Return a single :class:`~lightning.app.frontend.frontend.Frontend` object to serve a user interface
          for this Flow.
      2.  Return a single dictionary to expose the UI of a child flow.
      3.  Return a list of dictionaries to arrange the children of this flow in one or multiple tabs.
  
      **Example:** Serve a static directory (with at least a file index.html inside).
  
      .. code-block:: python
  
          from lightning.app.frontend import StaticWebFrontend
  
  
          class Flow(LightningFlow):
              ...
  
              def configure_layout(self):
                  return StaticWebFrontend("path/to/folder/to/serve")
  
      **Example:** Serve a streamlit UI (needs the streamlit package to be installed).
  
      .. code-block:: python
  
          from lightning.app.frontend import StaticWebFrontend
  
  
          class Flow(LightningFlow):
              ...
  
              def configure_layout(self):
                  return StreamlitFrontend(render_fn=my_streamlit_ui)
  
  
          def my_streamlit_ui(state):
              # add your streamlit code here!
              import streamlit as st
  
  
      **Example:** Arrange the UI of my children in tabs (default UI by Lightning).
  
      .. code-block:: python
  
          class Flow(LightningFlow):
              def configure_layout(self):
                  return [
                      dict(name="First Tab", content=self.child0),
                      dict(name="Second Tab", content=self.child1),
                      dict(name="Lightning", content="https://lightning.ai"),
                  ]
  
      If you don't implement ``configure_layout``, Lightning will collect all children and display their UI in a tab
      (if they have their own ``configure_layout`` implemented).
  
      Note:
          This hook gets called at the time of app creation and then again as part of the loop. If desired, the
          returned layout configuration can depend on the state. The only exception are the flows that return a
          :class:`~lightning.app.frontend.frontend.Frontend`. These need to be provided at the time of app creation
          in order for the runtime to start the server.
  
      **Learn more about adding UI**
  
      .. raw:: html
  
          <div class="display-card-container">
              <div class="row">
  
      .. displayitem::
          :header: Add a web user interface (UI)
          :description: Learn more how to integrate several UIs.
          :col_css: col-md-4
          :button_link: ../../../workflows/add_web_ui/index.html
          :height: 180
          :tag: Basic
  
      .. raw:: html
  
              </div>
          </div>
          <br />
  
      """
      return [
          {"name": name, "content": component}
          for (name, component) in self.flows.items()
      ]
  
imports: import inspect
  import warnings
  from copy import deepcopy
  from datetime import datetime
  from types import FrameType
  from typing import TYPE_CHECKING, Any, Dict, Generator, Iterable, List, Optional, Tuple, Union, cast
  from deepdiff import DeepHash
  from lightning.app.core.work import LightningWork
  from lightning.app.frontend import Frontend
  from lightning.app.storage.drive import Drive, _maybe_create_drive
  from lightning.app.storage.path import Path
  from lightning.app.utilities.app_helpers import _is_json_serializable, _LightningAppRef, _set_child_name, is_overridden
  from lightning.app.utilities.component import _sanitize_state
  from lightning.app.utilities.exceptions import ExitAppException, LightningFlowException
  from lightning.app.utilities.introspection import _is_init_context, _is_run_context
  from lightning.app.utilities.packaging.cloud_compute import CloudCompute, _maybe_create_cloud_compute
label_desc: Use image node_id 25 for calling the LightningFlow obj's underlying member method code with example usage: obj.configure_layout() and returns: unknown