class_docstr: The LoadBalancer is a LightningWork component that collects the requests and sends them to the prediciton API
  asynchronously using RoundRobin scheduling. It also performs auto batching of the incoming requests.
  
  After enabling you will require to send username and password from the request header for the private endpoints.
  
  Args:
      input_type: Input type.
      output_type: Output type.
      endpoint: The REST API path.
      max_batch_size: The number of requests processed at once.
      timeout_batching: The number of seconds to wait before sending the requests to process in order to allow for
          requests to be batched. In any case, requests are processed as soon as `max_batch_size` is reached.
      timeout_keep_alive: The number of seconds until it closes Keep-Alive connections if no new data is received.
      timeout_inference_request: The number of seconds to wait for inference.
      api_name: The name to be displayed on the UI. Normally, it is the name of the work class
      cold_start_proxy: The proxy service to use while the work is cold starting.
      **kwargs: Arguments passed to :func:`LightningWork.init` like ``CloudCompute``, ``BuildConfig``, etc.
class_docstr_tok: ["The","LoadBalancer","is","a","LightningWork","component","that","collects","the","requests","and","sends","them","to","the","prediciton","API","asynchronously","using","RoundRobin","scheduling",".","It","also","performs","auto","batching","of","the","incoming","requests",".","After","enabling","you","will","require","to","send","username","and","password","from","the","request","header","for","the","private","endpoints",".","Args",":","input_type",":","Input","type",".","output_type",":","Output","type",".","endpoint",":","The","REST","API","path",".","max_batch_size",":","The","number","of","requests","processed","at","once",".","timeout_batching",":","The","number","of","seconds","to","wait","before","sending","the","requests","to","process","in","order","to","allow","for","requests","to","be","batched",".","In","any","case",",","requests","are","processed","as","soon","as","`","max_batch_size","`","is","reached",".","timeout_keep_alive",":","The","number","of","seconds","until","it","closes","Keep-Alive","connections","if","no","new","data","is","received",".","timeout_inference_request",":","The","number","of","seconds","to","wait","for","inference",".","api_name",":","The","name","to","be","displayed","on","the","UI",".","Normally",",","it","is","the","name","of","the","work","class","cold_start_proxy",":","The","proxy","service","to","use","while","the","work","is","cold","starting",".","*","*","kwargs",":","Arguments","passed","to",":","func",":","`","LightningWork.init","`","like","``","CloudCompute","``",",","``","BuildConfig","``",",","etc","."]
code: def _get_endpoint_info_page(
      self,
  ) -> Optional["APIAccessFrontend"]:  # noqa: F821
      try:
          from lightning_api_access import APIAccessFrontend
      except ModuleNotFoundError:
          logger.warn(
              "Some dependencies to run the UI are missing. To resolve, run `pip install lightning-api-access`"
          )
          return None
  
      if is_running_in_cloud():
          url = f"{self._future_url}{self.endpoint}"
      else:
          url = f"http://localhost:{self.port}{self.endpoint}"
  
      frontend_objects = {
          "name": self._api_name,
          "url": url,
          "method": "POST",
          "request": None,
          "response": None,
      }
      code_samples = self.get_code_sample(url)
      if code_samples:
          frontend_objects["code_sample"] = code_samples
          # TODO also set request/response for JS UI
      else:
          try:
              request = self._get_sample_dict_from_datatype(
                  self._input_type
              )
              response = self._get_sample_dict_from_datatype(
                  self._output_type
              )
          except TypeError:
              return None
          else:
              frontend_objects["request"] = request
              frontend_objects["response"] = response
      return APIAccessFrontend(apis=[frontend_objects])
  
imports: import asyncio
  import logging
  import time
  import uuid
  from itertools import cycle
  from typing import Any, Dict, List, Optional, Tuple, Type, Union
  from typing import SupportsFloat
  import requests
  import uvicorn
  from fastapi import FastAPI, HTTPException, Request
  from fastapi.middleware.cors import CORSMiddleware
  from fastapi.responses import RedirectResponse
  from pydantic import BaseModel
  from starlette.staticfiles import StaticFiles
  from lightning.app.components.serve.cold_start_proxy import ColdStartProxy
  from lightning.app.core.flow import LightningFlow
  from lightning.app.core.work import LightningWork
  from lightning.app.utilities.app_helpers import Logger
  from lightning.app.utilities.cloud import is_running_in_cloud
  from lightning.app.utilities.imports import _is_aiohttp_available, requires
  from lightning.app.utilities.packaging.cloud_compute import CloudCompute
label_desc: Use image node_id 10 for calling the _LoadBalancer obj's underlying member method code with example usage: obj._get_endpoint_info_page() and returns: APIAccessFrontend, None, None