code: def get_payload_format(examples: types.Artifact) -> int:
      """Returns the payload format of Examples artifact.
  
      If Examples artifact does not contain the "payload_format" custom property,
      it is made before tfx supports multiple payload format, and can regard as
      tf.Example format.
  
      Args:
        examples: A standard_artifacts.Examples artifact.
  
      Returns:
        payload_format: One of the enums in example_gen_pb2.PayloadFormat.
      """
      assert (
          examples.type_name == standard_artifacts.Examples.TYPE_NAME
      ), "examples must be of type standard_artifacts.Examples"
      if examples.has_custom_property(
          example_gen_utils.PAYLOAD_FORMAT_PROPERTY_NAME
      ):
          return example_gen_pb2.PayloadFormat.Value(
              examples.get_string_custom_property(
                  example_gen_utils.PAYLOAD_FORMAT_PROPERTY_NAME
              )
          )
      else:
          logging.warning(
              "Examples artifact does not have %s custom property. "
              "Falling back to %s",
              example_gen_utils.PAYLOAD_FORMAT_PROPERTY_NAME,
              example_gen_pb2.PayloadFormat.Name(
                  _DEFAULT_PAYLOAD_FORMAT
              ),
          )
          return _DEFAULT_PAYLOAD_FORMAT
  
file_path: tfx/tfx/components/util/examples_utils.py
imports: import json
  import os
  from typing import Dict, List, Optional, Tuple
  from absl import logging
  from tfx import types
  from tfx.components.example_gen import utils
  from tfx.proto import example_gen_pb2
  from tfx.types import artifact_utils
  from tfx.types import standard_artifacts
  from tfx.utils import io_utils
label_desc: Use image node_id 1 for calling a global function with example usage: get_payload_format(examples) and returns: example_gen_pb2, _DEFAULT_PAYLOAD_FORMAT