code: def update_output_artifact(
      exec_properties: Dict[str, Any],
      output_artifact: metadata_store_pb2.Artifact,
  ) -> None:
      """Updates output_artifact for FileBasedExampleGen.
  
      Updates output_artifact properties by updating existing entries or creating
      new entries if not already exists.
  
      Args:
        exec_properties: execution properties passed to the example gen.
        output_artifact: the example artifact to be output.
      """
      if exec_properties.get(utils.FINGERPRINT_PROPERTY_NAME):
          output_artifact.custom_properties[
              utils.FINGERPRINT_PROPERTY_NAME
          ].string_value = exec_properties[
              utils.FINGERPRINT_PROPERTY_NAME
          ]
      output_artifact.custom_properties[
          utils.SPAN_PROPERTY_NAME
      ].int_value = exec_properties[utils.SPAN_PROPERTY_NAME]
      # TODO(b/162622803): add default behavior for when version spec not present.
      if exec_properties[utils.VERSION_PROPERTY_NAME] is not None:
          output_artifact.custom_properties[
              utils.VERSION_PROPERTY_NAME
          ].int_value = exec_properties[utils.VERSION_PROPERTY_NAME]
  
imports: import copy
  import os
  from typing import Any, Dict, List, Iterable, Optional
  from absl import logging
  from tfx import types
  from tfx.components.example_gen import input_processor
  from tfx.components.example_gen import utils
  from tfx.dsl.components.base import base_driver
  from tfx.orchestration import data_types
  from tfx.orchestration import data_types_utils
  from tfx.orchestration import metadata
  from tfx.orchestration.portable import base_driver
  from tfx.orchestration.portable import data_types
  from tfx.proto import example_gen_pb2
  from tfx.proto import range_config_pb2
  from tfx.proto.orchestration import driver_output_pb2
  from tfx.types import standard_component_specs
  from tfx.utils import proto_utils
  from ml_metadata.proto import metadata_store_pb2
label_desc: Use image node_id 1 for calling a global function with example usage: update_output_artifact(exec_properties, output_artifact) without return types