code: def deserialize_artifacts(
      artifact_type: metadata_store_pb2.ArtifactType,
      artifacts: List[metadata_store_pb2.Artifact],
  ) -> List[Artifact]:
      """Reconstructs Artifact objects from MLMD proto descriptors.
  
      Internal method, no backwards compatibility guarantees.
  
      Args:
        artifact_type: A metadata_store_pb2.ArtifactType proto object describing the
          type of the artifact.
        artifacts: List of metadata_store_pb2.Artifact proto describing the contents
          of the artifact.
  
      Returns:
        Artifact subclass object for the given MLMD proto descriptors.
      """
      # Validate inputs.
      if not isinstance(artifact_type, metadata_store_pb2.ArtifactType):
          raise ValueError(
              "Expected metadata_store_pb2.ArtifactType for artifact_type, got "
              f"{artifact_type} instead"
          )
      for artifact in artifacts:
          if not isinstance(artifact, metadata_store_pb2.Artifact):
              raise ValueError(
                  f"Expected metadata_store_pb2.Artifact for artifact, got {artifact} "
                  "instead"
              )
  
      # Get the artifact's class and construct the Artifact object.
      artifact_cls = get_artifact_type_class(artifact_type)
      result = []
      for artifact in artifacts:
          item = artifact_cls()
          item.artifact_type.CopyFrom(artifact_type)
          item.set_mlmd_artifact(artifact)
          result.append(item)
      return result
  
file_path: tfx/tfx/types/artifact_utils.py
imports: import itertools
  import json
  import os
  from typing import Dict, List, Optional, Type, Union
  from absl import logging
  from tfx.dsl.io import fileio
  from tfx.types import artifact
  from tfx.types import standard_artifact_utils
  from tfx.types import value_artifact
  from ml_metadata.proto import metadata_store_pb2
label_desc: Use image node_id 9 for calling a global function with example usage: deserialize_artifacts(artifact_type, artifacts) and returns: result