code: def build_artifact_dict(
      proto_dict: Mapping[
          str, metadata_store_service_pb2.ArtifactStructList
      ]
  ) -> Dict[str, List[types.Artifact]]:
      """Converts input/output artifact dict."""
      result = {}
      for k, v in proto_dict.items():
          result[k] = []
          for artifact_struct in v.elements:
              if not artifact_struct.HasField("artifact"):
                  raise RuntimeError(
                      "Only support artifact oneof field"
                  )
              artifact_and_type = artifact_struct.artifact
              result[k].append(
                  artifact_utils.deserialize_artifact(
                      artifact_and_type.type, artifact_and_type.artifact
                  )
              )
      return result
  
imports: from typing import Dict, Iterable, List, Mapping, Optional
  from tfx import types
  from tfx.proto.orchestration import execution_result_pb2
  from tfx.proto.orchestration import pipeline_pb2
  from tfx.types import artifact_utils
  from tfx.utils import json_utils
  from tfx.utils import proto_utils
  from google.protobuf import message
  from ml_metadata.proto import metadata_store_pb2
  from ml_metadata.proto import metadata_store_service_pb2
label_desc: Use image node_id 1 for calling a global function with example usage: build_artifact_dict(proto_dict) and returns: result