code: def dispatch(
      entrypoint_file: Path,
      runtime_type: "lightning.app.runners.runtime_type.RuntimeType",
      start_server: bool = True,
      no_cache: bool = False,
      host: str = APP_SERVER_HOST,
      port: int = APP_SERVER_PORT,
      blocking: bool = True,
      open_ui: bool = True,
      name: str = "",
      env_vars: Optional[Dict[str, str]] = None,
      secrets: Optional[Dict[str, str]] = None,
      run_app_comment_commands: bool = False,
      enable_basic_auth: str = "",
  ) -> Optional[Any]:
      """Bootstrap and dispatch the application to the target.
  
      Arguments:
          entrypoint_file: Filepath to the current script
          runtime_type: The runtime to be used for launching the app.
          start_server: Whether to run the app REST API.
          no_cache: Whether to use the dependency cache for the app.
          host: Server host address
          port: Server port
          blocking: Whether for the wait for the UI to start running.
          open_ui: Whether to open the UI in the browser.
          name: Name of app execution
          env_vars: Dict of env variables to be set on the app
          secrets: Dict of secrets to be passed as environment variables to the app
          run_app_comment_commands: whether to parse commands from the entrypoint file and execute them before app startup
          enable_basic_auth: whether to enable basic authentication for the app
                             (use credentials in the format username:password as an argument)
  
      """
      from lightning.app.runners.runtime_type import RuntimeType
      from lightning.app.utilities.component import _set_flow_context
  
      _set_flow_context()
  
      runtime_type = RuntimeType(runtime_type)
      runtime_cls: Type[Runtime] = runtime_type.get_runtime()
      app = runtime_cls.load_app_from_file(str(entrypoint_file))
  
      env_vars = {} if env_vars is None else env_vars
      secrets = {} if secrets is None else secrets
  
      if blocking:
          app.stage = AppStage.BLOCKING
  
      runtime = runtime_cls(
          app=app,
          entrypoint=entrypoint_file,
          start_server=start_server,
          host=host,
          port=port,
          env_vars=env_vars,
          secrets=secrets,
          run_app_comment_commands=run_app_comment_commands,
          enable_basic_auth=enable_basic_auth,
      )
      # Used to indicate Lightning has been dispatched
      os.environ["LIGHTNING_DISPATCHED"] = "1"
      # a cloud dispatcher will return the result while local
      # dispatchers will be running the app in the main process
      return runtime.dispatch(
          open_ui=open_ui, name=name, no_cache=no_cache
      )
  
imports: import multiprocessing
  import os
  import sys
  from dataclasses import dataclass, field
  from pathlib import Path
  from threading import Thread
  from typing import TYPE_CHECKING, Any, Dict, List, Optional, Type, Union
  from lightning.app.core import LightningApp, LightningFlow
  from lightning.app.core.constants import APP_SERVER_HOST, APP_SERVER_PORT
  from lightning.app.runners.backends import Backend, BackendType
  from lightning.app.utilities.app_helpers import Logger
  from lightning.app.utilities.enum import AppStage, CacheCallsKeys, WorkStageStatus, make_status
  from lightning.app.utilities.load_app import load_app_from_file
  from lightning.app.utilities.proxies import WorkRunner
label_desc: Use image node_id 1 for calling a global function with example usage: dispatch(entrypoint_file, runtime_type, start_server, no_cache, host, port, blocking, open_ui, name, env_vars, secrets, run_app_comment_commands, enable_basic_auth) and returns: runtime