code: def test_put_get_multi_app(ray_start_stop, url):
      pizza_import_path = "ray.serve.tests.test_config_files.test_dag.conditional_dag.serve_dag"
      world_import_path = (
          "ray.serve.tests.test_config_files.world.DagNode"
      )
      config1 = {
          "http_options": {
              "host": "127.0.0.1",
              "port": 8000,
          },
          "applications": [
              {
                  "name": "app1",
                  "route_prefix": "/app1",
                  "import_path": pizza_import_path,
                  "deployments": [
                      {
                          "name": "Adder",
                          "ray_actor_options": {
                              "runtime_env": {
                                  "env_vars": {
                                      "override_increment": "3"
                                  }
                              }
                          },
                      },
                      {
                          "name": "Multiplier",
                          "ray_actor_options": {
                              "runtime_env": {
                                  "env_vars": {"override_factor": "4"}
                              }
                          },
                      },
                  ],
              },
              {
                  "name": "app2",
                  "route_prefix": "/app2",
                  "import_path": world_import_path,
              },
          ],
      }
  
      # Use empty dictionary for app1 Adder's ray_actor_options.
      config2 = copy.deepcopy(config1)
      config2["applications"][0]["deployments"][0][
          "ray_actor_options"
      ] = {}
  
      config3 = copy.deepcopy(config1)
      config3["applications"][0] = {
          "name": "app1",
          "route_prefix": "/app1",
          "import_path": world_import_path,
      }
  
      # Ensure the REST API is idempotent
      num_iterations = 2
      for iteration in range(num_iterations):
          print(
              f"*** Starting Iteration {iteration + 1}/{num_iterations} ***\n"
          )
  
          # APPLY CONFIG 1
          print("Sending PUT request for config1.")
          deploy_config_multi_app(config1, url)
          wait_for_condition(
              lambda: requests.post(
                  "http://localhost:8000/app1", json=["ADD", 2]
              ).text
              == "5 pizzas please!",
              timeout=15,
          )
          wait_for_condition(
              lambda: requests.post(
                  "http://localhost:8000/app1", json=["MUL", 2]
              ).text
              == "8 pizzas please!",
              timeout=15,
          )
          wait_for_condition(
              lambda: requests.post("http://localhost:8000/app2").text
              == "wonderful world",
              timeout=15,
          )
          print("Deployments are live and reachable over HTTP.\n")
  
          # APPLY CONFIG 2: App #1 Adder should add 2 to input.
          print("Sending PUT request for config2.")
          deploy_config_multi_app(config2, url)
          wait_for_condition(
              lambda: requests.post(
                  "http://localhost:8000/app1", json=["ADD", 2]
              ).text
              == "4 pizzas please!",
              timeout=15,
          )
          print("Adder deployment updated correctly.\n")
  
          # APPLY CONFIG 3: App #1 should be overwritten to world:DagNode
          print("Sending PUT request for config3.")
          deploy_config_multi_app(config3, url)
          wait_for_condition(
              lambda: requests.post("http://localhost:8000/app1").text
              == "wonderful world",
              timeout=15,
          )
          print("Deployments are live and reachable over HTTP.\n")
  
imports: import copy
  import grpc
  import re
  import os
  import sys
  from typing import Dict
  import pytest
  import requests
  import ray
  from ray import serve
  from ray._private.test_utils import wait_for_condition
  import ray._private.ray_constants
  from ray.util.state import list_actors
  from ray.serve._private.constants import SERVE_NAMESPACE
  from ray.serve.tests.conftest import *
  from ray.tests.conftest import *
  from ray._private.test_utils import generate_system_config_map
  from ray.serve.schema import ServeInstanceDetails, HTTPOptionsSchema
  from ray.serve._private.common import ApplicationStatus, DeploymentStatus, DeploymentStatusTrigger, ReplicaState, ProxyStatus
  from ray.serve.generated import serve_pb2, serve_pb2_grpc
label_desc: Use image node_id 2 for calling a global function with example usage: test_put_get_multi_app(ray_start_stop, url) without return types