code: def process_ingress_deployment_in_serve_dag(
      deployments: List[Deployment],
  ) -> List[Deployment]:
      """Mark the last fetched deployment in a serve dag as exposed with default
      prefix.
      """
      if len(deployments) == 0:
          return deployments
  
      # Last element of the list is the root deployment if it's applicable type
      # that wraps an deployment, given Ray DAG traversal is done bottom-up.
      ingress_deployment = deployments[-1]
      if ingress_deployment.route_prefix in [
          None,
          f"/{ingress_deployment.name}",
      ]:
          # Override default prefix to "/" on the ingress deployment, if user
          # didn't provide anything in particular.
          new_ingress_deployment = ingress_deployment.options(
              route_prefix="/",
              _internal=True,
          )
          deployments[-1] = new_ingress_deployment
  
      # Erase all non ingress deployment route prefix
      for i, deployment in enumerate(deployments[:-1]):
          if (
              deployment.route_prefix is not None
              and deployment.route_prefix != f"/{deployment.name}"
          ):
              raise ValueError(
                  "Route prefix is only configurable on the ingress deployment. "
                  "Please do not set non-default route prefix: "
                  f"{deployment.route_prefix} on non-ingress deployment of the "
                  "serve DAG. "
              )
          else:
              # Erase all default prefix to None for non-ingress deployments to
              # disable HTTP
              deployments[i] = deployment.options(
                  route_prefix=None, _internal=True
              )
  
      return deployments
  
imports: import inspect
  from collections import OrderedDict
  from typing import List
  from ray.dag import ClassNode, DAGNode
  from ray.dag.function_node import FunctionNode
  from ray.dag.utils import _DAGNodeNameGenerator
  from ray.experimental.gradio_utils import type_to_string
  from ray.serve._private.constants import RAY_SERVE_ENABLE_NEW_HANDLE_API, SERVE_DEFAULT_APP_NAME
  from ray.serve._private.deployment_executor_node import DeploymentExecutorNode
  from ray.serve._private.deployment_function_executor_node import DeploymentFunctionExecutorNode
  from ray.serve._private.deployment_function_node import DeploymentFunctionNode
  from ray.serve._private.deployment_node import DeploymentNode
  from ray.serve.deployment import Deployment, schema_to_deployment
  from ray.serve.handle import DeploymentHandle, RayServeHandle
  from ray.serve.schema import DeploymentSchema
label_desc: Use image node_id 7 for calling a global function with example usage: process_ingress_deployment_in_serve_dag(deployments) and returns: deployments, deployments