code: def test_enumerate_spans_enumerates_all_spans(self):
      tokenizer = SpacyWordSplitter(pos_tags=True)
      sentence = tokenizer.split_words("This is a sentence.")
  
      spans = span_utils.enumerate_spans(sentence)
      assert spans == [
          (0, 0),
          (0, 1),
          (0, 2),
          (0, 3),
          (0, 4),
          (1, 1),
          (1, 2),
          (1, 3),
          (1, 4),
          (2, 2),
          (2, 3),
          (2, 4),
          (3, 3),
          (3, 4),
          (4, 4),
      ]
  
      spans = span_utils.enumerate_spans(
          sentence, max_span_width=3, min_span_width=2
      )
      assert spans == [
          (0, 1),
          (0, 2),
          (1, 2),
          (1, 3),
          (2, 3),
          (2, 4),
          (3, 4),
      ]
  
      spans = span_utils.enumerate_spans(
          sentence, max_span_width=3, min_span_width=2, offset=20
      )
      assert spans == [
          (20, 21),
          (20, 22),
          (21, 22),
          (21, 23),
          (22, 23),
          (22, 24),
          (23, 24),
      ]
  
      def no_prefixed_punctuation(tokens):
          # Only include spans which don't start or end with punctuation.
          return (
              tokens[0].pos_ != "PUNCT" and tokens[-1].pos_ != "PUNCT"
          )
  
      spans = span_utils.enumerate_spans(
          sentence,
          max_span_width=3,
          min_span_width=2,
          filter_function=no_prefixed_punctuation,
      )
  
      # No longer includes (2, 4) or (3, 4) as these include punctuation
      # as their last element.
      assert spans == [(0, 1), (0, 2), (1, 2), (1, 3), (2, 3)]
  
file_path: magnitude/pymagnitude/third_party/allennlp/tests/data/dataset_readers/dataset_utils/span_utils_test.py
imports: from __future__ import with_statement
  from __future__ import absolute_import
  from allennlp.common.testing import AllenNlpTestCase
  from allennlp.data.dataset_readers.dataset_utils import span_utils
  from allennlp.data.tokenizers.word_tokenizer import SpacyWordSplitter
  from allennlp.data.tokenizers.token import Token
label_desc: Use image node_id 6 for calling the SpanUtilsTest obj's underlying member method code with example usage: obj.test_enumerate_spans_enumerates_all_spans() and returns: unknown