code: def test_compose_apps(serve_instance):
      """Test composing deployment handle refs outside of a deployment."""
  
      @serve.deployment
      class Deployment:
          def __init__(self, msg: str):
              self._msg = msg
  
          def __call__(self, inp: str):
              return f"{self._msg}|{inp}"
  
      handle1 = serve.run(
          Deployment.bind("app1"), name="app1", route_prefix="/app1"
      ).options(use_new_handle_api=True)
      handle2 = serve.run(
          Deployment.bind("app2"), name="app2", route_prefix="/app2"
      ).options(use_new_handle_api=True)
  
      assert (
          handle1.remote(handle2.remote("hi")).result()
          == "app1|app2|hi"
      )
  
file_path: ray/python/ray/serve/tests/test_new_handle_api.py
imports: import sys
  from typing import Any
  import pytest
  import ray
  from ray import serve
  from ray._private.test_utils import SignalActor
  from ray.serve.handle import DeploymentHandle, DeploymentResponse, DeploymentResponseGenerator, RayServeHandle, RayServeSyncHandle
label_desc: Use image node_id 5 for calling a global function with example usage: test_compose_apps(serve_instance) and returns: self, str, inp