code: def testGraphTraversal_TraverseUpstream(self):
      # Tests artifacts 2 hops away.
      result = self._graph_traversal(
          self.model,
          traverse_upstream=True,
          artifact_type_names=["TransformGraph", "Examples"],
      )
      self.assertArtifactMapsEqual(
          result,
          {
              "root_artifact": [self.model],
              "Examples": self.examples,
              "TransformGraph": [self.transform_graph],
          },
      )
  
      # "model_blessing" should have no artifacts in the result dictionary,
      # because there is no path from ModelBlessing --> ModelPush.
      result = self._graph_traversal(
          self.model_push,
          traverse_upstream=True,
          artifact_type_names=[
              "Examples",
              "TransformGraph",
              "Model",
              "ModelBlessing",
          ],
      )
      self.assertArtifactMapsEqual(
          result,
          {
              "root_artifact": [self.model_push],
              "Examples": self.examples,
              "TransformGraph": [self.transform_graph],
              "Model": [self.model],
              "ModelBlessing": [],
          },
      )
  
      result = self._graph_traversal(
          self.model,
          traverse_upstream=True,
          artifact_type_names=[
              "TransformGraph",
              "FakeArtifactTypeName",
          ],
      )
      self.assertArtifactMapsEqual(
          result,
          {
              "root_artifact": [self.model],
              "TransformGraph": [self.transform_graph],
              "FakeArtifactTypeName": [],
          },
      )
  
file_path: tfx/tfx/dsl/input_resolution/ops/graph_traversal_op_test.py
imports: from typing import Sequence
  import tensorflow
  from tfx import types
  from tfx.dsl.input_resolution.ops import ops
  from tfx.dsl.input_resolution.ops import test_utils
label_desc: Use image node_id 7 for calling the GraphTraversalOpTest obj's underlying member method code with example usage: obj.testGraphTraversal_TraverseUpstream() without return types