code: def build_artifact_struct_dict(
      artifact_dict: Mapping[str, Iterable[types.Artifact]]
  ) -> Dict[str, metadata_store_service_pb2.ArtifactStructList]:
      """Converts input/output artifact dict."""
      result = {}
      if not artifact_dict:
          return result
      for k, v in artifact_dict.items():
          artifact_list = (
              metadata_store_service_pb2.ArtifactStructList()
          )
          for artifact in v:
              artifact_struct = metadata_store_service_pb2.ArtifactStruct(
                  artifact=metadata_store_service_pb2.ArtifactAndType(
                      artifact=artifact.mlmd_artifact,
                      type=artifact.artifact_type,
                  )
              )
              artifact_list.elements.append(artifact_struct)
          result[k] = artifact_list
      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 3 for calling a global function with example usage: build_artifact_struct_dict(artifact_dict) and returns: result, result