code: def from_proto(cls, proto: DeploymentInfoProto):
      deployment_config = (
          DeploymentConfig.from_proto(proto.deployment_config)
          if proto.deployment_config
          else None
      )
  
      target_capacity = (
          proto.target_capacity if proto.target_capacity != -1 else None
      )
  
      target_capacity_direction = TargetCapacityDirectionProto.Name(
          proto.target_capacity_direction
      )
      if target_capacity_direction == "UNSET":
          target_capacity_direction = None
      else:
          target_capacity_direction = TargetCapacityDirection(
              target_capacity_direction
          )
  
      data = {
          "deployment_config": deployment_config,
          "replica_config": ReplicaConfig.from_proto(
              proto.replica_config,
              deployment_config.needs_pickle()
              if deployment_config
              else True,
          ),
          "start_time_ms": proto.start_time_ms,
          "actor_name": proto.actor_name
          if proto.actor_name != ""
          else None,
          "version": proto.version if proto.version != "" else None,
          "end_time_ms": proto.end_time_ms
          if proto.end_time_ms != 0
          else None,
          "deployer_job_id": ray.get_runtime_context().get_job_id(),
          "target_capacity": target_capacity,
          "target_capacity_direction": target_capacity_direction,
      }
  
      return cls(**data)
  
file_path: ray/python/ray/serve/_private/deployment_info.py
imports: from typing import Any, Dict, Optional
  import ray
  from ray.serve._private.autoscaling_policy import AutoscalingPolicyManager
  from ray.serve._private.common import TargetCapacityDirection
  from ray.serve._private.config import DeploymentConfig, ReplicaConfig
  from ray.serve._private.constants import REPLICA_CONTROL_PLANE_CONCURRENCY_GROUP
  from ray.serve.generated.serve_pb2 import DeploymentInfo
  from ray.serve.generated.serve_pb2 import TargetCapacityDirection
label_desc: Use image node_id 7 for calling the DeploymentInfo obj's underlying member method code with example usage: obj.from_proto(cls, proto) and returns: cls