code: def testJoinArtifacts(self):
      def check(entries_map, input_keys, expected):
          result = node_inputs_resolver._join_artifacts(
              entries_map, input_keys
          )
          self.assertEqual(result, expected)
  
      a1, a2, b1, b2, c1, c2, d1, d2, d3, d4, e1, e2 = [
          mock.MagicMock() for _ in range(12)
      ]
  
      entries_map = {
          "a": [
              (partition(x=1), [a1]),
              (partition(x=2), [a2]),
          ],
          "b": [(partition(x=1), [b1]), (partition(x=2), [b2])],
          "c": [(partition(), [c1, c2])],
          "d": [
              (partition(x=1, y=1), [d1]),
              (partition(x=1, y=2), [d2]),
              (partition(x=2, y=1), [d3]),
              (partition(x=2, y=2), [d4]),
          ],
          "e": [
              (partition(z=1), [e1]),
              (partition(z=2), [e2]),
          ],
      }
  
      check(
          entries_map,
          input_keys=["a", "b"],
          expected=[
              (partition(x=1), {"a": [a1], "b": [b1]}),
              (partition(x=2), {"a": [a2], "b": [b2]}),
          ],
      )
  
      check(
          entries_map,
          input_keys=["a", "c"],
          expected=[
              (partition(x=1), {"a": [a1], "c": [c1, c2]}),
              (partition(x=2), {"a": [a2], "c": [c1, c2]}),
          ],
      )
  
      check(
          entries_map,
          input_keys=["a", "b", "d"],
          expected=[
              (partition(x=1, y=1), {"a": [a1], "b": [b1], "d": [d1]}),
              (partition(x=1, y=2), {"a": [a1], "b": [b1], "d": [d2]}),
              (partition(x=2, y=1), {"a": [a2], "b": [b2], "d": [d3]}),
              (partition(x=2, y=2), {"a": [a2], "b": [b2], "d": [d4]}),
          ],
      )
  
      check(
          entries_map,
          input_keys=["a", "e"],
          expected=[
              (partition(x=1, z=1), {"a": [a1], "e": [e1]}),
              (partition(x=1, z=2), {"a": [a1], "e": [e2]}),
              (partition(x=2, z=1), {"a": [a2], "e": [e1]}),
              (partition(x=2, z=2), {"a": [a2], "e": [e2]}),
          ],
      )
  
      # pylint: disable=line-too-long
      check(
          entries_map,
          input_keys=["a", "b", "c", "d", "e"],
          expected=[
              (
                  partition(x=1, y=1, z=1),
                  {
                      "a": [a1],
                      "b": [b1],
                      "c": [c1, c2],
                      "d": [d1],
                      "e": [e1],
                  },
              ),
              (
                  partition(x=1, y=1, z=2),
                  {
                      "a": [a1],
                      "b": [b1],
                      "c": [c1, c2],
                      "d": [d1],
                      "e": [e2],
                  },
              ),
              (
                  partition(x=1, y=2, z=1),
                  {
                      "a": [a1],
                      "b": [b1],
                      "c": [c1, c2],
                      "d": [d2],
                      "e": [e1],
                  },
              ),
              (
                  partition(x=1, y=2, z=2),
                  {
                      "a": [a1],
                      "b": [b1],
                      "c": [c1, c2],
                      "d": [d2],
                      "e": [e2],
                  },
              ),
              (
                  partition(x=2, y=1, z=1),
                  {
                      "a": [a2],
                      "b": [b2],
                      "c": [c1, c2],
                      "d": [d3],
                      "e": [e1],
                  },
              ),
              (
                  partition(x=2, y=1, z=2),
                  {
                      "a": [a2],
                      "b": [b2],
                      "c": [c1, c2],
                      "d": [d3],
                      "e": [e2],
                  },
              ),
              (
                  partition(x=2, y=2, z=1),
                  {
                      "a": [a2],
                      "b": [b2],
                      "c": [c1, c2],
                      "d": [d4],
                      "e": [e1],
                  },
              ),
              (
                  partition(x=2, y=2, z=2),
                  {
                      "a": [a2],
                      "b": [b2],
                      "c": [c1, c2],
                      "d": [d4],
                      "e": [e2],
                  },
              ),
          ],
      )
  
imports: from typing import Set
  from unittest import mock
  import tensorflow
  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 node_inputs_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
  import tfx.types
  from tfx.types import channel_utils
  from tfx.utils import test_case_utils
  from google.protobuf import text_format
label_desc: Use image node_id 5 for calling the ProtectedFunctionTest obj's underlying member method code with example usage: obj.testJoinArtifacts() without return types