code: def test_sync_handle_in_thread(serve_instance):
      @serve.deployment
      def f():
          return "hello"
  
      handle = serve.run(f.bind())
  
      def thread_get_handle(deploy):
          handle = serve.get_deployment_handle(
              deploy._name, SERVE_DEFAULT_APP_NAME
          )
          return handle
  
      with concurrent.futures.ThreadPoolExecutor(
          max_workers=1
      ) as executor:
          fut = executor.submit(thread_get_handle, f)
          handle = fut.result()
          assert handle.remote().result() == "hello"
  
imports: import asyncio
  import concurrent.futures
  import threading
  import pytest
  import requests
  import ray
  from ray import serve
  from ray.serve._private.common import RequestProtocol
  from ray.serve._private.constants import SERVE_DEFAULT_APP_NAME
  from ray.serve._private.router import PowerOfTwoChoicesReplicaScheduler
  from ray.serve.exceptions import RayServeException
  from ray.serve.handle import DeploymentHandle, _HandleOptions
label_desc: Use image node_id 5 for calling a global function with example usage: test_sync_handle_in_thread(serve_instance) and returns: str, handle