code: def create_component_class(
      func: types.FunctionType,
      arg_defaults: Dict[str, Any],
      arg_formats: Dict[str, ArgFormats],
      base_executor_class: Type[base_executor.BaseExecutor],
      executor_spec_class: Type[executor_spec.ExecutorClassSpec],
      base_component_class: Type[base_component.BaseComponent],
      inputs: Optional[Dict[str, Type[artifact.Artifact]]] = None,
      outputs: Optional[Dict[str, Type[artifact.Artifact]]] = None,
      parameters: Optional[Dict[str, Any]] = None,
      type_annotation: Optional[
          Type[system_executions.SystemExecution]
      ] = None,
      json_compatible_inputs: Optional[Dict[str, Any]] = None,
      json_compatible_outputs: Optional[Dict[str, Any]] = None,
      return_values_optionality: Optional[Dict[str, bool]] = None,
  ) -> Type[base_component.BaseComponent]:
      """Creates the component class for the func-generated component.
  
      Args:
        func: The function which the component class will be generated based on.
        arg_defaults: A dict from func arg name to its default value.
        arg_formats: An updated dict from arg name to its format. The format is the
          value of `ArgFormats` enum). Note that the parameter arg will be added to
          the dict if it's in the valid format and existing entries won't be
          changed.
        base_executor_class: base class of the generated executor class.
        executor_spec_class: class of the generated executor spec instance.
        base_component_class: The base class of the generated component class.
        inputs: A dict from input name to its Artifact type.
        outputs: A dict from output name to its Artifact type.
        parameters: A dict from parameter name to its primitive type.
        type_annotation: a subclass to SystemExecution used to annotate the
          component on ComponentSpec.
        json_compatible_inputs: A dict from input names that have json compatible
          types to their typehints. Json compatibility is determined by
          `tfx.dsl.component.experimental.json_compat.is_json_compatible`.
        json_compatible_outputs: A dict from output names that have json compatible
          types to their typehints. Json compatibility is determined by
          `tfx.dsl.component.experimental.json_compat.is_json_compatible`.
        return_values_optionality: A dict from output names that are primitive type
          values returned from the user function to whether they are `Optional`.
  
      Returns:
        a subclass of `base_component_class`.
      """
  
      component_spec_class = _create_component_spec_class(
          func,
          arg_defaults,
          inputs,
          outputs,
          parameters,
          type_annotation,
          json_compatible_inputs,
          json_compatible_outputs,
      )
  
      executor_spec_instance = _create_executor_spec_instance(
          func,
          base_executor_class,
          executor_spec_class,
          arg_formats,
          arg_defaults,
          return_values_optionality,
          json_compatible_outputs,
      )
  
      return type(
          func.__name__,
          (base_component_class,),
          {
              "SPEC_CLASS": component_spec_class,
              "EXECUTOR_SPEC": executor_spec_instance,
              "__module__": func.__module__,
              "test_call": staticmethod(
                  func
              ),  # pytype: disable=not-callable
          },
      )
  
imports: import enum
  import inspect
  import sys
  import types
  from typing import Any, Dict, Optional, Type
  from tfx import types
  from tfx.dsl.components.base import base_component
  from tfx.dsl.components.base import base_executor
  from tfx.dsl.components.base import executor_spec
  from tfx.types import artifact
  from tfx.types import component_spec
  from tfx.types import system_executions
label_desc: Use image node_id 8 for calling a global function with example usage: create_component_class(func, arg_defaults, arg_formats, base_executor_class, executor_spec_class, base_component_class, inputs, outputs, parameters, type_annotation, json_compatible_inputs, json_compatible_outputs, return_values_optionality) and returns: type