code: def testLatestSpan_Simple(self):
      a1 = test_utils.DummyArtifact()
      a2 = test_utils.DummyArtifact()
      a3 = test_utils.DummyArtifact()
      a4 = test_utils.DummyArtifact()
      a5 = ArtifactWithoutSpan()
      a6 = ArtifactWithoutSpanOrVersion()
  
      a1.span = 1
      a2.span = 2
      a3.span = 2
      a4.span = 3
  
      a1.version = 1
      a2.version = 1
      a3.version = 2
      a4.version = 1
      a5.version = 1
  
      artifacts = [a1, a2, a3, a4, a5, a6]
  
      actual = self._latest_span(artifacts, n=1)
      self.assertEqual(actual, [a4])
  
      actual = self._latest_span(artifacts, n=2)
      self.assertEqual(actual, [a3, a4])
  
      actual = self._latest_span(artifacts, n=2, keep_all_versions=True)
      self.assertEqual(actual, [a2, a3, a4])
  
      actual = self._latest_span(artifacts, n=3)
      self.assertEqual(actual, [a1, a3, a4])
  
      actual = self._latest_span(
          [a1, a2, a3, a4, a5], n=3, keep_all_versions=True
      )
      self.assertEqual(actual, [a1, a2, a3, a4])
  
      actual = self._latest_span([a1, a2, a3, a4, a5], n=4)
      self.assertEqual(actual, [a1, a3, a4])
  
      actual = self._latest_span(
          [a1, a2, a3, a4, a5], n=4, keep_all_versions=True
      )
      self.assertEqual(actual, [a1, a2, a3, a4])
  
      actual = self._latest_span([a1, a2, a3, a4, a5], n=-1)
      self.assertEqual(actual, [a1, a3, a4])
  
      actual = self._latest_span([a1, a2, a3, a4, a5], n=-1)
      self.assertEqual(actual, [a1, a3, a4])
  
      actual = self._latest_span(
          [a1, a2, a3, a4, a5], n=-1, keep_all_versions=True
      )
      self.assertEqual(actual, [a1, a2, a3, a4])
  
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
  from tfx.types import artifact
label_desc: Use image node_id 5 for calling the LatestSpanOpTest obj's underlying member method code with example usage: obj.testLatestSpan_Simple() without return types