code: def _ensure_sync_pipeline(pipeline: pipeline_pb2.Pipeline):
      """Raises ValueError if the pipeline's execution_mode is not SYNC."""
      if pipeline.execution_mode != pipeline_pb2.Pipeline.SYNC:
          raise ValueError(
              "Pipeline filtering is only supported for SYNC execution modes; "
              "found pipeline with execution mode: "
              f"{pipeline_pb2.Pipeline.ExecutionMode.Name(pipeline.execution_mode)}"
          )
  
imports: import collections
  import concurrent.futures
  import enum
  from typing import Collection, Dict, Final, List, Mapping, Optional, OrderedDict, Sequence, Set, Tuple
  import uuid
  from absl import logging
  from tfx.dsl.compiler import compiler_utils
  from tfx.dsl.compiler import constants
  from tfx.orchestration import metadata
  from tfx.orchestration import node_proto_view
  from tfx.orchestration.portable import execution_publish_utils
  from tfx.orchestration.portable.mlmd import context_lib
  from tfx.orchestration.portable.mlmd import execution_lib
  from tfx.proto.orchestration import pipeline_pb2
  from ml_metadata.proto import metadata_store_pb2
label_desc: Use image node_id 8 for calling a global function with example usage: _ensure_sync_pipeline(pipeline) without return types