code: def testLatestVersion_DifferentSpans(self):
      a10 = test_utils.DummyArtifact()
      a11 = test_utils.DummyArtifact()
      a20 = test_utils.DummyArtifact()
      a21 = test_utils.DummyArtifact()
  
      a10.span = 1
      a11.span = 1
      a20.span = 2
      a21.span = 2
  
      a10.version = 0
      a11.version = 1
      a20.version = 0
      a21.version = 1
  
      artifacts = [a10, a20, a21, a11]
  
      actual = self._latest_version(artifacts)
      self.assertEqual(actual, [a21])
  
      actual = self._latest_version(artifacts, n=2)
      self.assertEqual(actual, [a20, a21])
  
      actual = self._latest_version(artifacts, n=3)
      self.assertEqual(actual, [a11, a20, a21])
  
      actual = self._latest_version(artifacts, n=4)
      self.assertEqual(actual, [a10, a11, a20, a21])
  
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 5 for calling the LatestVersionOpTest obj's underlying member method code with example usage: obj.testLatestVersion_DifferentSpans() without return types