code: def build_runtime_parameter_spec(
      parameters: List[data_types.RuntimeParameter],
  ) -> Dict[str, pipeline_pb2.PipelineSpec.RuntimeParameter]:
      """Converts RuntimeParameters to mapping from names to proto messages."""
  
      def to_message(parameter: data_types.RuntimeParameter):
          """Converts a RuntimeParameter to RuntimeParameter message."""
          result = pipeline_pb2.PipelineSpec.RuntimeParameter()
          # 1. Map the RuntimeParameter type to an enum in the proto definition.
          if parameter.ptype == int or parameter.ptype == bool:
              result.type = pipeline_pb2.PrimitiveType.INT
          elif parameter.ptype == float:
              result.type = pipeline_pb2.PrimitiveType.DOUBLE
          elif parameter.ptype == str:
              result.type = pipeline_pb2.PrimitiveType.STRING
          else:
              raise TypeError(
                  "Unknown parameter type: {} found in parameter: {}".format(
                      parameter.ptype, parameter.name
                  )
              )
          # 2. Convert its default value.
          default = value_converter(parameter.default)
          if default is not None:
              result.default_value.CopyFrom(default.constant_value)
          return result
  
      return {param.name: to_message(param) for param in parameters}
  
imports: import itertools
  import json
  import os
  import re
  from typing import Any, Dict, List, Mapping, Optional, Type, Union
  from kfp.pipeline_spec import pipeline_spec_pb2
  from tfx import types
  from tfx.dsl.io import fileio
  from tfx.orchestration import data_types
  from tfx.orchestration.kubeflow.v2 import parameter_utils
  from tfx.proto.orchestration import placeholder_pb2
  from tfx.types import artifact
  from tfx.types import channel
  from tfx.types import standard_artifacts
  from tfx.types.experimental import simple_artifacts
  from tfx.utils import json_utils
  from tfx.utils import name_utils
  import yaml
  from google.protobuf import struct_pb2
  from google.protobuf import json_format
  from google.protobuf import message
  from ml_metadata.proto import metadata_store_pb2
label_desc: Use image node_id 1 for calling a global function with example usage: build_runtime_parameter_spec(parameters) and returns: unknown, result