code: def schema_to_deployment(s: DeploymentSchema) -> Deployment:
      """Creates a deployment with parameters specified in schema.
  
      The returned deployment CANNOT be deployed immediately. It's func_or_class
      value is an empty string (""), which is not a valid import path. The
      func_or_class value must be overwritten with a valid function or class
      before the deployment can be deployed.
      """
  
      if s.ray_actor_options is DEFAULT.VALUE:
          ray_actor_options = None
      else:
          ray_actor_options = s.ray_actor_options.dict(
              exclude_unset=True
          )
  
      if s.placement_group_bundles is DEFAULT.VALUE:
          placement_group_bundles = None
      else:
          placement_group_bundles = s.placement_group_bundles
  
      if s.placement_group_strategy is DEFAULT.VALUE:
          placement_group_strategy = None
      else:
          placement_group_strategy = s.placement_group_strategy
  
      if s.max_replicas_per_node is DEFAULT.VALUE:
          max_replicas_per_node = None
      else:
          max_replicas_per_node = s.max_replicas_per_node
  
      deployment_config = DeploymentConfig.from_default(
          num_replicas=s.num_replicas,
          user_config=s.user_config,
          max_concurrent_queries=s.max_concurrent_queries,
          autoscaling_config=s.autoscaling_config,
          graceful_shutdown_wait_loop_s=s.graceful_shutdown_wait_loop_s,
          graceful_shutdown_timeout_s=s.graceful_shutdown_timeout_s,
          health_check_period_s=s.health_check_period_s,
          health_check_timeout_s=s.health_check_timeout_s,
          logging_config=s.logging_config,
      )
      deployment_config.user_configured_option_names = (
          s.get_user_configured_option_names()
      )
  
      replica_config = ReplicaConfig.create(
          deployment_def="",
          init_args=(),
          init_kwargs={},
          ray_actor_options=ray_actor_options,
          placement_group_bundles=placement_group_bundles,
          placement_group_strategy=placement_group_strategy,
          max_replicas_per_node=max_replicas_per_node,
      )
  
      return Deployment(
          name=s.name,
          deployment_config=deployment_config,
          replica_config=replica_config,
          route_prefix=s.route_prefix,
          _internal=True,
      )
  
imports: import inspect
  import logging
  import warnings
  from copy import deepcopy
  from typing import Any, Callable, Dict, List, Optional, Tuple, Union
  from ray.dag.class_node import ClassNode
  from ray.dag.dag_node import DAGNodeBase
  from ray.dag.function_node import FunctionNode
  from ray.serve._private.config import DeploymentConfig, ReplicaConfig
  from ray.serve._private.constants import SERVE_LOGGER_NAME
  from ray.serve._private.utils import DEFAULT, Default
  from ray.serve.config import AutoscalingConfig
  from ray.serve.context import _get_global_client
  from ray.serve.handle import RayServeHandle, RayServeSyncHandle
  from ray.serve.schema import DeploymentSchema, LoggingConfig, RayActorOptionsSchema
  from ray.util.annotations import Deprecated, PublicAPI
label_desc: Use image node_id 2 for calling a global function with example usage: schema_to_deployment(s) and returns: Deployment