code: def testLatestVersion_SameSpan(self):
      a1 = test_utils.DummyArtifact()
      a2 = test_utils.DummyArtifact()
      a3 = test_utils.DummyArtifact()
      a4 = ArtifactWithoutVersion()
  
      a1.id = 1
      a2.id = 2
      a3.id = 3
  
      a1.version = 1
      a2.version = 2
      a3.version = 2
  
      artifacts = [a1, a3, a2, a4]
  
      actual = self._latest_version(artifacts)
      self.assertEqual(actual, [a3])
  
      actual = self._latest_version(artifacts, n=2)
      self.assertEqual(actual, [a2, a3])
  
      actual = self._latest_version(artifacts, n=3)
      self.assertEqual(actual, [a1, a2, a3])
  
      # Although n = 4, only 3 artifacts are returned because only 3 are
      # available.
      actual = self._latest_version(artifacts, n=4)
      self.assertEqual(actual, [a1, a2, a3])
  
file_path: tfx/tfx/dsl/input_resolution/ops/latest_version_op_test.py
imports: 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 4 for calling the LatestVersionOpTest obj's underlying member method code with example usage: obj.testLatestVersion_SameSpan() without return types