code: def get_handle_function(router: ProxyRouter) -> Callable:
      if isinstance(router, LongestPrefixRouter):
          return router.match_route
      else:
          return router.get_handle_for_endpoint
  
file_path: ray/python/ray/serve/tests/test_proxy_router.py
imports: from typing import Callable
  import pytest
  from ray.serve._private.common import EndpointInfo, EndpointTag, RequestProtocol
  from ray.serve._private.proxy_router import EndpointRouter, LongestPrefixRouter, ProxyRouter
label_desc: Use image node_id 1 for calling a global function with example usage: get_handle_function(router) and returns: router, router