code: def _run_app(
      file: str,
      cloud: bool,
      without_server: bool,
      no_cache: bool,
      name: str,
      blocking: bool,
      open_ui: bool,
      env: tuple,
      secret: tuple,
      run_app_comment_commands: bool,
      enable_basic_auth: str,
  ) -> None:
      if not os.path.exists(file):
          original_file = file
          file = cmd_install.gallery_apps_and_components(file, True, "latest", overwrite=True)  # type: ignore[assignment]  # noqa E501
          if file is None:
              click.echo(
                  f"The provided entrypoint `{original_file}` doesn't exist."
              )
              sys.exit(1)
          run_app_comment_commands = True
  
      runtime_type = (
          RuntimeType.CLOUD if cloud else RuntimeType.MULTIPROCESS
      )
  
      # Cloud specific validations
      if runtime_type != RuntimeType.CLOUD:
          if no_cache:
              raise click.ClickException(
                  "Caching is a property of apps running in cloud. "
                  "Using the flag --no-cache in local execution is not supported."
              )
          if secret:
              raise click.ClickException(
                  "Secrets can only be used for apps running in cloud. "
                  "Using the option --secret in local execution is not supported."
              )
          if (
              ENABLE_APP_COMMENT_COMMAND_EXECUTION
              or run_app_comment_commands
          ) and file is not None:
              run_app_commands(str(file))
  
      env_vars = _format_input_env_variables(env)
      os.environ.update(env_vars)
  
      secrets = _format_input_env_variables(secret)
  
      port = _find_lit_app_port(constants.APP_SERVER_PORT)
      constants.APP_SERVER_PORT = port
  
      click.echo(
          "Your Lightning App is starting. This won't take long."
      )
  
      # TODO: Fixme when Grid utilities are available.
      # And refactor test_lightning_run_app_cloud
      file_path = Path(file)
      dispatch(
          file_path,
          runtime_type,
          start_server=not without_server,
          no_cache=no_cache,
          blocking=blocking,
          open_ui=open_ui,
          name=name,
          env_vars=env_vars,
          secrets=secrets,
          run_app_comment_commands=run_app_comment_commands,
          enable_basic_auth=enable_basic_auth,
          port=port,
      )
      if runtime_type == RuntimeType.CLOUD:
          click.echo("Application is ready in the cloud")
  
imports: import os
  import sys
  from pathlib import Path
  from typing import Tuple, Union
  import click
  from lightning_utilities.core.imports import RequirementCache
  from requests.exceptions import ConnectionError
  import lightning.app.core.constants
  from lightning.app import __version__
  from lightning.app.cli import cmd_init, cmd_install, cmd_pl_init, cmd_react_ui_init
  from lightning.app.cli.commands.app_commands import _run_app_command
  from lightning.app.cli.commands.cd import cd
  from lightning.app.cli.commands.cp import cp
  from lightning.app.cli.commands.logs import logs
  from lightning.app.cli.commands.ls import ls
  from lightning.app.cli.commands.pwd import pwd
  from lightning.app.cli.commands.rm import rm
  from lightning.app.cli.connect.app import _list_app_commands, _retrieve_connection_to_an_app, connect_app, disconnect_app
  from lightning.app.cli.connect.data import connect_data
  from lightning.app.cli.lightning_cli_delete import delete
  from lightning.app.cli.lightning_cli_launch import launch
  from lightning.app.cli.lightning_cli_list import get_list
  from lightning.app.core.constants import ENABLE_APP_COMMENT_COMMAND_EXECUTION, get_lightning_cloud_url
  from lightning.app.runners.cloud import CloudRuntime
  from lightning.app.runners.runtime import dispatch
  from lightning.app.runners.runtime_type import RuntimeType
  from lightning.app.utilities.app_commands import run_app_commands
  from lightning.app.utilities.app_helpers import Logger
  from lightning.app.utilities.cli_helpers import _check_environment_and_redirect, _check_version_and_upgrade, _format_input_env_variables
  from lightning.app.utilities.exceptions import _ApiExceptionHandler
  from lightning.app.utilities.login import Auth
  from lightning.app.utilities.port import _find_lit_app_port
label_desc: Use image node_id 8 for calling a global function with example usage: _run_app(file, cloud, without_server, no_cache, name, blocking, open_ui, env, secret, run_app_comment_commands, enable_basic_auth) without return types