code: def sort_artifact_dict(
      artifacts_by_key: Dict[str, List[types.Artifact]]
  ) -> Dict[str, List[types.Artifact]]:
      """Sorts the artifact dict values by (creation time, id)."""
      for key, artifacts in artifacts_by_key.items():
          artifacts_by_key[key] = sorted(
              artifacts,
              # If the user wants to sort Examples artifacts by span/version, they
              # can call the all_spans(...) canned resolver functions.
              key=lambda a: (
                  a.mlmd_artifact.create_time_since_epoch,
                  a.id,
              ),
          )
      return artifacts_by_key
  
file_path: tfx/tfx/dsl/input_resolution/ops/ops_utils.py
imports: from typing import Dict, List, Optional, Sequence, Set
  from tfx import types
  from tfx.orchestration.portable.input_resolution import exceptions
  from tfx.orchestration.portable.mlmd import filter_query_builder
  from tfx.utils import typing_utils
  from ml_metadata.proto import metadata_store_pb2
label_desc: Use image node_id 6 for calling a global function with example usage: sort_artifact_dict(artifacts_by_key) and returns: artifacts_by_key