code: def testConsecutiveSpans_SkipLastN(self):
      artifacts = (
          self._get_artifacts_for_sequential_rolling_range_tests()
      )
      a10, a20, a31, a30, a40, a50, _, _ = artifacts
  
      actual = self._consecutive_spans(artifacts)
      self.assertEqual(actual, [a10, a20, a31, a40, a50])
  
      actual = self._consecutive_spans(artifacts, skip_last_n=1)
      self.assertEqual(actual, [a10, a20, a31, a40, a50])
  
      actual = self._consecutive_spans(artifacts, skip_last_n=2)
      self.assertEqual(actual, [a10, a20, a31, a40, a50])
  
      actual = self._consecutive_spans(artifacts, skip_last_n=3)
      self.assertEqual(actual, [a10, a20, a31, a40, a50])
  
      actual = self._consecutive_spans(artifacts, skip_last_n=4)
      self.assertEqual(actual, [a10, a20, a31, a40])
  
      actual = self._consecutive_spans(artifacts, skip_last_n=5)
      self.assertEqual(actual, [a10, a20, a31])
  
      actual = self._consecutive_spans(artifacts, skip_last_n=6)
      self.assertEqual(actual, [a10, a20])
  
      actual = self._consecutive_spans(artifacts, skip_last_n=7)
      self.assertEqual(actual, [a10])
  
      actual = self._consecutive_spans(artifacts, skip_last_n=8)
      self.assertEqual(actual, [])
  
      # Tests version conflicts when keep_all_versions=True.
      actual = self._consecutive_spans(
          artifacts, keep_all_versions=True
      )
      self.assertEqual(actual, [a10, a20, a30, a31, a40, a50])
  
      actual = self._consecutive_spans(
          artifacts, skip_last_n=5, keep_all_versions=True
      )
      self.assertEqual(actual, [a10, a20, a30, a31])
  
      actual = self._consecutive_spans(
          artifacts, skip_last_n=6, keep_all_versions=True
      )
      self.assertEqual(actual, [a10, a20])
  
      # skip_last_n=9 is greater than the largest spans availble (8), so an
      # invalid range [0, -1] is created and no artifacts are returned.
      actual = self._consecutive_spans(artifacts, skip_last_n=9)
      self.assertEqual(actual, [])
  
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 8 for calling the ConsecutiveSpansOpTest obj's underlying member method code with example usage: obj.testConsecutiveSpans_SkipLastN() without return types