class_docstr: An execution parameter in a ComponentSpec.
  
  This type of parameter should be specified in the PARAMETERS dict of a
  ComponentSpec:
  
  class MyCustomComponentSpec(ComponentSpec):
    # ...
    PARAMETERS = {
        'internal_option': ExecutionParameter(type=str),
    }
    # ...
  
  Attributes:
    type: Type of the execution parameter.
    optional: Boolean value indicating whether the parameter is optional.
    use_proto: Boolean value indicating whether pb message (and other
      non-primitive types like lists) should be stored in its original form.
docstr: Perform type check to the parameter passed in.
code: def type_check(self, arg_name: str, value: Any):
      """Perform type check to the parameter passed in."""
      if isinstance(value, placeholder.Placeholder):
          # TODO(b/266800844): Insert a type plausibility check.
          return
  
      is_runtime_param = _is_runtime_param(value)
      value = _make_default(value)
      if self.type == Any:
          return
      # types.GenericAlias was added in Python 3.9, and we use string
      # comparisons as a workaround for Python<3.9.
      if type(self.type).__name__ in ("_GenericAlias", "GenericAlias"):
          if not check_strict_json_compat(value, self.type):
              raise TypeError(
                  f"Expected type {self.type!s} for parameter {arg_name!r} but got "
                  f"{value!s} instead."
              )
      elif isinstance(value, dict) and issubclass(
          self.type, message.Message
      ):
          # If a dict is passed in and is compared against a pb message,
          # do the type-check by converting it to pb message.
          proto_utils.dict_to_proto(value, self.type())
      elif (
          isinstance(value, str)
          and not isinstance(self.type, tuple)
          and issubclass(self.type, message.Message)
      ):
          # Skip check for runtime param string proto.
          if not is_runtime_param:
              # If a text is passed in and is compared against a pb message,
              # do the type-check by converting text (as json) to pb message.
              proto_utils.json_to_proto(value, self.type())
      else:
          if not isinstance(value, self.type):
              raise TypeError(
                  f"Expected type {self.type!s} for parameter {arg_name!r} but got "
                  f"{value!s} instead."
              )
  
imports: import copy
  import inspect
  import itertools
  from typing import Any, Dict, List, Mapping, Optional, Type, cast
  from tfx.dsl.component.experimental.json_compat import check_strict_json_compat
  from tfx.dsl.placeholder import placeholder
  from tfx.types import artifact
  from tfx.types import channel
  from tfx.types.system_executions import SystemExecution
  from tfx.utils import json_utils
  from tfx.utils import proto_utils
  from google.protobuf import message
label_desc: Use image node_id 4 for calling the ExecutionParameter obj's underlying member method code with example usage: obj.type_check(arg_name, value) without return types