code: def get_file_format(examples: types.Artifact) -> str:
      """Returns the file format of Examples artifact.
  
      If Examples artifact does not contain the "file_format" custom property,
      it is made by OSS ExampleGen and can be treated as 'tfrecords_gzip' format.
  
      Args:
        examples: A standard_artifacts.Examples artifact.
  
      Returns:
        One of the file format that tfx_bsl understands.
      """
      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.FILE_FORMAT_PROPERTY_NAME
      ):
          return examples.get_string_custom_property(
              example_gen_utils.FILE_FORMAT_PROPERTY_NAME
          )
      else:
          return _DEFAULT_FILE_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 4 for calling a global function with example usage: get_file_format(examples) and returns: examples, _DEFAULT_FILE_FORMAT