code: def _WriteExamples(
      prediction_log: beam.pvalue.PCollection,
      output_example_spec: bulk_inferrer_pb2.OutputExampleSpec,
      output_path: str,
  ) -> beam.pvalue.PDone:
      """Converts `prediction_log` to `tf.train.Example` and materializes."""
      return (
          prediction_log
          | "ConvertToExamples"
          >> beam.Map(
              prediction_to_example_utils.convert,
              output_example_spec=output_example_spec,
          )
          | "WriteExamples"
          >> beam.io.WriteToTFRecord(
              os.path.join(output_path, _EXAMPLES_FILE_NAME),
              file_name_suffix=".gz",
              coder=beam.coders.ProtoCoder(tf.train.Example),
          )
      )
  
imports: import importlib
  import os
  from typing import Any, Callable, Dict, List, Optional, Union
  from absl import logging
  import apache_beam
  import tensorflow
  from tfx import types
  from tfx.components.bulk_inferrer import prediction_to_example_utils
  from tfx.components.util import model_utils
  from tfx.components.util import tfxio_utils
  from tfx.dsl.components.base import base_beam_executor
  from tfx.proto import bulk_inferrer_pb2
  from tfx.proto import example_gen_pb2
  from tfx.types import artifact_utils
  from tfx.types import standard_component_specs
  from tfx.utils import io_utils
  from tfx.utils import path_utils
  from tfx.utils import proto_utils
  from tfx_bsl.public.beam import run_inference
  from tfx_bsl.public.proto import model_spec_pb2
  from tfx_bsl.tfxio import record_based_tfxio
  from tensorflow_serving.apis import prediction_log_pb2
label_desc: Use image node_id 3 for calling a global function with example usage: _WriteExamples(prediction_log, output_example_spec, output_path) and returns: unknown