code: def _to_local_deployment(
      input_config: pipeline_pb2.IntermediateDeploymentConfig,
  ) -> local_deployment_config_pb2.LocalDeploymentConfig:
      """Turns IntermediateDeploymentConfig to LocalDeploymentConfig."""
      result = local_deployment_config_pb2.LocalDeploymentConfig()
      for k, v in input_config.executor_specs.items():
          result.executor_specs[k].CopyFrom(
              _build_executable_spec(k, v)
          )
  
      for k, v in input_config.custom_driver_specs.items():
          result.custom_driver_specs[k].CopyFrom(
              _build_executable_spec(k, v)
          )
  
      for k, v in input_config.node_level_platform_configs.items():
          result.node_level_platform_configs[k].CopyFrom(
              _build_local_platform_config(k, v)
          )
  
      result.metadata_connection_config.CopyFrom(
          extract_mlmd_connection(
              input_config.metadata_connection_config
          )
      )
  
      if (
          result.metadata_connection_config.WhichOneof(
              "connection_config"
          )
          is None
      ):
          # Some users like Kubernetes choose to use their own MLMD connection.
          # So their IR doesn't contain it.
          logging.warning(
              "metadata_connection_config is not provided by IR."
          )
      return result
  
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 4 for calling a global function with example usage: _to_local_deployment(input_config) and returns: result