code: def start_application_server(
      entrypoint_file: str,
      host: str,
      port: int,
      queue_id: str,
      queues: Optional[FlowRestAPIQueues] = None,
  ):
      logger.debug(
          f"Run Lightning Work {entrypoint_file} {host} {port} {queue_id}"
      )
      queue_system = QueuingSystem(CLOUD_QUEUE_TYPE)
  
      wait_for_queues(queue_system)
  
      kwargs = {
          "api_delta_queue": queue_system.get_api_delta_queue(
              queue_id=queue_id
          ),
      }
  
      # Note: Override the queues if provided
      if isinstance(queues, Dict):
          kwargs.update(queues)
      else:
          kwargs.update(
              {
                  "api_publish_state_queue": queue_system.get_api_state_publish_queue(
                      queue_id=queue_id
                  ),
                  "api_response_queue": queue_system.get_api_response_queue(
                      queue_id=queue_id
                  ),
              }
          )
  
      app = load_app_from_file(entrypoint_file)
  
      from lightning.app.api.http_methods import (
          _add_tags_to_api,
          _validate_api,
      )
      from lightning.app.utilities.app_helpers import is_overridden
      from lightning.app.utilities.commands.base import (
          _commands_to_api,
          _prepare_commands,
      )
  
      apis = []
      if is_overridden("configure_api", app.root):
          apis = app.root.configure_api()
          _validate_api(apis)
          _add_tags_to_api(apis, ["app_api"])
  
      if is_overridden("configure_commands", app.root):
          commands = _prepare_commands(app)
          apis += _commands_to_api(commands)
  
      start_server(
          host=host,
          port=port,
          apis=apis,
          **kwargs,
          spec=extract_metadata_from_app(app),
      )
  
imports: import inspect
  import logging
  import os
  import signal
  import sys
  import time
  import traceback
  from functools import partial
  from multiprocessing import Process
  from typing import Callable, Dict, List, Optional, Tuple, TypedDict
label_desc: Use image node_id 1 for calling a global function with example usage: start_application_server(entrypoint_file, host, port, queue_id, queues) without return types