code: def _resolve_mixed_inputs(
      node_inputs: pipeline_pb2.NodeInputs,
      input_key: str,
      resolved: Dict[str, List[_Entry]],
  ) -> None:
      """Resolves an InputSpec.Mixed."""
  
      def identifier(artifact: types.Artifact):
          if artifact.id:
              return artifact.id
          else:
              # If the artifact is a cold-imported external artifact, its id and type_id
              # is reset. We shall use external_id then.
              return artifact.mlmd_artifact.external_id
  
      mixed_inputs = node_inputs.inputs[input_key].mixed_inputs
      result = []
      for partition, input_dict in _join_artifacts(
          resolved, mixed_inputs.input_keys
      ):
          if (
              mixed_inputs.method
              == pipeline_pb2.InputSpec.Mixed.Method.UNION
          ):
              artifacts_by_id = {}
              for sub_key in mixed_inputs.input_keys:
                  artifacts_by_id.update(
                      {
                          identifier(artifact): artifact
                          for artifact in input_dict[sub_key]
                      }
                  )
              artifacts = list(artifacts_by_id.values())
              result.append((partition, artifacts))
  
      resolved[input_key] = 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 8 for calling a global function with example usage: _resolve_mixed_inputs(node_inputs, input_key, resolved) and returns: artifact, artifact