code: def test_different_span_tags():
      # set 3 labels for 2 spans (HU is tagged twice with different tags)
      sentence = Sentence(
          "Humboldt Universität zu Berlin is located in Berlin ."
      )
      sentence[0:4].add_label("ner", "Organization")
      sentence[0:4].add_label("orgtype", "University")
      sentence[7:8].add_label("ner", "City")
  
      # check if there are three labels with correct text and values
      labels: List[Label] = sentence.get_labels("ner")
      assert len(labels) == 2
      assert (
          labels[0].data_point.text == "Humboldt Universität zu Berlin"
      )
      assert labels[0].value == "Organization"
      assert labels[1].data_point.text == "Berlin"
      assert labels[1].value == "City"
  
      # check if there are two spans with correct text and values
      spans: List[Span] = sentence.get_spans("ner")
      assert len(spans) == 2
      assert spans[0].text == "Humboldt Universität zu Berlin"
      assert spans[0].get_label("ner").value == "Organization"
      assert spans[0].get_label("orgtype").value == "University"
      assert len(spans[0].get_labels("ner")) == 1
      assert spans[1].text == "Berlin"
      assert spans[1].get_label("ner").value == "City"
  
      # now delete the NER tags of "Humboldt-Universität zu Berlin"
      sentence[0:4].remove_labels("ner")
      # should be only one NER label left
      labels: List[Label] = sentence.get_labels("ner")
      assert len(labels) == 1
      assert labels[0].data_point.text == "Berlin"
      assert labels[0].value == "City"
      # and only one NER span
      spans: List[Span] = sentence.get_spans("ner")
      assert len(spans) == 1
      assert spans[0].text == "Berlin"
      assert spans[0].get_label("ner").value == "City"
      # but there is also one orgtype span and label
      labels: List[Label] = sentence.get_labels("orgtype")
      assert len(labels) == 1
      assert (
          labels[0].data_point.text == "Humboldt Universität zu Berlin"
      )
      assert labels[0].value == "University"
      # and only one NER span
      spans: List[Span] = sentence.get_spans("orgtype")
      assert len(spans) == 1
      assert spans[0].text == "Humboldt Universität zu Berlin"
      assert spans[0].get_label("orgtype").value == "University"
  
      # let's add the NER tag back
      sentence[0:4].add_label("ner", "Organization")
      # check if there are three labels with correct text and values
      labels: List[Label] = sentence.get_labels("ner")
      print(labels)
      assert len(labels) == 2
      assert (
          labels[0].data_point.text == "Humboldt Universität zu Berlin"
      )
      assert labels[0].value == "Organization"
      assert labels[1].data_point.text == "Berlin"
      assert labels[1].value == "City"
  
      # check if there are two spans with correct text and values
      spans: List[Span] = sentence.get_spans("ner")
      assert len(spans) == 2
      assert spans[0].text == "Humboldt Universität zu Berlin"
      assert spans[0].get_label("ner").value == "Organization"
      assert spans[0].get_label("orgtype").value == "University"
      assert len(spans[0].get_labels("ner")) == 1
      assert spans[1].text == "Berlin"
      assert spans[1].get_label("ner").value == "City"
  
      # now remove all NER tags
      sentence.remove_labels("ner")
      assert len(sentence.get_labels("ner")) == 0
      assert len(sentence.get_spans("ner")) == 0
      assert len(sentence.get_spans("orgtype")) == 1
      assert len(sentence.get_labels("orgtype")) == 1
      assert len(sentence.labels) == 1
  
      assert len(sentence[0:4].get_labels("ner")) == 0
      assert len(sentence[0:4].get_labels("orgtype")) == 1
  
file_path: flair/tests/test_labels.py
imports: from typing import List
  from flair.data import Label, Relation, Sentence, Span
label_desc: Use image node_id 3 for calling a global function with example usage: test_different_span_tags() without return types