code: def start_flow_and_servers(
      entrypoint_file: str,
      base_url: str,
      queue_id: str,
      host: str,
      port: int,
      flow_names_and_ports: Tuple[Tuple[str, int]],
  ):
      processes: List[Tuple[str, Process]] = []
  
      # Queues between Flow and its Rest API are using multiprocessing to:
      # - reduce redis load
      # - increase UI responsiveness and RPS
      queue_system = QueuingSystem.MULTIPROCESS
      queues = {
          "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
          ),
      }
  
      # In order to avoid running this function 3 seperate times while executing the
      # `run_lightning_flow`, `start_application_server`, & `serve_frontend` functions
      # in a subprocess we extract this to the top level. If we intend to make changes
      # to be able to start these components in seperate containers, the implementation
      # will have to move a call to this function within the initialization process.
      run_app_commands(entrypoint_file)
  
      flow_process = start_server_in_process(
          run_lightning_flow,
          args=(
              entrypoint_file,
              queue_id,
              base_url,
          ),
          kwargs={"queues": queues},
      )
      processes.append(("Flow", flow_process))
  
      server_process = start_server_in_process(
          target=start_application_server,
          args=(
              entrypoint_file,
              host,
              port,
              queue_id,
          ),
          kwargs={"queues": queues},
      )
      processes.append(("Server", server_process))
  
      if not flow_names_and_ports:
          flow_names_and_ports = _get_frontends_from_app(
              entrypoint_file
          )
  
      for name, fe_port in flow_names_and_ports:
          frontend_process = start_server_in_process(
              target=serve_frontend,
              args=(entrypoint_file, name, host, fe_port),
          )
          processes.append((name, frontend_process))
  
      manage_server_processes(processes)
  
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 10 for calling a global function with example usage: start_flow_and_servers(entrypoint_file, base_url, queue_id, host, port, flow_names_and_ports) without return types