code: def testExecutionParameterTypeCheck(self):
      int_parameter = ExecutionParameter(type=int)
      int_parameter.type_check("int_parameter", 8)
      with self.assertRaisesRegex(
          TypeError,
          "Expected type <(class|type) 'int'>"
          " for parameter u?'int_parameter'",
      ):
          int_parameter.type_check("int_parameter", "string")
  
      list_parameter = ExecutionParameter(type=List[int])
      list_parameter.type_check("list_parameter", [])
      list_parameter.type_check("list_parameter", [42])
      with self.assertRaisesRegex(
          TypeError, r"Expected type typing\.List\[int\]"
      ):
          list_parameter.type_check("list_parameter", 42)
  
      with self.assertRaisesRegex(
          TypeError,
          r"Expected type typing\.List\[int\] "
          "for parameter u?'list_parameter'",
      ):
          list_parameter.type_check(
              "list_parameter", [42, "wrong item"]
          )
  
      dict_parameter = ExecutionParameter(type=Dict[str, int])
      dict_parameter.type_check("dict_parameter", {})
      dict_parameter.type_check(
          "dict_parameter", {"key1": 1, "key2": 2}
      )
      with self.assertRaisesRegex(
          TypeError,
          r"Expected type typing\.Dict\[str, int\] for parameter",
      ):
          dict_parameter.type_check("dict_parameter", "simple string")
  
      with self.assertRaisesRegex(
          TypeError,
          r"Expected type typing\.Dict\[str, int\] for parameter",
      ):
          dict_parameter.type_check("dict_parameter", {"key1": "1"})
  
      proto_parameter = ExecutionParameter(type=example_gen_pb2.Input)
      proto_parameter.type_check(
          "proto_parameter", example_gen_pb2.Input()
      )
      proto_parameter.type_check(
          "proto_parameter",
          proto_utils.proto_to_json(example_gen_pb2.Input()),
      )
      proto_parameter.type_check(
          "proto_parameter", {"splits": [{"name": "hello"}]}
      )
      proto_parameter.type_check("proto_parameter", {"wrong_field": 42})
      with self.assertRaisesRegex(
          TypeError,
          "Expected type <class 'tfx.proto.example_gen_pb2.Input'>",
      ):
          proto_parameter.type_check("proto_parameter", 42)
      with self.assertRaises(json_format.ParseError):
          proto_parameter.type_check("proto_parameter", {"splits": 42})
  
      output_channel = channel.Channel(type=_OutputArtifact)
  
      placeholder_parameter = ExecutionParameter(type=str)
      placeholder_parameter.type_check(
          "wrapped_channel_placeholder_parameter",
          output_channel.future()[0].value,
      )
      placeholder_parameter.type_check(
          "placeholder_parameter",
          placeholder.runtime_info("platform_config").base_dir,
      )
  
imports: import json
  import sys
  from typing import Dict, List
  import unittest
  import tensorflow
  from tfx.dsl.placeholder import placeholder
  from tfx.proto import example_gen_pb2
  from tfx.types import artifact
  from tfx.types import channel
  from tfx.types import component_spec
  from tfx.types.component_spec import ChannelParameter
  from tfx.types.component_spec import ComponentSpec
  from tfx.types.component_spec import ExecutionParameter
  from tfx.types.standard_artifacts import Examples
  from tfx.utils import proto_utils
  from google.protobuf import json_format
  from google.protobuf import text_format
label_desc: Use image node_id 14 for calling the ComponentSpecTest obj's underlying member method code with example usage: obj.testExecutionParameterTypeCheck() without return types