code: def _convert_function_to_python_executable_spec(
      fn: Optional[Callable[..., Any]] = None
  ) -> Optional[executable_spec_pb2.PythonClassExecutableSpec]:
      """Validates and converts execution function to PythonClassExecutableSpec."""
      if fn is None:
          return None
      utils.assert_is_top_level_func(fn)
      function_path = name_utils.get_full_name(fn, strict_check=True)
      return executable_spec_pb2.PythonClassExecutableSpec(
          class_path=function_path
      )
  
file_path: tfx/tfx/dsl/component/experimental/component_utils.py
imports: import inspect
  from typing import Any, Callable, Mapping, Optional, Type
  from tfx import types
  from tfx.dsl.component.experimental import utils
  from tfx.dsl.components.base import base_component
  from tfx.dsl.components.base import executor_spec
  from tfx.orchestration.portable.execution import context
  from tfx.proto.orchestration import executable_spec_pb2
  from tfx.types import component_spec
  from tfx.types.system_executions import SystemExecution
  from tfx.utils import name_utils
label_desc: Use image node_id 1 for calling a global function with example usage: _convert_function_to_python_executable_spec(fn) and returns: executable_spec_pb2, None