code: def exit_handler(func: types.FunctionType) -> Callable[..., Any]:
      """Creates an exit handler from a typehint-annotated Python function.
  
      This decorator creates an exit handler wrapping the component typehint
      annotation - typehint annotations specified for the arguments and return value
      for a Python function.
      Exit handler is to annotate the component for post actions of a pipeline,
      only supported in Vertex AI. Specifically, function
      arguments can be annotated with the following types and associated semantics
      supported in component. In order to get in the final status of dependent
      pipeline, parameter should be defined as Parameter[str], passing in
      FinalStatusStr type when initializing the component.
  
      This is example usage of component definition using this decorator:
      ```
        from tfx import v1 as tfx
  
        @tfx.orchestration.experimental.exit_handler
        def MyExitHandlerComponent(final_status: tfx.dsl.components.Parameter[str]):
          # parse the final status
          pipeline_task_status = pipeline_pb2.PipelineTaskFinalStatus()
          proto_utils.json_to_proto(final_status, pipeline_task_status)
          print(pipeline_task_status)
      ```
  
      Example usage in a Vertex AI graph definition:
      ```
        exit_handler = exit_handler_component(
        final_status=tfx.dsl.experimental.FinalStatusStr())
  
        dsl_pipeline = tfx.dsl.Pipeline(...)
  
        runner = tfx.orchestration.experimental.KubeflowV2DagRunner(...)
        runner.set_exit_handler([exit_handler])
        runner.run(pipeline=dsl_pipeline)
      ```
      Experimental: no backwards compatibility guarantees.
  
      Args:
        func: Typehint-annotated component executor function.
  
      Returns:
        `base_component.BaseComponent` subclass for the given component executor
        function.
      """
      return component(func)
  
imports: import types
  from typing import Any, Callable
  from tfx.dsl.component.experimental.decorators import component
label_desc: Use image node_id 1 for calling a global function with example usage: exit_handler(func) and returns: component