code: def run_executor(
      executable_spec: Union[
          executable_spec_pb2.PythonClassExecutableSpec,
          executable_spec_pb2.BeamExecutableSpec,
      ],
      execution_info: data_types.ExecutionInfo,
  ) -> execution_result_pb2.ExecutorOutput:
      """Run python or Beam executor operator."""
      if isinstance(
          executable_spec, executable_spec_pb2.BeamExecutableSpec
      ):
          operator = beam_executor_operator.BeamExecutorOperator(
              executable_spec
          )
      else:
          operator = python_executor_operator.PythonExecutorOperator(
              executable_spec
          )
      return operator.run_executor(execution_info)
  
imports: from typing import Union
  from tfx.orchestration.portable import beam_executor_operator
  from tfx.orchestration.portable import data_types
  from tfx.orchestration.portable import python_executor_operator
  from tfx.proto.orchestration import executable_spec_pb2
  from tfx.proto.orchestration import execution_result_pb2
label_desc: Use image node_id 1 for calling a global function with example usage: run_executor(executable_spec, execution_info) and returns: operator