code: def set_runtime_parameter_pb(
      pb: pipeline_pb2.RuntimeParameter,
      name: str,
      ptype: Type[types.Property],
      default_value: Optional[types.Property] = None,
  ) -> pipeline_pb2.RuntimeParameter:
      """Helper function to fill a RuntimeParameter proto.
  
      Args:
        pb: A RuntimeParameter proto to be filled in.
        name: Name to be set at pb.name.
        ptype: The Python type to be set at pb.type.
        default_value: Optional. If provided, it will be pb.default_value.
  
      Returns:
        A RuntimeParameter proto filled with provided values.
      """
      pb.name = name
      if ptype == int:
          pb.type = pipeline_pb2.RuntimeParameter.Type.INT
          if default_value:
              pb.default_value.int_value = default_value
      elif ptype == float:
          pb.type = pipeline_pb2.RuntimeParameter.Type.DOUBLE
          if default_value:
              pb.default_value.double_value = default_value
      elif ptype == str:
          pb.type = pipeline_pb2.RuntimeParameter.Type.STRING
          if default_value:
              pb.default_value.string_value = default_value
      else:
          raise ValueError(
              "Got unsupported runtime parameter type: {}".format(ptype)
          )
      return pb
  
imports: from typing import cast, List, Optional, Sequence, Tuple, Type, Union, Dict, Any, Set
  from tfx import types
  from tfx.dsl.compiler import constants
  from tfx.dsl.components.base import base_node
  from tfx.dsl.components.common import importer
  from tfx.dsl.components.common import resolver
  from tfx.dsl.context_managers import dsl_context_registry
  from tfx.dsl.placeholder import placeholder
  from tfx.orchestration import data_types_utils
  from tfx.orchestration import pipeline
  from tfx.proto.orchestration import pipeline_pb2
  from tfx.types import channel
  from ml_metadata.proto import metadata_store_pb2
label_desc: Use image node_id 1 for calling a global function with example usage: set_runtime_parameter_pb(pb, name, ptype, default_value) and returns: pb