code: def extract_local_deployment_config(
      pipeline: pipeline_pb2.Pipeline,
  ) -> local_deployment_config_pb2.LocalDeploymentConfig:
      """Extracts the proto.Any pipeline.deployment_config to LocalDeploymentConfig."""
  
      if not pipeline.deployment_config:
          raise ValueError(
              "deployment_config is not available in the pipeline."
          )
  
      result = local_deployment_config_pb2.LocalDeploymentConfig()
      if pipeline.deployment_config.Unpack(result):
          return result
  
      result = pipeline_pb2.IntermediateDeploymentConfig()
      if pipeline.deployment_config.Unpack(result):
          return _to_local_deployment(result)
  
      raise ValueError(
          "deployment_config {} of type {} is not supported".format(
              pipeline.deployment_config,
              type(pipeline.deployment_config),
          )
      )
  
file_path: tfx/tfx/orchestration/local/runner_utils.py
imports: from typing import Optional
  from absl import logging
  from tfx.proto.orchestration import local_deployment_config_pb2
  from tfx.proto.orchestration import metadata_pb2
  from tfx.proto.orchestration import pipeline_pb2
  from google.protobuf import any_pb2
  from google.protobuf import message
label_desc: Use image node_id 1 for calling a global function with example usage: extract_local_deployment_config(pipeline) and returns: result, _to_local_deployment