code: def test_create_component_class(self):
      # pytype: disable=invalid-annotation
      def func(
          primitive_bool_input: bool,
          artifact_int_input: annotations.InputArtifact[
              standard_artifacts.Integer
          ],
          artifact_examples_output: annotations.OutputArtifact[
              standard_artifacts.Examples
          ],
          int_param: annotations.Parameter[int],
          json_compat_param: annotations.Parameter[Dict[str, int]],
          str_param: annotations.Parameter[str] = "foo",
      ) -> annotations.OutputDict(
          str_output=str,
          str_list_output=List[str],
          map_str_float_output=Dict[str, float],
      ):
          pass
  
      # pytype: enable=invalid-annotation
  
      (
          inputs,
          outputs,
          parameters,
          arg_formats,
          arg_defaults,
          returned_values,
          json_typehints,
          return_json_typehints,
      ) = function_parser.parse_typehint_component_function(func)
      type_annotation = system_executions.Process
      base_executor_class = decorators._FunctionExecutor
      executor_spec_class = executor_spec.ExecutorClassSpec
      base_component_class = decorators._SimpleComponent
      actual_component_class = utils.create_component_class(
          func=func,
          arg_defaults=arg_defaults,
          arg_formats=arg_formats,
          base_executor_class=base_executor_class,
          executor_spec_class=executor_spec_class,
          base_component_class=base_component_class,
          inputs=inputs,
          outputs=outputs,
          parameters=parameters,
          type_annotation=type_annotation,
          json_compatible_inputs=json_typehints,
          json_compatible_outputs=return_json_typehints,
          return_values_optionality=returned_values,
      )
  
      actual_spec_class = actual_component_class.SPEC_CLASS
      spec_inputs = actual_spec_class.INPUTS
      self.assertLen(spec_inputs, 2)
      self.assertEqual(
          spec_inputs["primitive_bool_input"].type,
          standard_artifacts.Boolean,
      )
      self.assertEqual(
          spec_inputs["artifact_int_input"].type,
          standard_artifacts.Integer,
      )
      spec_outputs = actual_spec_class.OUTPUTS
      self.assertLen(spec_outputs, 4)
      self.assertEqual(
          spec_outputs["artifact_examples_output"].type,
          standard_artifacts.Examples,
      )
      self.assertEqual(
          spec_outputs["str_output"].type, standard_artifacts.String
      )
      self.assertEqual(
          spec_outputs["str_list_output"].type,
          standard_artifacts.JsonValue,
      )
      self.assertEqual(
          spec_outputs["map_str_float_output"].type,
          standard_artifacts.JsonValue,
      )
      spec_parameter = actual_spec_class.PARAMETERS
      self.assertLen(spec_parameter, 3)
      self.assertEqual(spec_parameter["int_param"].type, int)
      self.assertEqual(spec_parameter["int_param"].optional, False)
      self.assertEqual(spec_parameter["str_param"].type, str)
      self.assertEqual(spec_parameter["str_param"].optional, True)
      self.assertEqual(
          spec_parameter["json_compat_param"].type, Dict[str, int]
      )
      self.assertEqual(
          spec_parameter["json_compat_param"].optional, False
      )
      self.assertEqual(
          actual_spec_class.TYPE_ANNOTATION, type_annotation
      )
  
      self.assertIsInstance(
          actual_component_class.EXECUTOR_SPEC, executor_spec_class
      )
      executor_class = (
          actual_component_class.EXECUTOR_SPEC.executor_class
      )
      self.assertEqual(executor_class._ARG_FORMATS, arg_formats)
      self.assertEqual(executor_class._ARG_DEFAULTS, arg_defaults)
      self.assertEqual(executor_class._FUNCTION, func)
      self.assertEqual(executor_class._RETURNED_VALUES, returned_values)
      self.assertEqual(
          executor_class._RETURN_JSON_COMPAT_TYPEHINT,
          return_json_typehints,
      )
      self.assertEqual(executor_class.__module__, func.__module__)
      self.assertIsInstance(executor_class, type(base_executor_class))
  
      self.assertIsInstance(
          actual_component_class, type(base_component_class)
      )
      self.assertEqual(
          actual_component_class.__module__, func.__module__
      )
      self.assertEqual(actual_component_class.test_call, func)
  
imports: import copy
  import inspect
  from typing import Dict, List
  import tensorflow
  from tfx.dsl.component.experimental import annotations
  from tfx.dsl.component.experimental import decorators
  from tfx.dsl.component.experimental import function_parser
  from tfx.dsl.component.experimental import utils
  from tfx.dsl.components.base import executor_spec
  from tfx.types import standard_artifacts
  from tfx.types import system_executions
label_desc: Use image node_id 10 for calling the UtilsTest obj's underlying member method code with example usage: obj.test_create_component_class() without return types