code: def test_multi_instantiation_class_nested_deployment_arg(
      serve_instance,
  ):
      """
      Test we can pass deployments with **nested** init_arg or init_kwarg,
      instantiated multiple times for the same class, and we can still correctly
      replace args with deployment handle and parse correct deployment instances.
      """
      m1 = Model.bind(2)
      m2 = Model.bind(3)
      ray_dag = Combine.bind(
          m1, m2={NESTED_HANDLE_KEY: m2}, m2_nested=True
      )
  
      with _DAGNodeNameGenerator() as node_name_generator:
          serve_root_dag = ray_dag.apply_recursive(
              lambda node: transform_ray_dag_to_serve_dag(
                  node, node_name_generator, ""
              )
          )
      print(f"Serve DAG: \n{serve_root_dag}")
      deployments = extract_deployments_from_serve_dag(serve_root_dag)
      assert len(deployments) == 3
      # Ensure Deployments with other deployment nodes in init arg are replaced
      # with correct handle
      combine_deployment = deployments[2]
      init_arg_handle = combine_deployment.init_args[0]
      assert isinstance(init_arg_handle, DeploymentHandle)
      assert init_arg_handle.deployment_name == "Model"
      init_kwarg_handle = combine_deployment.init_kwargs["m2"][
          NESTED_HANDLE_KEY
      ]
      assert isinstance(init_kwarg_handle, DeploymentHandle)
      assert init_kwarg_handle.deployment_name == "Model_1"
  
      for deployment in deployments:
          deployment._deploy()
  
      _validate_consistent_python_output(
          deployments[2], ray_dag, "Combine", input=1, output=5
      )
  
file_path: ray/python/ray/serve/tests/test_deployment_graph_build.py
imports: import pytest
  import requests
  import ray
  from ray import serve
  from ray.dag.utils import _DAGNodeNameGenerator
  from ray.serve._private import api
  from ray.serve._private.deployment_graph_build import extract_deployments_from_serve_dag, transform_ray_dag_to_serve_dag
  from ray.serve.handle import DeploymentHandle
  from ray.serve.tests.common.test_modules import NESTED_HANDLE_KEY, Combine, Model
label_desc: Use image node_id 6 for calling a global function with example usage: test_multi_instantiation_class_nested_deployment_arg(serve_instance) without return types