code: def _validate_consistent_python_output(
      deployment, dag, handle_by_name, input=None, output=None
  ):
      """Assert same input lead to same outputs across the following:
      1) Deployment handle returned from Deployment instance get_handle()
      2) Original executable Ray DAG
      3) Deployment handle return from serve public API get_deployment()
      """
      deployment_handle = deployment._get_handle()
      assert ray.get(deployment_handle.remote(input)) == output
      handle_by_name = _private_api.get_deployment(
          handle_by_name
      )._get_handle()
      assert ray.get(handle_by_name.remote(input)) == output
  
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 1 for calling a global function with example usage: _validate_consistent_python_output(deployment, dag, handle_by_name, input, output) without return types