class_docstr: Class for using LIT inside notebooks.
docstr: Start LIT server and optionally render the UI immediately.
  
  Args:
    *args: Positional arguments for the LitApp.
    height: Height to display the LIT UI in pixels. Defaults to 1000.
    render: Whether to render the UI when this object is constructed. Defaults
      to False.
    proxy_url: Optional proxy URL, if using in a notebook with a server proxy.
      Defaults to None.
    layouts: Optional custom UI layouts. TODO(lit-dev): support simple module
      lists here as well.
    **kw: Keyword arguments for the LitApp.
docstr_tok: ["Start","LIT","server","and","optionally","render","the","UI","immediately",".","Args",":","*","args",":","Positional","arguments","for","the","LitApp",".","height",":","Height","to","display","the","LIT","UI","in","pixels",".","Defaults","to","1000.","render",":","Whether","to","render","the","UI","when","this","object","is","constructed",".","Defaults","to","False",".","proxy_url",":","Optional","proxy","URL",",","if","using","in","a","notebook","with","a","server","proxy",".","Defaults","to","None",".","layouts",":","Optional","custom","UI","layouts",".","TODO","(","lit-dev",")",":","support","simple","module","lists","here","as","well",".","*","*","kw",":","Keyword","arguments","for","the","LitApp","."]
code: def __init__(
      self,
      *args,
      height=1000,
      render=False,
      proxy_url=None,
      layouts: Optional[layout.LitComponentLayouts] = None,
      **kw,
  ):
      """Start LIT server and optionally render the UI immediately.
  
      Args:
        *args: Positional arguments for the LitApp.
        height: Height to display the LIT UI in pixels. Defaults to 1000.
        render: Whether to render the UI when this object is constructed. Defaults
          to False.
        proxy_url: Optional proxy URL, if using in a notebook with a server proxy.
          Defaults to None.
        layouts: Optional custom UI layouts. TODO(lit-dev): support simple module
          lists here as well.
        **kw: Keyword arguments for the LitApp.
      """
      app_flags = dict(server_config.get_flags())
      app_flags["server_type"] = "notebook"
      app_flags["host"] = "localhost"
      app_flags["port"] = None
      app_flags["warm_start"] = 1
      app_flags["warm_start_progress_indicator"] = progress_indicator
      app_flags["sync_state"] = True
  
      layouts = dict(layouts or {})
      if "notebook" not in layouts:
          layouts["notebook"] = LIT_NOTEBOOK_LAYOUT
      # This will be 'notebook' unless custom layouts are also given in Python.
      app_flags["default_layout"] = list(layouts.keys())[0]
      app_flags.update(kw)
  
      lit_demo = dev_server.Server(*args, layouts=layouts, **app_flags)
      self._server = cast(
          wsgi_serving.NotebookWsgiServer, lit_demo.serve()
      )
      self._height = height
      self._proxy_url = proxy_url
  
      if render:
          self.render()
  
imports: from collections.abc import Sequence
  import html
  import json
  import os
  import pathlib
  import random
  from typing import cast, Optional
  import urllib.parse
  import attr
  from IPython import display
  from lit_nlp import dev_server
  from lit_nlp import server_config
  from lit_nlp.api import layout
  from lit_nlp.lib import wsgi_serving
label_desc: Use image node_id 1 to create a new LitWidget object from inherited base classes: object with example: obj = LitWidget()