code: def _resolve_static_inputs(
      mlmd_handle: metadata.Metadata,
      static_inputs: pipeline_pb2.InputSpec.Static,
  ):
      """Resolves an InputSpec.Static."""
      # artifact_ids can be empty, in which case the result looks: {'result': []}
      if not static_inputs.artifact_ids:
          return []
  
      artifacts = mlmd_handle.store.get_artifacts_by_id(
          static_inputs.artifact_ids
      )
      artifacts_by_id = {a.id: a for a in artifacts}
      if len(artifacts_by_id) != len(set(static_inputs.artifact_ids)):
          # If artifact ID does not exist, MetadataStore.get_artifacts_by_id does not
          # raises an error but silently excludes them from the result. Still this is
          # an error in our case.
          not_found = set(static_inputs.artifact_ids).difference(
              artifacts_by_id
          )
          raise exceptions.InvalidArgument(
              f"InputSpec.Static.artifact_ids {static_inputs.artifact_ids} contains "
              f"non-existing artifact IDs: {not_found}"
          )
  
      type_ids = {a.type_id for a in artifacts}
      artifact_types = mlmd_handle.store.get_artifact_types_by_id(
          list(type_ids)
      )
      if len(artifact_types) != 1:
          artifact_ids_by_type = {
              t.name: [a.id for a in artifacts if a.type_id == t.id]
              for t in artifact_types
          }
          raise exceptions.FailedPreconditionError(
              "InputSpec.Static should contain the homogeneous artifact type but got "
              f"multiple: {artifact_ids_by_type}"
          )
  
      ordered_artifacts = [
          artifacts_by_id[i] for i in static_inputs.artifact_ids
      ]
      result = artifact_utils.deserialize_artifacts(
          artifact_types[0], ordered_artifacts
      )
      for resolved_artifact in result:
          if governance_utils.is_expired(resolved_artifact):
              raise exceptions.InvalidArgument(
                  f"Static inputs {static_inputs} contains expired artifact:\n"
                  f"{resolved_artifact}"
              )
      return result
  
imports: import collections
  from typing import Dict, Iterable, List, Mapping, Sequence, Tuple, TypeVar
  from tfx import types
  from tfx.dsl.compiler import placeholder_utils
  from tfx.orchestration import metadata
  from tfx.orchestration import mlmd_connection_manager
  from tfx.orchestration.portable import data_types
  from tfx.orchestration.portable.input_resolution import exceptions
  from tfx.orchestration.portable.input_resolution import input_graph_resolver
  from tfx.orchestration.portable.input_resolution import partition_utils
  from tfx.orchestration.portable.input_resolution import channel_resolver
  from tfx.proto.orchestration import pipeline_pb2
  from tfx.types import artifact_utils
  from tfx.utils import topsort
  from tfx.utils import typing_utils
  from tfx.utils import governance_utils
label_desc: Use image node_id 9 for calling a global function with example usage: _resolve_static_inputs(mlmd_handle, static_inputs) and returns: result, list