code: def create_pipeline_with_foreach() -> pipeline_pb2.Pipeline:
      """Builds a test pipeline with ForEach."""
      # pylint: disable=no-value-for-parameter
      example_gen = _example_gen().with_id("my_example_gen")
      with ForEach(example_gen.outputs["examples"]) as examples:
          stats_gen = _statistics_gen(examples=examples).with_id(
              "my_statistics_gen_in_foreach"
          )
  
      pipeline = pipeline_lib.Pipeline(
          pipeline_name="my_pipeline",
          pipeline_root="/path/to/root",
          components=[
              example_gen,
              stats_gen,
          ],
          enable_cache=True,
      )
      dsl_compiler = compiler.Compiler()
      return dsl_compiler.compile(pipeline)
  
imports: from tfx.dsl.compiler import compiler
  from tfx.dsl.component.experimental.annotations import InputArtifact
  from tfx.dsl.component.experimental.annotations import OutputArtifact
  from tfx.dsl.component.experimental.decorators import component
  from tfx.dsl.control_flow.for_each import ForEach
  from tfx.dsl.experimental.conditionals import conditional
  from tfx.dsl.experimental.node_execution_options import utils
  from tfx.orchestration import pipeline
  from tfx.proto.orchestration import pipeline_pb2
  from tfx.types import standard_artifacts
label_desc: Use image node_id 10 for calling a global function with example usage: create_pipeline_with_foreach() and returns: dsl_compiler