code: def _proto_to_dict(proto: Message) -> Dict:
      """Recursively convert a protobuf into a Python dictionary.
  
      This is an alternative to protobuf's `MessageToDict`. Unlike
      `MessageToDict`, this function doesn't add an extra base64
      encoding to bytes when constructing a json response.
      """
      data = {}
      # Fill data with non-empty fields.
      for field, value in proto.ListFields():
          # Recursively call if the field is another protobuf.
          if field.type == FieldDescriptor.TYPE_MESSAGE:
              data[field.name] = _proto_to_dict(value)
          else:
              data[field.name] = value
  
      # Fill data default values.
      for field in proto.DESCRIPTOR.fields:
          if (
              field.name
              not in data  # skip the fields that are already set
              and field.type
              != FieldDescriptor.TYPE_MESSAGE  # skip nested messages
              and not field.containing_oneof  # skip optional fields
          ):
              data[field.name] = field.default_value
  
      return data
  
imports: import inspect
  import json
  from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Union
  from google.protobuf.descriptor import FieldDescriptor
  from google.protobuf.message import Message
  from ray import cloudpickle
  from ray._private import ray_option_utils
  from ray._private.pydantic_compat import BaseModel, Field, NonNegativeFloat, NonNegativeInt, PositiveFloat, validator
  from ray._private.serialization import pickle_dumps
  from ray._private.utils import resources_from_ray_options
  from ray.serve._private.constants import DEFAULT_GRACEFUL_SHUTDOWN_TIMEOUT_S, DEFAULT_GRACEFUL_SHUTDOWN_WAIT_LOOP_S, DEFAULT_HEALTH_CHECK_PERIOD_S, DEFAULT_HEALTH_CHECK_TIMEOUT_S, DEFAULT_MAX_CONCURRENT_QUERIES, MAX_REPLICAS_PER_NODE_MAX_VALUE
  from ray.serve._private.utils import DEFAULT, DeploymentOptionUpdateType
  from ray.serve.config import AutoscalingConfig
  from ray.serve.generated.serve_pb2 import AutoscalingConfig
  from ray.serve.generated.serve_pb2 import DeploymentConfig
  from ray.serve.generated.serve_pb2 import DeploymentLanguage
  from ray.serve.generated.serve_pb2 import EncodingType
  from ray.serve.generated.serve_pb2 import LoggingConfig
  from ray.serve.generated.serve_pb2 import ReplicaConfig
  from ray.util.placement_group import VALID_PLACEMENT_GROUP_STRATEGIES
label_desc: Use image node_id 2 for calling a global function with example usage: _proto_to_dict(proto) and returns: data