code: def _get_frontends_from_app(entrypoint_file):
      """This function is used to get the frontends from the app. It will be used to start the frontends in a separate
      process if the backend cannot provide flow_names_and_ports. This is useful if the app cannot be loaded locally to
      set the frontend before dispatching to the cloud. The backend exposes by default 10 ports from 8081 if the
      app.spec.frontends is not set.
  
      NOTE: frontend_name are sorted to ensure that they get consistent ports.
  
      :param entrypoint_file: The entrypoint file for the app
      :return: A list of tuples of the form (frontend_name, port_number)
  
      """
      app = load_app_from_file(entrypoint_file)
  
      frontends = []
      # This value of the port should be synced with the port value in the backend.
      # If you change this value, you should also change the value in the backend.
      flow_frontends_starting_port = 8081
      for frontend in sorted(app.frontends.keys()):
          frontends.append((frontend, flow_frontends_starting_port))
          flow_frontends_starting_port += 1
  
      return frontends
  
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 9 for calling a global function with example usage: _get_frontends_from_app(entrypoint_file) and returns: frontends