code: def test_serve_instance_details_is_json_serializable():
      """Test that ServeInstanceDetails is json serializable."""
      serialized_policy_def = (
          b"\x80\x05\x95L\x00\x00\x00\x00\x00\x00\x00\x8c\x1cray."
          b"serve.autoscaling_policy\x94\x8c'replica_queue_length_"
          b"autoscaling_policy\x94\x93\x94."
      )
      details = ServeInstanceDetails(
          controller_info={"node_id": "fake_node_id"},
          proxy_location="EveryNode",
          proxies={"node1": {"status": "HEALTHY"}},
          applications={
              "app1": {
                  "name": "app1",
                  "route_prefix": "/app1",
                  "docs_path": "/docs/app1",
                  "status": "RUNNING",
                  "message": "fake_message",
                  "last_deployed_time_s": 123,
                  "deployments": {
                      "deployment1": {
                          "name": "deployment1",
                          "status": "HEALTHY",
                          "status_trigger": "AUTOSCALING",
                          "message": "fake_message",
                          "deployment_config": {
                              "name": "deployment1",
                              "autoscaling_config": {
                                  # Byte object will cause json serializable error
                                  "serialized_policy_def": serialized_policy_def
                              },
                          },
                          "replicas": [],
                      }
                  },
              }
          },
      )._get_user_facing_json_serializable_dict(exclude_unset=True)
      details_json = json.dumps(details)
  
      expected_json = json.dumps(
          {
              "controller_info": {"node_id": "fake_node_id"},
              "proxy_location": "EveryNode",
              "proxies": {"node1": {"status": "HEALTHY"}},
              "applications": {
                  "app1": {
                      "name": "app1",
                      "route_prefix": "/app1",
                      "docs_path": "/docs/app1",
                      "status": "RUNNING",
                      "message": "fake_message",
                      "last_deployed_time_s": 123.0,
                      "deployments": {
                          "deployment1": {
                              "name": "deployment1",
                              "status": "HEALTHY",
                              "status_trigger": "AUTOSCALING",
                              "message": "fake_message",
                              "deployment_config": {
                                  "name": "deployment1",
                                  "autoscaling_config": {},
                              },
                              "replicas": [],
                          }
                      },
                  }
              },
          }
      )
      assert details_json == expected_json
  
      # ensure internal field, serialized_policy_def, is not exposed
      application = details["applications"]["app1"]
      deployment = application["deployments"]["deployment1"]
      autoscaling_config = deployment["deployment_config"][
          "autoscaling_config"
      ]
      assert "serialized_policy_def" not in autoscaling_config
  
imports: import copy
  import json
  import logging
  import sys
  from typing import Dict, List, Optional, Union
  import pytest
  from ray import serve
  from ray._private.pydantic_compat import ValidationError
  from ray.serve.config import AutoscalingConfig
  from ray.serve.deployment import deployment_to_schema, schema_to_deployment
  from ray.serve.schema import DeploymentSchema, LoggingConfig, RayActorOptionsSchema, ServeApplicationSchema, ServeDeploySchema, ServeInstanceDetails
  from ray.serve.tests.common.remote_uris import TEST_DEPLOY_GROUP_PINNED_URI, TEST_MODULE_PINNED_URI
  from ray.util.accelerators.accelerators import NVIDIA_TESLA_P4, NVIDIA_TESLA_V100
label_desc: Use image node_id 8 for calling a global function with example usage: test_serve_instance_details_is_json_serializable() without return types