code: def test_bioul_tags_to_spans(self):
      tag_sequence = ["B-PER", "I-PER", "L-PER", "U-PER", "U-LOC", "O"]
      spans = span_utils.bioul_tags_to_spans(tag_sequence)
      assert spans == [
          ("PER", (0, 2)),
          ("PER", (3, 3)),
          ("LOC", (4, 4)),
      ]
  
      tag_sequence = ["B-PER", "I-PER", "O"]
      with self.assertRaises(span_utils.InvalidTagSequence):
          spans = span_utils.bioul_tags_to_spans(tag_sequence)
  
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 7 for calling the SpanUtilsTest obj's underlying member method code with example usage: obj.test_bioul_tags_to_spans() without return types